diff --git a/Lib/fontTools/ttLib/__init__.py b/Lib/fontTools/ttLib/__init__.py index e458b1ceb..4e141fb40 100644 --- a/Lib/fontTools/ttLib/__init__.py +++ b/Lib/fontTools/ttLib/__init__.py @@ -42,7 +42,7 @@ Dumping 'prep' table... """ # -# $Id: __init__.py,v 1.33 2002-05-25 14:56:29 jvr Exp $ +# $Id: __init__.py,v 1.34 2002-05-25 15:28:48 jvr Exp $ # import os @@ -258,10 +258,10 @@ class TTFont: a font object. """ if self.has_key("maxp") and self.has_key("post"): - # Make sure the glyph order is loaded, as it otherwise may - # get lost if the XML doesn't contain the glyph order, yet - # does contain the CFF table, which then can't be used to - # retrieve the glyph order. + # Make sure the glyph order is loaded, as it otherwise gets + # lost if the XML doesn't contain the glyph order, yet does + # contain the table which was originally used to extract the + # glyph names from (ie. 'post', 'cmap' or 'CFF '). self.getGlyphOrder() import xmlImport xmlImport.importXML(self, file, progress) @@ -342,10 +342,6 @@ class TTFont: def setGlyphOrder(self, glyphOrder): self.glyphOrder = glyphOrder - if self.has_key('CFF '): - self['CFF '].setGlyphOrder(glyphOrder) - if self.has_key('glyf'): - self['glyf'].setGlyphOrder(glyphOrder) def getGlyphOrder(self): try: diff --git a/Lib/fontTools/ttLib/tables/_g_l_y_f.py b/Lib/fontTools/ttLib/tables/_g_l_y_f.py index 19a75e08b..39a2f0ab3 100644 --- a/Lib/fontTools/ttLib/tables/_g_l_y_f.py +++ b/Lib/fontTools/ttLib/tables/_g_l_y_f.py @@ -52,7 +52,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable): currentLocation = 0 dataList = [] recalcBBoxes = ttFont.recalcBBoxes - for glyphName in ttFont.getGlyphOrder(): + for glyphName in self.glyphOrder: glyph = self.glyphs[glyphName] glyphData = glyph.compile(self, recalcBBoxes) locations.append(currentLocation) diff --git a/Lib/fontTools/ttLib/xmlImport.py b/Lib/fontTools/ttLib/xmlImport.py index bff20cf49..271b27710 100644 --- a/Lib/fontTools/ttLib/xmlImport.py +++ b/Lib/fontTools/ttLib/xmlImport.py @@ -78,14 +78,8 @@ class ExpatParser: tableClass = ttLib.getTableClass(tag) if tableClass is None: tableClass = DefaultTable - if tag in ('post', 'loca') and self.ttFont.has_key(tag): - # Special-case 'post' to prevent a bootstrap problem with - # ttCompile.py -i: - # - import post table from XML - # - don't import glyf table from XML - # - the glyphOrder is in the *original* binary post table - # So: we can't throw away the original post table. - # Also special-case the 'laca' table as we need the + if tag == 'loca' and self.ttFont.has_key(tag): + # Special-case the 'loca' table as we need the # original if the 'glyf' table isn't recompiled. self.currentTable = self.ttFont[tag] else: