diff options
author | Haibo Huang <hhb@google.com> | 2019-05-13 16:38:42 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2019-05-13 16:38:42 -0700 |
commit | d648c2a4868c62db146c13f62b38d749db674ab2 (patch) | |
tree | cfeb5f4e886f8902407dc4c5bab3a88513d0fe55 /Lib/fontTools/feaLib | |
parent | 195ed3228f2e5c0f6a9cc31e9c0f081646eda9eb (diff) | |
download | fonttools-d648c2a4868c62db146c13f62b38d749db674ab2.tar.gz |
Upgrade fonttools to 3.41.2
Test: None
Change-Id: I5263a62cab851cde83c296124418c8e72afffe4e
Diffstat (limited to 'Lib/fontTools/feaLib')
-rw-r--r-- | Lib/fontTools/feaLib/ast.py | 6 | ||||
-rw-r--r-- | Lib/fontTools/feaLib/builder.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/fontTools/feaLib/ast.py b/Lib/fontTools/feaLib/ast.py index 39dc4bcf..1994fc08 100644 --- a/Lib/fontTools/feaLib/ast.py +++ b/Lib/fontTools/feaLib/ast.py @@ -1143,6 +1143,12 @@ class ValueRecord(Expression): elif yAdvance is None and not vertical: return str(xAdvance) + # Make any remaining None value 0 to avoid generating invalid records. + x = x or 0 + y = y or 0 + xAdvance = xAdvance or 0 + yAdvance = yAdvance or 0 + # Try format B, if possible. if (xPlaDevice is None and yPlaDevice is None and xAdvDevice is None and yAdvDevice is None): diff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py index 456ae3cc..8880acf1 100644 --- a/Lib/fontTools/feaLib/builder.py +++ b/Lib/fontTools/feaLib/builder.py @@ -7,6 +7,7 @@ from fontTools.feaLib.error import FeatureLibError from fontTools.feaLib.parser import Parser from fontTools.feaLib.ast import FeatureFile from fontTools.otlLib import builder as otl +from fontTools.otlLib.maxContextCalc import maxCtxFont from fontTools.ttLib import newTable, getTableModule from fontTools.ttLib.tables import otBase, otTables from collections import defaultdict, OrderedDict @@ -137,6 +138,9 @@ class Builder(object): fontTable.table = table elif tag in self.font: del self.font[tag] + if (any(tag in self.font for tag in ("GPOS", "GSUB")) and + "OS/2" in self.font): + self.font["OS/2"].usMaxContext = maxCtxFont(self.font) if "GDEF" in tables: gdef = self.buildGDEF() if gdef: |