fonttools 4.55.2__cp311-cp311-musllinux_1_2_aarch64.whl → 4.55.6__cp311-cp311-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.
Potentially problematic release.
This version of fonttools might be problematic. Click here for more details.
- fontTools/__init__.py +1 -1
- fontTools/feaLib/ast.py +2 -2
- fontTools/feaLib/builder.py +29 -4
- fontTools/misc/bezierTools.c +3256 -2972
- fontTools/misc/bezierTools.cpython-311-aarch64-linux-musl.so +0 -0
- fontTools/misc/bezierTools.py +8 -1
- fontTools/misc/transform.py +13 -15
- fontTools/otlLib/builder.py +17 -0
- fontTools/pens/statisticsPen.py +5 -0
- fontTools/ttLib/tables/B_A_S_E_.py +9 -0
- fontTools/ttLib/tables/C_B_D_T_.py +10 -0
- fontTools/ttLib/tables/C_B_L_C_.py +10 -0
- fontTools/ttLib/tables/C_F_F_.py +15 -0
- fontTools/ttLib/tables/C_F_F__2.py +13 -0
- fontTools/ttLib/tables/C_O_L_R_.py +9 -1
- fontTools/ttLib/tables/C_P_A_L_.py +9 -0
- fontTools/ttLib/tables/D_S_I_G_.py +7 -0
- fontTools/ttLib/tables/E_B_D_T_.py +8 -0
- fontTools/ttLib/tables/E_B_L_C_.py +8 -0
- fontTools/ttLib/tables/F_F_T_M_.py +10 -0
- fontTools/ttLib/tables/F__e_a_t.py +7 -2
- fontTools/ttLib/tables/G_D_E_F_.py +8 -0
- fontTools/ttLib/tables/G_M_A_P_.py +7 -0
- fontTools/ttLib/tables/G_P_K_G_.py +7 -0
- fontTools/ttLib/tables/G_P_O_S_.py +9 -0
- fontTools/ttLib/tables/G_S_U_B_.py +8 -0
- fontTools/ttLib/tables/G__l_a_t.py +3 -2
- fontTools/ttLib/tables/G__l_o_c.py +3 -2
- fontTools/ttLib/tables/H_V_A_R_.py +8 -0
- fontTools/ttLib/tables/J_S_T_F_.py +8 -0
- fontTools/ttLib/tables/L_T_S_H_.py +10 -0
- fontTools/ttLib/tables/M_A_T_H_.py +8 -0
- fontTools/ttLib/tables/M_E_T_A_.py +7 -0
- fontTools/ttLib/tables/M_V_A_R_.py +8 -0
- fontTools/ttLib/tables/O_S_2f_2.py +8 -1
- fontTools/ttLib/tables/S_I_N_G_.py +7 -0
- fontTools/ttLib/tables/S_T_A_T_.py +10 -0
- fontTools/ttLib/tables/S_V_G_.py +8 -0
- fontTools/ttLib/tables/S__i_l_f.py +4 -1
- fontTools/ttLib/tables/S__i_l_l.py +5 -0
- fontTools/ttLib/tables/T_S_I_B_.py +8 -0
- fontTools/ttLib/tables/T_S_I_C_.py +9 -0
- fontTools/ttLib/tables/T_S_I_D_.py +8 -0
- fontTools/ttLib/tables/T_S_I_J_.py +8 -0
- fontTools/ttLib/tables/T_S_I_P_.py +8 -0
- fontTools/ttLib/tables/T_S_I_S_.py +8 -0
- fontTools/ttLib/tables/T_S_I_V_.py +6 -0
- fontTools/ttLib/tables/T_S_I__0.py +2 -0
- fontTools/ttLib/tables/T_S_I__1.py +2 -0
- fontTools/ttLib/tables/T_S_I__2.py +2 -0
- fontTools/ttLib/tables/T_S_I__3.py +2 -0
- fontTools/ttLib/tables/T_S_I__5.py +2 -0
- fontTools/ttLib/tables/T_T_F_A_.py +9 -0
- fontTools/ttLib/tables/V_A_R_C_.py +7 -0
- fontTools/ttLib/tables/V_D_M_X_.py +8 -0
- fontTools/ttLib/tables/V_O_R_G_.py +8 -1
- fontTools/ttLib/tables/V_V_A_R_.py +8 -0
- fontTools/ttLib/tables/_a_n_k_r.py +3 -2
- fontTools/ttLib/tables/_a_v_a_r.py +3 -1
- fontTools/ttLib/tables/_b_s_l_n.py +9 -0
- fontTools/ttLib/tables/_c_i_d_g.py +7 -2
- fontTools/ttLib/tables/_c_m_a_p.py +2 -0
- fontTools/ttLib/tables/_c_v_a_r.py +8 -0
- fontTools/ttLib/tables/_c_v_t.py +8 -0
- fontTools/ttLib/tables/_f_e_a_t.py +7 -4
- fontTools/ttLib/tables/_f_p_g_m.py +11 -0
- fontTools/ttLib/tables/_f_v_a_r.py +8 -0
- fontTools/ttLib/tables/_g_a_s_p.py +8 -0
- fontTools/ttLib/tables/_g_c_i_d.py +7 -0
- fontTools/ttLib/tables/_g_l_y_f.py +31 -7
- fontTools/ttLib/tables/_g_v_a_r.py +11 -3
- fontTools/ttLib/tables/_h_d_m_x.py +8 -0
- fontTools/ttLib/tables/_h_e_a_d.py +7 -0
- fontTools/ttLib/tables/_h_h_e_a.py +12 -0
- fontTools/ttLib/tables/_h_m_t_x.py +9 -0
- fontTools/ttLib/tables/_k_e_r_n.py +11 -0
- fontTools/ttLib/tables/_l_c_a_r.py +8 -0
- fontTools/ttLib/tables/_l_o_c_a.py +8 -0
- fontTools/ttLib/tables/_l_t_a_g.py +8 -0
- fontTools/ttLib/tables/_m_a_x_p.py +8 -0
- fontTools/ttLib/tables/_m_e_t_a.py +8 -0
- fontTools/ttLib/tables/_m_o_r_t.py +8 -0
- fontTools/ttLib/tables/_m_o_r_x.py +9 -0
- fontTools/ttLib/tables/_n_a_m_e.py +15 -13
- fontTools/ttLib/tables/_o_p_b_d.py +8 -0
- fontTools/ttLib/tables/_p_o_s_t.py +9 -0
- fontTools/ttLib/tables/_p_r_e_p.py +9 -0
- fontTools/ttLib/tables/_p_r_o_p.py +6 -0
- fontTools/ttLib/tables/_s_b_i_x.py +10 -0
- fontTools/ttLib/tables/_t_r_a_k.py +7 -0
- fontTools/ttLib/tables/_v_h_e_a.py +12 -0
- fontTools/ttLib/tables/_v_m_t_x.py +9 -0
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/METADATA +38 -3
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/RECORD +292 -292
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/WHEEL +1 -1
- {fonttools-4.55.2.data → fonttools-4.55.6.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/LICENSE +0 -0
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/entry_points.txt +0 -0
- {fonttools-4.55.2.dist-info → fonttools-4.55.6.dist-info}/top_level.txt +0 -0
|
Binary file
|
fontTools/misc/bezierTools.py
CHANGED
|
@@ -631,7 +631,14 @@ def splitCubicAtT(pt1, pt2, pt3, pt4, *ts):
|
|
|
631
631
|
((77.3438, 56.25), (85.9375, 43.75), (93.75, 25), (100, 0))
|
|
632
632
|
"""
|
|
633
633
|
a, b, c, d = calcCubicParameters(pt1, pt2, pt3, pt4)
|
|
634
|
-
|
|
634
|
+
split = _splitCubicAtT(a, b, c, d, *ts)
|
|
635
|
+
|
|
636
|
+
# the split impl can introduce floating point errors; we know the first
|
|
637
|
+
# segment should always start at pt1 and the last segment should end at pt4,
|
|
638
|
+
# so we set those values directly before returning.
|
|
639
|
+
split[0] = (pt1, *split[0][1:])
|
|
640
|
+
split[-1] = (*split[-1][:-1], pt4)
|
|
641
|
+
return split
|
|
635
642
|
|
|
636
643
|
|
|
637
644
|
@cython.locals(
|
fontTools/misc/transform.py
CHANGED
|
@@ -52,6 +52,8 @@ translate, rotation, scale, skew, and transformation-center components.
|
|
|
52
52
|
>>>
|
|
53
53
|
"""
|
|
54
54
|
|
|
55
|
+
from __future__ import annotations
|
|
56
|
+
|
|
55
57
|
import math
|
|
56
58
|
from typing import NamedTuple
|
|
57
59
|
from dataclasses import dataclass
|
|
@@ -65,7 +67,7 @@ _ONE_EPSILON = 1 - _EPSILON
|
|
|
65
67
|
_MINUS_ONE_EPSILON = -1 + _EPSILON
|
|
66
68
|
|
|
67
69
|
|
|
68
|
-
def _normSinCos(v):
|
|
70
|
+
def _normSinCos(v: float) -> float:
|
|
69
71
|
if abs(v) < _EPSILON:
|
|
70
72
|
v = 0
|
|
71
73
|
elif v > _ONE_EPSILON:
|
|
@@ -214,7 +216,7 @@ class Transform(NamedTuple):
|
|
|
214
216
|
xx, xy, yx, yy = self[:4]
|
|
215
217
|
return [(xx * dx + yx * dy, xy * dx + yy * dy) for dx, dy in vectors]
|
|
216
218
|
|
|
217
|
-
def translate(self, x=0, y=0):
|
|
219
|
+
def translate(self, x: float = 0, y: float = 0):
|
|
218
220
|
"""Return a new transformation, translated (offset) by x, y.
|
|
219
221
|
|
|
220
222
|
:Example:
|
|
@@ -225,7 +227,7 @@ class Transform(NamedTuple):
|
|
|
225
227
|
"""
|
|
226
228
|
return self.transform((1, 0, 0, 1, x, y))
|
|
227
229
|
|
|
228
|
-
def scale(self, x=1, y=None):
|
|
230
|
+
def scale(self, x: float = 1, y: float | None = None):
|
|
229
231
|
"""Return a new transformation, scaled by x, y. The 'y' argument
|
|
230
232
|
may be None, which implies to use the x value for y as well.
|
|
231
233
|
|
|
@@ -241,7 +243,7 @@ class Transform(NamedTuple):
|
|
|
241
243
|
y = x
|
|
242
244
|
return self.transform((x, 0, 0, y, 0, 0))
|
|
243
245
|
|
|
244
|
-
def rotate(self, angle):
|
|
246
|
+
def rotate(self, angle: float):
|
|
245
247
|
"""Return a new transformation, rotated by 'angle' (radians).
|
|
246
248
|
|
|
247
249
|
:Example:
|
|
@@ -251,13 +253,11 @@ class Transform(NamedTuple):
|
|
|
251
253
|
<Transform [0 1 -1 0 0 0]>
|
|
252
254
|
>>>
|
|
253
255
|
"""
|
|
254
|
-
import math
|
|
255
|
-
|
|
256
256
|
c = _normSinCos(math.cos(angle))
|
|
257
257
|
s = _normSinCos(math.sin(angle))
|
|
258
258
|
return self.transform((c, s, -s, c, 0, 0))
|
|
259
259
|
|
|
260
|
-
def skew(self, x=0, y=0):
|
|
260
|
+
def skew(self, x: float = 0, y: float = 0):
|
|
261
261
|
"""Return a new transformation, skewed by x and y.
|
|
262
262
|
|
|
263
263
|
:Example:
|
|
@@ -267,8 +267,6 @@ class Transform(NamedTuple):
|
|
|
267
267
|
<Transform [1 0 1 1 0 0]>
|
|
268
268
|
>>>
|
|
269
269
|
"""
|
|
270
|
-
import math
|
|
271
|
-
|
|
272
270
|
return self.transform((1, math.tan(y), math.tan(x), 1, 0, 0))
|
|
273
271
|
|
|
274
272
|
def transform(self, other):
|
|
@@ -336,7 +334,7 @@ class Transform(NamedTuple):
|
|
|
336
334
|
dx, dy = -xx * dx - yx * dy, -xy * dx - yy * dy
|
|
337
335
|
return self.__class__(xx, xy, yx, yy, dx, dy)
|
|
338
336
|
|
|
339
|
-
def toPS(self):
|
|
337
|
+
def toPS(self) -> str:
|
|
340
338
|
"""Return a PostScript representation
|
|
341
339
|
|
|
342
340
|
:Example:
|
|
@@ -352,7 +350,7 @@ class Transform(NamedTuple):
|
|
|
352
350
|
"""Decompose into a DecomposedTransform."""
|
|
353
351
|
return DecomposedTransform.fromTransform(self)
|
|
354
352
|
|
|
355
|
-
def __bool__(self):
|
|
353
|
+
def __bool__(self) -> bool:
|
|
356
354
|
"""Returns True if transform is not identity, False otherwise.
|
|
357
355
|
|
|
358
356
|
:Example:
|
|
@@ -374,14 +372,14 @@ class Transform(NamedTuple):
|
|
|
374
372
|
"""
|
|
375
373
|
return self != Identity
|
|
376
374
|
|
|
377
|
-
def __repr__(self):
|
|
375
|
+
def __repr__(self) -> str:
|
|
378
376
|
return "<%s [%g %g %g %g %g %g]>" % ((self.__class__.__name__,) + self)
|
|
379
377
|
|
|
380
378
|
|
|
381
379
|
Identity = Transform()
|
|
382
380
|
|
|
383
381
|
|
|
384
|
-
def Offset(x=0, y=0):
|
|
382
|
+
def Offset(x: float = 0, y: float = 0) -> Transform:
|
|
385
383
|
"""Return the identity transformation offset by x, y.
|
|
386
384
|
|
|
387
385
|
:Example:
|
|
@@ -392,7 +390,7 @@ def Offset(x=0, y=0):
|
|
|
392
390
|
return Transform(1, 0, 0, 1, x, y)
|
|
393
391
|
|
|
394
392
|
|
|
395
|
-
def Scale(x, y=None):
|
|
393
|
+
def Scale(x: float, y: float | None = None) -> Transform:
|
|
396
394
|
"""Return the identity transformation scaled by x, y. The 'y' argument
|
|
397
395
|
may be None, which implies to use the x value for y as well.
|
|
398
396
|
|
|
@@ -492,7 +490,7 @@ class DecomposedTransform:
|
|
|
492
490
|
0,
|
|
493
491
|
)
|
|
494
492
|
|
|
495
|
-
def toTransform(self):
|
|
493
|
+
def toTransform(self) -> Transform:
|
|
496
494
|
"""Return the Transform() equivalent of this transformation.
|
|
497
495
|
|
|
498
496
|
:Example:
|
fontTools/otlLib/builder.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections import namedtuple, OrderedDict
|
|
2
|
+
import itertools
|
|
2
3
|
import os
|
|
3
4
|
from fontTools.misc.fixedTools import fixedToFloat
|
|
4
5
|
from fontTools.misc.roundTools import otRound
|
|
@@ -798,6 +799,22 @@ class ChainContextSubstBuilder(ChainContextualBuilder):
|
|
|
798
799
|
res = sub
|
|
799
800
|
return res
|
|
800
801
|
|
|
802
|
+
def find_chainable_ligature_subst(self, glyphs, replacement):
|
|
803
|
+
"""Helper for add_ligature_subst_chained_()"""
|
|
804
|
+
res = None
|
|
805
|
+
for rule in self.rules[::-1]:
|
|
806
|
+
if rule.is_subtable_break:
|
|
807
|
+
return res
|
|
808
|
+
for sub in rule.lookups:
|
|
809
|
+
if not isinstance(sub, LigatureSubstBuilder):
|
|
810
|
+
continue
|
|
811
|
+
if all(
|
|
812
|
+
sub.ligatures.get(seq, replacement) == replacement
|
|
813
|
+
for seq in itertools.product(*glyphs)
|
|
814
|
+
):
|
|
815
|
+
res = sub
|
|
816
|
+
return res
|
|
817
|
+
|
|
801
818
|
|
|
802
819
|
class LigatureSubstBuilder(LookupBuilder):
|
|
803
820
|
"""Builds a Ligature Substitution (GSUB4) lookup.
|
fontTools/pens/statisticsPen.py
CHANGED
|
@@ -106,6 +106,7 @@ class StatisticsControlPen(StatisticsBase, BasePen):
|
|
|
106
106
|
|
|
107
107
|
def _moveTo(self, pt):
|
|
108
108
|
self._nodes.append(complex(*pt))
|
|
109
|
+
self._startPoint = pt
|
|
109
110
|
|
|
110
111
|
def _lineTo(self, pt):
|
|
111
112
|
self._nodes.append(complex(*pt))
|
|
@@ -119,12 +120,16 @@ class StatisticsControlPen(StatisticsBase, BasePen):
|
|
|
119
120
|
self._nodes.append(complex(*pt))
|
|
120
121
|
|
|
121
122
|
def _closePath(self):
|
|
123
|
+
p0 = self._getCurrentPoint()
|
|
124
|
+
if p0 != self._startPoint:
|
|
125
|
+
self._lineTo(self._startPoint)
|
|
122
126
|
self._update()
|
|
123
127
|
|
|
124
128
|
def _endPath(self):
|
|
125
129
|
p0 = self._getCurrentPoint()
|
|
126
130
|
if p0 != self._startPoint:
|
|
127
131
|
raise OpenContourError("Glyph statistics not defined on open contours.")
|
|
132
|
+
self._update()
|
|
128
133
|
|
|
129
134
|
def _update(self):
|
|
130
135
|
nodes = self._nodes
|
|
@@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_B_A_S_E_(BaseTTXConverter):
|
|
5
|
+
"""Baseline table
|
|
6
|
+
|
|
7
|
+
The ``BASE`` table contains information needed to align glyphs in
|
|
8
|
+
different scripts, from different fonts, or at different sizes
|
|
9
|
+
within the same line of text.
|
|
10
|
+
|
|
11
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/base
|
|
12
|
+
"""
|
|
13
|
+
|
|
5
14
|
pass
|
|
@@ -21,6 +21,16 @@ import struct
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_):
|
|
24
|
+
"""Color Bitmap Data table
|
|
25
|
+
|
|
26
|
+
The ``CBDT`` table contains color bitmap data for glyphs. It must
|
|
27
|
+
be used in concert with the ``CBLC`` table.
|
|
28
|
+
|
|
29
|
+
It is backwards-compatible with the monochrome/grayscale ``EBDT`` table.
|
|
30
|
+
|
|
31
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt
|
|
32
|
+
"""
|
|
33
|
+
|
|
24
34
|
# Change the data locator table being referenced.
|
|
25
35
|
locatorName = "CBLC"
|
|
26
36
|
|
|
@@ -6,4 +6,14 @@ from . import E_B_L_C_
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_):
|
|
9
|
+
"""Color Bitmap Location table
|
|
10
|
+
|
|
11
|
+
The ``CBLC`` table contains the locations of color bitmaps for glyphs. It must
|
|
12
|
+
be used in concert with the ``CBDT`` table.
|
|
13
|
+
|
|
14
|
+
It is backwards-compatible with the monochrome/grayscale ``EBLC`` table.
|
|
15
|
+
|
|
16
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cblc
|
|
17
|
+
"""
|
|
18
|
+
|
|
9
19
|
dependencies = ["CBDT"]
|
fontTools/ttLib/tables/C_F_F_.py
CHANGED
|
@@ -4,6 +4,21 @@ from . import DefaultTable
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class table_C_F_F_(DefaultTable.DefaultTable):
|
|
7
|
+
"""Compact Font Format table (version 1)
|
|
8
|
+
|
|
9
|
+
The ``CFF`` table embeds a CFF-formatted font. The CFF font format
|
|
10
|
+
predates OpenType and could be used as a standalone font file, but the
|
|
11
|
+
``CFF`` table is also used to package CFF fonts into an OpenType
|
|
12
|
+
container.
|
|
13
|
+
|
|
14
|
+
.. note::
|
|
15
|
+
``CFF`` has been succeeded by ``CFF2``, which eliminates much of
|
|
16
|
+
the redundancy incurred by embedding CFF version 1 in an OpenType
|
|
17
|
+
font.
|
|
18
|
+
|
|
19
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff
|
|
20
|
+
"""
|
|
21
|
+
|
|
7
22
|
def __init__(self, tag=None):
|
|
8
23
|
DefaultTable.DefaultTable.__init__(self, tag)
|
|
9
24
|
self.cff = cffLib.CFFFontSet()
|
|
@@ -3,6 +3,19 @@ from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class table_C_F_F__2(table_C_F_F_):
|
|
6
|
+
"""Compact Font Format version 2 table
|
|
7
|
+
|
|
8
|
+
The ``CFF2`` table contains glyph data for a CFF2-flavored OpenType
|
|
9
|
+
font.
|
|
10
|
+
|
|
11
|
+
.. note::
|
|
12
|
+
``CFF2`` is the successor to ``CFF``, and eliminates much of
|
|
13
|
+
the redundancy incurred by embedding CFF version 1 in an OpenType
|
|
14
|
+
font.
|
|
15
|
+
|
|
16
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff2
|
|
17
|
+
"""
|
|
18
|
+
|
|
6
19
|
def decompile(self, data, otFont):
|
|
7
20
|
self.cff.decompile(BytesIO(data), otFont, isCFF2=True)
|
|
8
21
|
assert len(self.cff) == 1, "can't deal with multi-font CFF tables."
|
|
@@ -7,11 +7,19 @@ from . import DefaultTable
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class table_C_O_L_R_(DefaultTable.DefaultTable):
|
|
10
|
-
"""
|
|
10
|
+
"""Color table
|
|
11
|
+
|
|
12
|
+
The ``COLR`` table defines color presentation of outline glyphs. It must
|
|
13
|
+
be used in concert with the ``CPAL`` table, which contains the color
|
|
14
|
+
descriptors used.
|
|
15
|
+
|
|
16
|
+
This table is structured so that you can treat it like a dictionary keyed by glyph name.
|
|
11
17
|
|
|
12
18
|
``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph.
|
|
13
19
|
|
|
14
20
|
``ttFont['COLR'][<glyphName>] = <value>`` will set the color layers for any glyph.
|
|
21
|
+
|
|
22
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/colr
|
|
15
23
|
"""
|
|
16
24
|
|
|
17
25
|
@staticmethod
|
|
@@ -11,6 +11,15 @@ import sys
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class table_C_P_A_L_(DefaultTable.DefaultTable):
|
|
14
|
+
"""Color Palette table
|
|
15
|
+
|
|
16
|
+
The ``CPAL`` table contains a set of one or more color palettes. The color
|
|
17
|
+
records in each palette can be referenced by the ``COLR`` table to specify
|
|
18
|
+
the colors used in a color glyph.
|
|
19
|
+
|
|
20
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cpal
|
|
21
|
+
"""
|
|
22
|
+
|
|
14
23
|
NO_NAME_ID = 0xFFFF
|
|
15
24
|
DEFAULT_PALETTE_TYPE = 0
|
|
16
25
|
|
|
@@ -39,6 +39,13 @@ DSIG_SignatureBlockFormat = """
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class table_D_S_I_G_(DefaultTable.DefaultTable):
|
|
42
|
+
"""Digital Signature table
|
|
43
|
+
|
|
44
|
+
The ``DSIG`` table contains cryptographic signatures for the font.
|
|
45
|
+
|
|
46
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/dsig
|
|
47
|
+
"""
|
|
48
|
+
|
|
42
49
|
def decompile(self, data, ttFont):
|
|
43
50
|
dummy, newData = sstruct.unpack2(DSIG_HeaderFormat, data, self)
|
|
44
51
|
assert self.ulVersion == 1, "DSIG ulVersion must be 1"
|
|
@@ -38,6 +38,14 @@ ebdtComponentFormat = """
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
class table_E_B_D_T_(DefaultTable.DefaultTable):
|
|
41
|
+
"""Embedded Bitmap Data table
|
|
42
|
+
|
|
43
|
+
The ``EBDT`` table contains monochrome or grayscale bitmap data for
|
|
44
|
+
glyphs. It must be used in concert with the ``EBLC`` table.
|
|
45
|
+
|
|
46
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/ebdt
|
|
47
|
+
"""
|
|
48
|
+
|
|
41
49
|
# Keep a reference to the name of the data locator table.
|
|
42
50
|
locatorName = "EBLC"
|
|
43
51
|
|
|
@@ -66,6 +66,14 @@ codeOffsetPairSize = struct.calcsize(codeOffsetPairFormat)
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
class table_E_B_L_C_(DefaultTable.DefaultTable):
|
|
69
|
+
"""Embedded Bitmap Location table
|
|
70
|
+
|
|
71
|
+
The ``EBLC`` table contains the locations of monochrome or grayscale
|
|
72
|
+
bitmaps for glyphs. It must be used in concert with the ``EBDT`` table.
|
|
73
|
+
|
|
74
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/eblc
|
|
75
|
+
"""
|
|
76
|
+
|
|
69
77
|
dependencies = ["EBDT"]
|
|
70
78
|
|
|
71
79
|
# This method can be overridden in subclasses to support new formats
|
|
@@ -13,6 +13,16 @@ FFTMFormat = """
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class table_F_F_T_M_(DefaultTable.DefaultTable):
|
|
16
|
+
"""FontForge Time Stamp table
|
|
17
|
+
|
|
18
|
+
The ``FFTM`` table is used by the free-software font editor
|
|
19
|
+
FontForge to record timestamps for the creation and modification
|
|
20
|
+
of font source (.sfd) files and a timestamp for FontForge's
|
|
21
|
+
own source code.
|
|
22
|
+
|
|
23
|
+
See also https://fontforge.org/docs/techref/non-standard.html
|
|
24
|
+
"""
|
|
25
|
+
|
|
16
26
|
def decompile(self, data, ttFont):
|
|
17
27
|
dummy, rest = sstruct.unpack2(FFTMFormat, data, self)
|
|
18
28
|
|
|
@@ -12,12 +12,17 @@ Feat_hdr_format = """
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class table_F__e_a_t(DefaultTable.DefaultTable):
|
|
15
|
-
"""
|
|
15
|
+
"""Feature table
|
|
16
|
+
|
|
17
|
+
The ``Feat`` table is used exclusively by the Graphite shaping engine
|
|
16
18
|
to store features and possible settings specified in GDL. Graphite features
|
|
17
19
|
determine what rules are applied to transform a glyph stream.
|
|
18
20
|
|
|
19
21
|
Not to be confused with ``feat``, or the OpenType Layout tables
|
|
20
|
-
``GSUB``/``GPOS``.
|
|
22
|
+
``GSUB``/``GPOS``.
|
|
23
|
+
|
|
24
|
+
See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
|
|
25
|
+
"""
|
|
21
26
|
|
|
22
27
|
def __init__(self, tag=None):
|
|
23
28
|
DefaultTable.DefaultTable.__init__(self, tag)
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_G_D_E_F_(BaseTTXConverter):
|
|
5
|
+
"""Glyph Definition table
|
|
6
|
+
|
|
7
|
+
The ``GDEF`` table stores various glyph properties that are used
|
|
8
|
+
by OpenType Layout.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/gdef
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -81,6 +81,13 @@ class GMAPRecord(object):
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
class table_G_M_A_P_(DefaultTable.DefaultTable):
|
|
84
|
+
"""Glyphlets GMAP table
|
|
85
|
+
|
|
86
|
+
The ``GMAP`` table is used by Adobe's SING Glyphlets.
|
|
87
|
+
|
|
88
|
+
See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
|
|
89
|
+
"""
|
|
90
|
+
|
|
84
91
|
dependencies = []
|
|
85
92
|
|
|
86
93
|
def decompile(self, data, ttFont):
|
|
@@ -16,6 +16,13 @@ GPKGFormat = """
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class table_G_P_K_G_(DefaultTable.DefaultTable):
|
|
19
|
+
"""Glyphlets GPKG table
|
|
20
|
+
|
|
21
|
+
The ``GPKG`` table is used by Adobe's SING Glyphlets.
|
|
22
|
+
|
|
23
|
+
See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
|
|
24
|
+
"""
|
|
25
|
+
|
|
19
26
|
def decompile(self, data, ttFont):
|
|
20
27
|
dummy, newData = sstruct.unpack2(GPKGFormat, data, self)
|
|
21
28
|
|
|
@@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_G_P_O_S_(BaseTTXConverter):
|
|
5
|
+
"""Glyph Positioning table
|
|
6
|
+
|
|
7
|
+
The ``GPOS`` table stores advanced glyph-positioning data
|
|
8
|
+
used in OpenType Layout features, such as mark attachment,
|
|
9
|
+
cursive attachment, kerning, and other position adjustments.
|
|
10
|
+
|
|
11
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/gpos
|
|
12
|
+
"""
|
|
13
|
+
|
|
5
14
|
pass
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_G_S_U_B_(BaseTTXConverter):
|
|
5
|
+
"""Glyph Substitution table
|
|
6
|
+
|
|
7
|
+
The ``GSUB`` table contains glyph-substitution rules used in
|
|
8
|
+
OpenType Layout.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/gsub
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -62,8 +62,9 @@ class _Dict(dict):
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
class table_G__l_a_t(DefaultTable.DefaultTable):
|
|
65
|
-
"""
|
|
66
|
-
|
|
65
|
+
"""Graphite Glyph Attributes table
|
|
66
|
+
|
|
67
|
+
See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
|
|
67
68
|
"""
|
|
68
69
|
|
|
69
70
|
def __init__(self, tag=None):
|
|
@@ -15,8 +15,9 @@ Gloc_header = """
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class table_G__l_o_c(DefaultTable.DefaultTable):
|
|
18
|
-
"""
|
|
19
|
-
|
|
18
|
+
"""Graphite Index to Glyph Atttributes table
|
|
19
|
+
|
|
20
|
+
See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
|
|
20
21
|
"""
|
|
21
22
|
|
|
22
23
|
dependencies = ["Glat"]
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_H_V_A_R_(BaseTTXConverter):
|
|
5
|
+
"""Horizontal Metrics Variations table
|
|
6
|
+
|
|
7
|
+
The ``HVAR`` table contains variations in horizontal glyph metrics
|
|
8
|
+
in variable fonts.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/hvar
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_J_S_T_F_(BaseTTXConverter):
|
|
5
|
+
"""Justification table
|
|
6
|
+
|
|
7
|
+
The ``JSTF`` table contains glyph substitution and positioning
|
|
8
|
+
data used to perform text justification.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/jstf
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -9,6 +9,16 @@ import array
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class table_L_T_S_H_(DefaultTable.DefaultTable):
|
|
12
|
+
"""Linear Threshold table
|
|
13
|
+
|
|
14
|
+
The ``LTSH`` table contains per-glyph settings indicating the ppem sizes
|
|
15
|
+
at which the advance width metric should be scaled linearly, despite the
|
|
16
|
+
effects of any TrueType instructions that might otherwise alter the
|
|
17
|
+
advance width.
|
|
18
|
+
|
|
19
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/ltsh
|
|
20
|
+
"""
|
|
21
|
+
|
|
12
22
|
def decompile(self, data, ttFont):
|
|
13
23
|
version, numGlyphs = struct.unpack(">HH", data[:4])
|
|
14
24
|
data = data[4:]
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_M_A_T_H_(BaseTTXConverter):
|
|
5
|
+
"""Mathematical Typesetting table
|
|
6
|
+
|
|
7
|
+
The ``MATH`` table contains a variety of information needed to
|
|
8
|
+
typeset glyphs in mathematical formulas and expressions.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/math
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -68,6 +68,13 @@ def getLabelString(labelID):
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
class table_M_E_T_A_(DefaultTable.DefaultTable):
|
|
71
|
+
"""Glyphlets META table
|
|
72
|
+
|
|
73
|
+
The ``META`` table is used by Adobe's SING Glyphlets.
|
|
74
|
+
|
|
75
|
+
See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
|
|
76
|
+
"""
|
|
77
|
+
|
|
71
78
|
dependencies = []
|
|
72
79
|
|
|
73
80
|
def decompile(self, data, ttFont):
|
|
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_M_V_A_R_(BaseTTXConverter):
|
|
5
|
+
"""Metrics Variations table
|
|
6
|
+
|
|
7
|
+
The ``MVAR`` table contains variation information for font-wide
|
|
8
|
+
metrics in a variable font.
|
|
9
|
+
|
|
10
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/mvar
|
|
11
|
+
"""
|
|
12
|
+
|
|
5
13
|
pass
|
|
@@ -113,7 +113,14 @@ OS2_format_5_addition = bigendian + OS2_format_5_addition
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
class table_O_S_2f_2(DefaultTable.DefaultTable):
|
|
116
|
-
"""
|
|
116
|
+
"""OS/2 and Windows Metrics table
|
|
117
|
+
|
|
118
|
+
The ``OS/2`` table contains a variety of font-wide metrics and
|
|
119
|
+
parameters that may be useful to an operating system or other
|
|
120
|
+
software for system-integration purposes.
|
|
121
|
+
|
|
122
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/os2
|
|
123
|
+
"""
|
|
117
124
|
|
|
118
125
|
dependencies = ["head"]
|
|
119
126
|
|
|
@@ -20,6 +20,13 @@ SINGFormat = """
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class table_S_I_N_G_(DefaultTable.DefaultTable):
|
|
23
|
+
"""Glyphlets SING table
|
|
24
|
+
|
|
25
|
+
The ``SING`` table is used by Adobe's SING Glyphlets.
|
|
26
|
+
|
|
27
|
+
See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
|
|
28
|
+
"""
|
|
29
|
+
|
|
23
30
|
dependencies = []
|
|
24
31
|
|
|
25
32
|
def decompile(self, data, ttFont):
|
|
@@ -2,4 +2,14 @@ from .otBase import BaseTTXConverter
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class table_S_T_A_T_(BaseTTXConverter):
|
|
5
|
+
"""Style Attributes table
|
|
6
|
+
|
|
7
|
+
The ``STAT`` table records stylistic or typeface-design attributes that
|
|
8
|
+
differentiate the individual fonts within a font family from one another.
|
|
9
|
+
Those attributes can be used to assist users when navigating the style
|
|
10
|
+
variations of a variable font or a family of static fonts.
|
|
11
|
+
|
|
12
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat
|
|
13
|
+
"""
|
|
14
|
+
|
|
5
15
|
pass
|
fontTools/ttLib/tables/S_V_G_.py
CHANGED
|
@@ -51,6 +51,14 @@ doc_index_entry_format_0Size = sstruct.calcsize(doc_index_entry_format_0)
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
class table_S_V_G_(DefaultTable.DefaultTable):
|
|
54
|
+
"""Scalable Vector Graphics table
|
|
55
|
+
|
|
56
|
+
The ``SVG`` table contains representations for glyphs in the SVG
|
|
57
|
+
image format.
|
|
58
|
+
|
|
59
|
+
See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat
|
|
60
|
+
"""
|
|
61
|
+
|
|
54
62
|
def decompile(self, data, ttFont):
|
|
55
63
|
self.docList = []
|
|
56
64
|
# Version 0 is the standardized version of the table; and current.
|