From 1872557451256004f27133686eeddbbbdf163c69 Mon Sep 17 00:00:00 2001 From: jvr Date: Fri, 24 May 2002 17:42:04 +0000 Subject: [PATCH] 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 --- Lib/fontTools/ttLib/tables/_h_d_m_x.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/fontTools/ttLib/tables/_h_d_m_x.py b/Lib/fontTools/ttLib/tables/_h_d_m_x.py index 48a5f7b2d..0fe45f0cb 100644 --- a/Lib/fontTools/ttLib/tables/_h_d_m_x.py +++ b/Lib/fontTools/ttLib/tables/_h_d_m_x.py @@ -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)):