gross hack to allow ; in glyph names (I don't think it _is_ allowed, but hey, I've got this font here...)

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@260 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2002-05-24 17:42:04 +00:00
parent dd2fea582a
commit 1872557451

View File

@ -67,6 +67,8 @@ class table__h_d_m_x(DefaultTable.DefaultTable):
for ppem in ppems:
widths = self.hdmx[ppem]
row.append(widths[glyphName])
if ";" in glyphName:
glyphName = "\\x3b".join(glyphName.split(";"))
writer.write(format % ((glyphName,) + tuple(row)))
writer.newline()
writer.endtag("hdmxData")
@ -89,6 +91,9 @@ class table__h_d_m_x(DefaultTable.DefaultTable):
continue
assert line[0][-1] == ":", "illegal hdmx format"
glyphName = line[0][:-1]
if "\\" in glyphName:
from fontTools.misc.textTools import safeEval
glyphName = safeEval('"""' + glyphName + '"""')
line = map(int, line[1:])
assert len(line) == len(ppems), "illegal hdmx format"
for i in range(len(ppems)):