From e8f5bbcc6a68aa16cc59ebb95d75e997bcc43033 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 24 Oct 2019 15:42:09 +0100 Subject: [PATCH] renamed LiteralCount to StaticCount makes it clearer what it is --- Lib/fontTools/ttLib/tables/otBase.py | 6 +++--- Lib/fontTools/ttLib/tables/otTables.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py index f4a39e5f3..8769162d5 100644 --- a/Lib/fontTools/ttLib/tables/otBase.py +++ b/Lib/fontTools/ttLib/tables/otBase.py @@ -498,7 +498,7 @@ class OTTableWriter(object): return OverflowErrorRecord( (self.tableTag, LookupListIndex, SubTableIndex, itemName, itemIndex) ) -class LiteralCount(int): +class StaticCount(int): """A count value that should be taken literally, rather than recomputed on compile.""" pass @@ -695,9 +695,9 @@ class BaseTable(object): # table. We will later store it here. # We add a reference: by the time the data is assembled # the Count value will be filled in. - if not isinstance(value, LiteralCount): + if not isinstance(value, StaticCount): # we ignore the current count value since it's being recomputed, - # unless this is a LiteralCount, which is assumed to be already correct. + # unless this is of type StaticCount, which is assumed to be correct. value = None ref = writer.writeCountReference(table, conv.name, conv.staticSize, value) table[conv.name] = value diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index 53f9fa82f..30ad61334 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -7,7 +7,7 @@ converter objects from otConverters.py. """ from fontTools.misc.py23 import * from fontTools.misc.textTools import pad, safeEval -from .otBase import BaseTable, FormatSwitchingBaseTable, ValueRecord, LiteralCount +from .otBase import BaseTable, FormatSwitchingBaseTable, ValueRecord, StaticCount import logging import struct @@ -699,7 +699,7 @@ class VarRegionList(BaseTable): # https://github.com/khaledhosny/ots/pull/192 fvarTable = font.get("fvar") if fvarTable: - self.RegionAxisCount = LiteralCount(len(fvarTable.axes)) + self.RegionAxisCount = StaticCount(len(fvarTable.axes)) return self.__dict__.copy()