fonttools 4.57.0__py3-none-any.whl → 4.58.0__py3-none-any.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/cffLib/__init__.py +61 -26
- fontTools/designspaceLib/statNames.py +14 -7
- fontTools/feaLib/ast.py +84 -10
- fontTools/feaLib/builder.py +20 -4
- fontTools/feaLib/parser.py +1 -39
- fontTools/fontBuilder.py +6 -0
- fontTools/misc/etree.py +4 -27
- fontTools/mtiLib/__init__.py +0 -2
- fontTools/otlLib/builder.py +195 -145
- fontTools/otlLib/optimize/gpos.py +42 -62
- fontTools/pens/pointPen.py +21 -12
- fontTools/subset/__init__.py +11 -0
- fontTools/ttLib/tables/G_V_A_R_.py +5 -0
- fontTools/ttLib/tables/T_S_I__0.py +14 -3
- fontTools/ttLib/tables/T_S_I__5.py +16 -5
- fontTools/ttLib/tables/__init__.py +1 -0
- fontTools/ttLib/tables/_c_v_t.py +2 -0
- fontTools/ttLib/tables/_f_p_g_m.py +3 -1
- fontTools/ttLib/tables/_g_l_y_f.py +2 -6
- fontTools/ttLib/tables/_g_v_a_r.py +58 -15
- fontTools/ttLib/tables/_p_o_s_t.py +5 -2
- fontTools/ttLib/tables/otBase.py +1 -0
- fontTools/ufoLib/__init__.py +2 -2
- fontTools/ufoLib/converters.py +89 -25
- fontTools/ufoLib/errors.py +8 -0
- fontTools/ufoLib/etree.py +1 -1
- fontTools/ufoLib/filenames.py +155 -100
- fontTools/ufoLib/glifLib.py +9 -2
- fontTools/ufoLib/kerning.py +66 -36
- fontTools/ufoLib/utils.py +5 -2
- fontTools/unicodedata/Mirrored.py +446 -0
- fontTools/unicodedata/__init__.py +6 -2
- fontTools/varLib/__init__.py +2 -0
- fontTools/voltLib/__main__.py +206 -0
- fontTools/voltLib/ast.py +4 -0
- fontTools/voltLib/parser.py +16 -8
- fontTools/voltLib/voltToFea.py +347 -166
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/METADATA +45 -11
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/RECORD +46 -42
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/WHEEL +1 -1
- fonttools-4.58.0.dist-info/licenses/LICENSE.external +359 -0
- {fonttools-4.57.0.data → fonttools-4.58.0.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/entry_points.txt +0 -0
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/licenses/LICENSE +0 -0
- {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/top_level.txt +0 -0
fontTools/voltLib/parser.py
CHANGED
|
@@ -313,19 +313,27 @@ class Parser(object):
|
|
|
313
313
|
self.expect_keyword_("END_SUBSTITUTION")
|
|
314
314
|
max_src = max([len(cov) for cov in src])
|
|
315
315
|
max_dest = max([len(cov) for cov in dest])
|
|
316
|
+
|
|
316
317
|
# many to many or mixed is invalid
|
|
317
|
-
if
|
|
318
|
-
reversal and (max_src > 1 or max_dest > 1)
|
|
319
|
-
):
|
|
318
|
+
if max_src > 1 and max_dest > 1:
|
|
320
319
|
raise VoltLibError("Invalid substitution type", location)
|
|
320
|
+
|
|
321
321
|
mapping = dict(zip(tuple(src), tuple(dest)))
|
|
322
322
|
if max_src == 1 and max_dest == 1:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
# Alternate substitutions are represented by adding multiple
|
|
324
|
+
# substitutions for the same glyph, so we detect that here
|
|
325
|
+
glyphs = [x.glyphSet() for cov in src for x in cov] # flatten src
|
|
326
|
+
if len(set(glyphs)) != len(glyphs): # src has duplicates
|
|
327
|
+
sub = ast.SubstitutionAlternateDefinition(mapping, location=location)
|
|
327
328
|
else:
|
|
328
|
-
|
|
329
|
+
if reversal:
|
|
330
|
+
# Reversal is valid only for single glyph substitutions
|
|
331
|
+
# and VOLT ignores it otherwise.
|
|
332
|
+
sub = ast.SubstitutionReverseChainingSingleDefinition(
|
|
333
|
+
mapping, location=location
|
|
334
|
+
)
|
|
335
|
+
else:
|
|
336
|
+
sub = ast.SubstitutionSingleDefinition(mapping, location=location)
|
|
329
337
|
elif max_src == 1 and max_dest > 1:
|
|
330
338
|
sub = ast.SubstitutionMultipleDefinition(mapping, location=location)
|
|
331
339
|
elif max_src > 1 and max_dest == 1:
|