From 1a53beb7b4bb252dc002dcdc2de70517d4727494 Mon Sep 17 00:00:00 2001 From: jvr Date: Thu, 12 Sep 2002 17:09:13 +0000 Subject: [PATCH] renamed table to rawTable git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@344 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/ttLib/tables/otTables.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index 8e107b8a1..c895be223 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -21,12 +21,12 @@ class Coverage(FormatSwitchingBaseTable): # manual implementation to get rid of glyphID dependencies - def postRead(self, table, font): + def postRead(self, rawTable, font): if self.Format == 1: - self.glyphs = table["GlyphArray"] + self.glyphs = rawTable["GlyphArray"] elif self.Format == 2: glyphs = self.glyphs = [] - ranges = table["RangeRecord"] + ranges = rawTable["RangeRecord"] for r in ranges: assert r.StartCoverageIndex == len(glyphs), \ (r.StartCoverageIndex, len(glyphs)) @@ -40,12 +40,13 @@ class Coverage(FormatSwitchingBaseTable): if start != end: glyphs.append(end) else: - assert 0 + assert 0, "unknown format: %s" % self.Format def preWrite(self, font): format = 1 - table = {"GlyphArray": self.glyphs} + rawTable = {"GlyphArray": self.glyphs} if self.glyphs: + # find out whether Format 2 is more compact or not glyphIDs = [] for glyphName in self.glyphs: glyphIDs.append(font.getGlyphID(glyphName)) @@ -73,11 +74,11 @@ class Coverage(FormatSwitchingBaseTable): ranges[i] = r index = index + end - start + 1 format = 2 - table = {"RangeRecord": ranges} + rawTable = {"RangeRecord": ranges} #else: # fallthrough; Format 1 is more compact self.Format = format - return table + return rawTable def toXML2(self, xmlWriter, font): for glyphName in self.glyphs: