fonttools 4.55.4__cp313-cp313-musllinux_1_2_aarch64.whl → 4.61.1__cp313-cp313-musllinux_1_2_aarch64.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.
- fontTools/__init__.py +1 -1
- fontTools/annotations.py +30 -0
- fontTools/cffLib/CFF2ToCFF.py +65 -10
- fontTools/cffLib/__init__.py +61 -26
- fontTools/cffLib/specializer.py +4 -1
- fontTools/cffLib/transforms.py +11 -6
- fontTools/config/__init__.py +15 -0
- fontTools/cu2qu/cu2qu.c +6567 -5579
- fontTools/cu2qu/cu2qu.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/cu2qu/cu2qu.py +36 -4
- fontTools/cu2qu/ufo.py +14 -0
- fontTools/designspaceLib/__init__.py +8 -3
- fontTools/designspaceLib/statNames.py +14 -7
- fontTools/feaLib/ast.py +24 -15
- fontTools/feaLib/builder.py +139 -66
- fontTools/feaLib/error.py +1 -1
- fontTools/feaLib/lexer.c +7038 -7995
- fontTools/feaLib/lexer.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/feaLib/parser.py +75 -40
- fontTools/feaLib/variableScalar.py +6 -1
- fontTools/fontBuilder.py +50 -44
- fontTools/merge/__init__.py +1 -1
- fontTools/merge/cmap.py +33 -1
- fontTools/merge/tables.py +12 -1
- fontTools/misc/bezierTools.c +14913 -17013
- fontTools/misc/bezierTools.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/misc/bezierTools.py +4 -1
- fontTools/misc/configTools.py +3 -1
- fontTools/misc/enumTools.py +23 -0
- fontTools/misc/etree.py +4 -27
- fontTools/misc/filesystem/__init__.py +68 -0
- fontTools/misc/filesystem/_base.py +134 -0
- fontTools/misc/filesystem/_copy.py +45 -0
- fontTools/misc/filesystem/_errors.py +54 -0
- fontTools/misc/filesystem/_info.py +75 -0
- fontTools/misc/filesystem/_osfs.py +164 -0
- fontTools/misc/filesystem/_path.py +67 -0
- fontTools/misc/filesystem/_subfs.py +92 -0
- fontTools/misc/filesystem/_tempfs.py +34 -0
- fontTools/misc/filesystem/_tools.py +34 -0
- fontTools/misc/filesystem/_walk.py +55 -0
- fontTools/misc/filesystem/_zipfs.py +204 -0
- fontTools/misc/fixedTools.py +1 -1
- fontTools/misc/loggingTools.py +1 -1
- fontTools/misc/psCharStrings.py +17 -2
- fontTools/misc/sstruct.py +2 -6
- fontTools/misc/symfont.py +6 -8
- fontTools/misc/testTools.py +5 -1
- fontTools/misc/textTools.py +4 -2
- fontTools/misc/visitor.py +32 -16
- fontTools/misc/xmlWriter.py +44 -8
- fontTools/mtiLib/__init__.py +1 -3
- fontTools/otlLib/builder.py +402 -155
- fontTools/otlLib/optimize/gpos.py +49 -63
- fontTools/pens/filterPen.py +218 -26
- fontTools/pens/momentsPen.c +5514 -5584
- fontTools/pens/momentsPen.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/pens/pointPen.py +61 -18
- fontTools/pens/roundingPen.py +2 -2
- fontTools/pens/t2CharStringPen.py +31 -11
- fontTools/qu2cu/qu2cu.c +6581 -6168
- fontTools/qu2cu/qu2cu.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/subset/__init__.py +283 -25
- fontTools/subset/svg.py +2 -3
- fontTools/ttLib/__init__.py +4 -0
- fontTools/ttLib/__main__.py +47 -8
- fontTools/ttLib/removeOverlaps.py +7 -5
- fontTools/ttLib/reorderGlyphs.py +8 -7
- fontTools/ttLib/sfnt.py +11 -9
- fontTools/ttLib/tables/D__e_b_g.py +20 -2
- fontTools/ttLib/tables/G_V_A_R_.py +5 -0
- fontTools/ttLib/tables/S__i_l_f.py +2 -2
- fontTools/ttLib/tables/T_S_I__0.py +14 -3
- fontTools/ttLib/tables/T_S_I__1.py +2 -5
- fontTools/ttLib/tables/T_S_I__5.py +18 -7
- fontTools/ttLib/tables/__init__.py +1 -0
- fontTools/ttLib/tables/_a_v_a_r.py +12 -3
- fontTools/ttLib/tables/_c_m_a_p.py +20 -7
- fontTools/ttLib/tables/_c_v_t.py +3 -2
- fontTools/ttLib/tables/_f_p_g_m.py +3 -1
- fontTools/ttLib/tables/_g_l_y_f.py +45 -21
- fontTools/ttLib/tables/_g_v_a_r.py +67 -19
- fontTools/ttLib/tables/_h_d_m_x.py +4 -4
- fontTools/ttLib/tables/_h_m_t_x.py +7 -3
- fontTools/ttLib/tables/_l_o_c_a.py +2 -2
- fontTools/ttLib/tables/_n_a_m_e.py +11 -6
- fontTools/ttLib/tables/_p_o_s_t.py +9 -7
- fontTools/ttLib/tables/otBase.py +5 -12
- fontTools/ttLib/tables/otConverters.py +5 -2
- fontTools/ttLib/tables/otData.py +1 -1
- fontTools/ttLib/tables/otTables.py +33 -30
- fontTools/ttLib/tables/otTraverse.py +2 -1
- fontTools/ttLib/tables/sbixStrike.py +3 -3
- fontTools/ttLib/ttFont.py +666 -120
- fontTools/ttLib/ttGlyphSet.py +0 -10
- fontTools/ttLib/woff2.py +10 -13
- fontTools/ttx.py +13 -1
- fontTools/ufoLib/__init__.py +300 -202
- fontTools/ufoLib/converters.py +103 -30
- fontTools/ufoLib/errors.py +8 -0
- fontTools/ufoLib/etree.py +1 -1
- fontTools/ufoLib/filenames.py +171 -106
- fontTools/ufoLib/glifLib.py +303 -205
- fontTools/ufoLib/kerning.py +98 -48
- fontTools/ufoLib/utils.py +46 -15
- fontTools/ufoLib/validators.py +121 -99
- fontTools/unicodedata/Blocks.py +35 -20
- fontTools/unicodedata/Mirrored.py +446 -0
- fontTools/unicodedata/ScriptExtensions.py +63 -37
- fontTools/unicodedata/Scripts.py +173 -152
- fontTools/unicodedata/__init__.py +10 -2
- fontTools/varLib/__init__.py +198 -109
- fontTools/varLib/avar/__init__.py +0 -0
- fontTools/varLib/avar/__main__.py +72 -0
- fontTools/varLib/avar/build.py +79 -0
- fontTools/varLib/avar/map.py +108 -0
- fontTools/varLib/avar/plan.py +1004 -0
- fontTools/varLib/{avar.py → avar/unbuild.py} +70 -59
- fontTools/varLib/avarPlanner.py +3 -999
- fontTools/varLib/featureVars.py +21 -7
- fontTools/varLib/hvar.py +113 -0
- fontTools/varLib/instancer/__init__.py +180 -65
- fontTools/varLib/interpolatableHelpers.py +3 -0
- fontTools/varLib/iup.c +7564 -6903
- fontTools/varLib/iup.cpython-313-aarch64-linux-musl.so +0 -0
- fontTools/varLib/models.py +17 -2
- fontTools/varLib/mutator.py +11 -0
- fontTools/varLib/varStore.py +10 -38
- 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.55.4.dist-info → fonttools-4.61.1.dist-info}/METADATA +269 -1410
- {fonttools-4.55.4.dist-info → fonttools-4.61.1.dist-info}/RECORD +318 -294
- {fonttools-4.55.4.dist-info → fonttools-4.61.1.dist-info}/WHEEL +1 -1
- fonttools-4.61.1.dist-info/licenses/LICENSE.external +388 -0
- {fonttools-4.55.4.data → fonttools-4.61.1.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.61.1.dist-info}/entry_points.txt +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.61.1.dist-info/licenses}/LICENSE +0 -0
- {fonttools-4.55.4.dist-info → fonttools-4.61.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from fontTools.varLib.models import normalizeValue
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def _denormalize(v, triplet):
|
|
5
|
+
if v >= 0:
|
|
6
|
+
return triplet[1] + v * (triplet[2] - triplet[1])
|
|
7
|
+
else:
|
|
8
|
+
return triplet[1] + v * (triplet[1] - triplet[0])
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def map(
|
|
12
|
+
font, location, *, inputNormalized=False, outputNormalized=False, dropZeroes=False
|
|
13
|
+
):
|
|
14
|
+
if "fvar" not in font:
|
|
15
|
+
return None
|
|
16
|
+
|
|
17
|
+
fvar = font["fvar"]
|
|
18
|
+
axes = {a.axisTag: (a.minValue, a.defaultValue, a.maxValue) for a in fvar.axes}
|
|
19
|
+
|
|
20
|
+
if not inputNormalized:
|
|
21
|
+
location = {
|
|
22
|
+
tag: normalizeValue(value, axes[tag]) for tag, value in location.items()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if "avar" in font:
|
|
26
|
+
location = font["avar"].renormalizeLocation(location, font, dropZeroes)
|
|
27
|
+
|
|
28
|
+
if not outputNormalized:
|
|
29
|
+
location = {
|
|
30
|
+
tag: _denormalize(value, axes[tag]) for tag, value in location.items()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return location
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def main(args=None):
|
|
37
|
+
"""Map variation coordinates through the `avar` table."""
|
|
38
|
+
|
|
39
|
+
from fontTools.ttLib import TTFont
|
|
40
|
+
import argparse
|
|
41
|
+
|
|
42
|
+
if args is None:
|
|
43
|
+
import sys
|
|
44
|
+
|
|
45
|
+
args = sys.argv[1:]
|
|
46
|
+
|
|
47
|
+
parser = argparse.ArgumentParser(
|
|
48
|
+
"fonttools varLib.avar.map",
|
|
49
|
+
description="Map variation coordinates through the `avar` table.",
|
|
50
|
+
)
|
|
51
|
+
parser.add_argument("font", metavar="varfont.ttf", help="Variable-font file.")
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"coords",
|
|
54
|
+
metavar="[AXIS=value...]",
|
|
55
|
+
help="Coordinates to map, e.g. 'wght=700 wdth=75'.",
|
|
56
|
+
nargs="*",
|
|
57
|
+
default=None,
|
|
58
|
+
)
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
"-f", action="store_true", help="Do not omit axes at default location."
|
|
61
|
+
)
|
|
62
|
+
parser.add_argument(
|
|
63
|
+
"-i", action="store_true", help="Input coordinates are normalized (-1..1)."
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument(
|
|
66
|
+
"-o", action="store_true", help="Output coordinates as normalized (-1..1)."
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
options = parser.parse_args(args)
|
|
70
|
+
|
|
71
|
+
if not options.coords:
|
|
72
|
+
parser.error(
|
|
73
|
+
"No coordinates provided. Please specify at least one axis coordinate (e.g., wght=500)"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
if options.font.endswith(".designspace"):
|
|
77
|
+
from .build import build
|
|
78
|
+
|
|
79
|
+
font = TTFont()
|
|
80
|
+
build(font, options.font)
|
|
81
|
+
else:
|
|
82
|
+
font = TTFont(options.font)
|
|
83
|
+
if "fvar" not in font:
|
|
84
|
+
parser.error(f"Font '{options.font}' does not contain an 'fvar' table.")
|
|
85
|
+
|
|
86
|
+
location = {
|
|
87
|
+
tag: float(value) for tag, value in (item.split("=") for item in options.coords)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
mapped = map(
|
|
91
|
+
font,
|
|
92
|
+
location,
|
|
93
|
+
inputNormalized=options.i,
|
|
94
|
+
outputNormalized=options.o,
|
|
95
|
+
dropZeroes=not options.f,
|
|
96
|
+
)
|
|
97
|
+
assert mapped is not None
|
|
98
|
+
|
|
99
|
+
for tag in mapped:
|
|
100
|
+
v = mapped[tag]
|
|
101
|
+
v = int(v) if v == int(v) else v
|
|
102
|
+
print(f"{tag}={v:g}")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if __name__ == "__main__":
|
|
106
|
+
import sys
|
|
107
|
+
|
|
108
|
+
sys.exit(main())
|