fonttools 4.55.4__cp38-cp38-macosx_10_9_universal2.whl → 4.55.7__cp38-cp38-macosx_10_9_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fonttools might be problematic. Click here for more details.
- fontTools/__init__.py +1 -1
- fontTools/cu2qu/cu2qu.cpython-38-darwin.so +0 -0
- fontTools/feaLib/builder.py +7 -1
- fontTools/feaLib/lexer.cpython-38-darwin.so +0 -0
- fontTools/misc/bezierTools.cpython-38-darwin.so +0 -0
- fontTools/pens/momentsPen.cpython-38-darwin.so +0 -0
- fontTools/qu2cu/qu2cu.cpython-38-darwin.so +0 -0
- fontTools/ttLib/tables/_g_l_y_f.py +30 -6
- fontTools/varLib/iup.cpython-38-darwin.so +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/METADATA +19 -1381
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/RECORD +16 -16
- {fonttools-4.55.4.data → fonttools-4.55.7.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/LICENSE +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/WHEEL +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/entry_points.txt +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.55.7.dist-info}/top_level.txt +0 -0
fontTools/__init__.py
CHANGED
|
Binary file
|
fontTools/feaLib/builder.py
CHANGED
|
@@ -1106,7 +1106,13 @@ class Builder(object):
|
|
|
1106
1106
|
if (language == "dflt" or include_default) and lookups:
|
|
1107
1107
|
self.features_[key] = lookups[:]
|
|
1108
1108
|
else:
|
|
1109
|
-
|
|
1109
|
+
# if we aren't including default we need to manually remove the
|
|
1110
|
+
# default lookups, which were added to all declared langsystems
|
|
1111
|
+
# as they were encountered (we don't remove all lookups because
|
|
1112
|
+
# we want to allow duplicate script/lang statements;
|
|
1113
|
+
# see https://github.com/fonttools/fonttools/issues/3748
|
|
1114
|
+
cur_lookups = self.features_.get(key, [])
|
|
1115
|
+
self.features_[key] = [x for x in cur_lookups if x not in lookups]
|
|
1110
1116
|
self.language_systems = frozenset([(self.script_, language)])
|
|
1111
1117
|
|
|
1112
1118
|
if required:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1187,7 +1187,7 @@ class Glyph(object):
|
|
|
1187
1187
|
):
|
|
1188
1188
|
return
|
|
1189
1189
|
try:
|
|
1190
|
-
coords, endPts, flags = self.getCoordinates(glyfTable)
|
|
1190
|
+
coords, endPts, flags = self.getCoordinates(glyfTable, round=otRound)
|
|
1191
1191
|
self.xMin, self.yMin, self.xMax, self.yMax = coords.calcIntBounds()
|
|
1192
1192
|
except NotImplementedError:
|
|
1193
1193
|
pass
|
|
@@ -1206,9 +1206,7 @@ class Glyph(object):
|
|
|
1206
1206
|
Return True if bounds were calculated, False otherwise.
|
|
1207
1207
|
"""
|
|
1208
1208
|
for compo in self.components:
|
|
1209
|
-
if
|
|
1210
|
-
return False
|
|
1211
|
-
if not float(compo.x).is_integer() or not float(compo.y).is_integer():
|
|
1209
|
+
if not compo._hasOnlyIntegerTranslate():
|
|
1212
1210
|
return False
|
|
1213
1211
|
|
|
1214
1212
|
# All components are untransformed and have an integer x/y translate
|
|
@@ -1241,7 +1239,7 @@ class Glyph(object):
|
|
|
1241
1239
|
else:
|
|
1242
1240
|
return self.numberOfContours == -1
|
|
1243
1241
|
|
|
1244
|
-
def getCoordinates(self, glyfTable):
|
|
1242
|
+
def getCoordinates(self, glyfTable, *, round=noRound):
|
|
1245
1243
|
"""Return the coordinates, end points and flags
|
|
1246
1244
|
|
|
1247
1245
|
This method returns three values: A :py:class:`GlyphCoordinates` object,
|
|
@@ -1267,13 +1265,27 @@ class Glyph(object):
|
|
|
1267
1265
|
for compo in self.components:
|
|
1268
1266
|
g = glyfTable[compo.glyphName]
|
|
1269
1267
|
try:
|
|
1270
|
-
coordinates, endPts, flags = g.getCoordinates(
|
|
1268
|
+
coordinates, endPts, flags = g.getCoordinates(
|
|
1269
|
+
glyfTable, round=round
|
|
1270
|
+
)
|
|
1271
1271
|
except RecursionError:
|
|
1272
1272
|
raise ttLib.TTLibError(
|
|
1273
1273
|
"glyph '%s' contains a recursive component reference"
|
|
1274
1274
|
% compo.glyphName
|
|
1275
1275
|
)
|
|
1276
1276
|
coordinates = GlyphCoordinates(coordinates)
|
|
1277
|
+
# if asked to round e.g. while computing bboxes, it's important we
|
|
1278
|
+
# do it immediately before a component transform is applied to a
|
|
1279
|
+
# simple glyph's coordinates in case these might still contain floats;
|
|
1280
|
+
# however, if the referenced component glyph is another composite, we
|
|
1281
|
+
# must not round here but only at the end, after all the nested
|
|
1282
|
+
# transforms have been applied, or else rounding errors will compound.
|
|
1283
|
+
if (
|
|
1284
|
+
round is not noRound
|
|
1285
|
+
and g.numberOfContours > 0
|
|
1286
|
+
and not compo._hasOnlyIntegerTranslate()
|
|
1287
|
+
):
|
|
1288
|
+
coordinates.toInt(round=round)
|
|
1277
1289
|
if hasattr(compo, "firstPt"):
|
|
1278
1290
|
# component uses two reference points: we apply the transform _before_
|
|
1279
1291
|
# computing the offset between the points
|
|
@@ -1930,6 +1942,18 @@ class GlyphComponent(object):
|
|
|
1930
1942
|
result = self.__eq__(other)
|
|
1931
1943
|
return result if result is NotImplemented else not result
|
|
1932
1944
|
|
|
1945
|
+
def _hasOnlyIntegerTranslate(self):
|
|
1946
|
+
"""Return True if it's a 'simple' component.
|
|
1947
|
+
|
|
1948
|
+
That is, it has no anchor points and no transform other than integer translate.
|
|
1949
|
+
"""
|
|
1950
|
+
return (
|
|
1951
|
+
not hasattr(self, "firstPt")
|
|
1952
|
+
and not hasattr(self, "transform")
|
|
1953
|
+
and float(self.x).is_integer()
|
|
1954
|
+
and float(self.y).is_integer()
|
|
1955
|
+
)
|
|
1956
|
+
|
|
1933
1957
|
|
|
1934
1958
|
class GlyphCoordinates(object):
|
|
1935
1959
|
"""A list of glyph coordinates.
|
|
Binary file
|