fonttools 4.57.0__cp313-cp313-musllinux_1_2_aarch64.whl → 4.58.0__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.

Potentially problematic release.


This version of fonttools might be problematic. Click here for more details.

Files changed (58) hide show
  1. fontTools/__init__.py +1 -1
  2. fontTools/cffLib/__init__.py +61 -26
  3. fontTools/cu2qu/cu2qu.c +4564 -4048
  4. fontTools/cu2qu/cu2qu.cpython-313-aarch64-linux-musl.so +0 -0
  5. fontTools/designspaceLib/statNames.py +14 -7
  6. fontTools/feaLib/ast.py +84 -10
  7. fontTools/feaLib/builder.py +20 -4
  8. fontTools/feaLib/lexer.c +6266 -7109
  9. fontTools/feaLib/lexer.cpython-313-aarch64-linux-musl.so +0 -0
  10. fontTools/feaLib/parser.py +1 -39
  11. fontTools/fontBuilder.py +6 -0
  12. fontTools/misc/bezierTools.c +13476 -15371
  13. fontTools/misc/bezierTools.cpython-313-aarch64-linux-musl.so +0 -0
  14. fontTools/misc/etree.py +4 -27
  15. fontTools/mtiLib/__init__.py +0 -2
  16. fontTools/otlLib/builder.py +195 -145
  17. fontTools/otlLib/optimize/gpos.py +42 -62
  18. fontTools/pens/momentsPen.c +4490 -4672
  19. fontTools/pens/momentsPen.cpython-313-aarch64-linux-musl.so +0 -0
  20. fontTools/pens/pointPen.py +21 -12
  21. fontTools/qu2cu/qu2cu.c +5725 -5456
  22. fontTools/qu2cu/qu2cu.cpython-313-aarch64-linux-musl.so +0 -0
  23. fontTools/subset/__init__.py +11 -0
  24. fontTools/ttLib/tables/G_V_A_R_.py +5 -0
  25. fontTools/ttLib/tables/T_S_I__0.py +14 -3
  26. fontTools/ttLib/tables/T_S_I__5.py +16 -5
  27. fontTools/ttLib/tables/__init__.py +1 -0
  28. fontTools/ttLib/tables/_c_v_t.py +2 -0
  29. fontTools/ttLib/tables/_f_p_g_m.py +3 -1
  30. fontTools/ttLib/tables/_g_l_y_f.py +2 -6
  31. fontTools/ttLib/tables/_g_v_a_r.py +58 -15
  32. fontTools/ttLib/tables/_p_o_s_t.py +5 -2
  33. fontTools/ttLib/tables/otBase.py +1 -0
  34. fontTools/ufoLib/__init__.py +2 -2
  35. fontTools/ufoLib/converters.py +89 -25
  36. fontTools/ufoLib/errors.py +8 -0
  37. fontTools/ufoLib/etree.py +1 -1
  38. fontTools/ufoLib/filenames.py +155 -100
  39. fontTools/ufoLib/glifLib.py +9 -2
  40. fontTools/ufoLib/kerning.py +66 -36
  41. fontTools/ufoLib/utils.py +5 -2
  42. fontTools/unicodedata/Mirrored.py +446 -0
  43. fontTools/unicodedata/__init__.py +6 -2
  44. fontTools/varLib/__init__.py +2 -0
  45. fontTools/varLib/iup.c +6838 -6362
  46. fontTools/varLib/iup.cpython-313-aarch64-linux-musl.so +0 -0
  47. fontTools/voltLib/__main__.py +206 -0
  48. fontTools/voltLib/ast.py +4 -0
  49. fontTools/voltLib/parser.py +16 -8
  50. fontTools/voltLib/voltToFea.py +347 -166
  51. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/METADATA +45 -11
  52. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/RECORD +58 -54
  53. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/WHEEL +1 -1
  54. fonttools-4.58.0.dist-info/licenses/LICENSE.external +359 -0
  55. {fonttools-4.57.0.data → fonttools-4.58.0.data}/data/share/man/man1/ttx.1 +0 -0
  56. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/entry_points.txt +0 -0
  57. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/licenses/LICENSE +0 -0
  58. {fonttools-4.57.0.dist-info → fonttools-4.58.0.dist-info}/top_level.txt +0 -0
@@ -12,12 +12,14 @@ This allows the caller to provide more data for each point.
12
12
  For instance, whether or not a point is smooth, and its name.
13
13
  """
14
14
 
15
+ from __future__ import annotations
16
+
15
17
  import math
16
- from typing import Any, Optional, Tuple, Dict
18
+ from typing import Any, Dict, List, Optional, Tuple
17
19
 
18
20
  from fontTools.misc.loggingTools import LogMixin
19
- from fontTools.pens.basePen import AbstractPen, MissingComponentError, PenError
20
21
  from fontTools.misc.transform import DecomposedTransform, Identity
22
+ from fontTools.pens.basePen import AbstractPen, MissingComponentError, PenError
21
23
 
22
24
  __all__ = [
23
25
  "AbstractPointPen",
@@ -28,6 +30,14 @@ __all__ = [
28
30
  "ReverseContourPointPen",
29
31
  ]
30
32
 
33
+ # Some type aliases to make it easier below
34
+ Point = Tuple[float, float]
35
+ PointName = Optional[str]
36
+ # [(pt, smooth, name, kwargs)]
37
+ SegmentPointList = List[Tuple[Optional[Point], bool, PointName, Any]]
38
+ SegmentType = Optional[str]
39
+ SegmentList = List[Tuple[SegmentType, SegmentPointList]]
40
+
31
41
 
32
42
  class AbstractPointPen:
33
43
  """Baseclass for all PointPens."""
@@ -88,7 +98,7 @@ class BasePointToSegmentPen(AbstractPointPen):
88
98
  care of all the edge cases.
89
99
  """
90
100
 
91
- def __init__(self):
101
+ def __init__(self) -> None:
92
102
  self.currentPath = None
93
103
 
94
104
  def beginPath(self, identifier=None, **kwargs):
@@ -96,7 +106,7 @@ class BasePointToSegmentPen(AbstractPointPen):
96
106
  raise PenError("Path already begun.")
97
107
  self.currentPath = []
98
108
 
99
- def _flushContour(self, segments):
109
+ def _flushContour(self, segments: SegmentList) -> None:
100
110
  """Override this method.
101
111
 
102
112
  It will be called for each non-empty sub path with a list
@@ -124,7 +134,7 @@ class BasePointToSegmentPen(AbstractPointPen):
124
134
  """
125
135
  raise NotImplementedError
126
136
 
127
- def endPath(self):
137
+ def endPath(self) -> None:
128
138
  if self.currentPath is None:
129
139
  raise PenError("Path not begun.")
130
140
  points = self.currentPath
@@ -134,7 +144,7 @@ class BasePointToSegmentPen(AbstractPointPen):
134
144
  if len(points) == 1:
135
145
  # Not much more we can do than output a single move segment.
136
146
  pt, segmentType, smooth, name, kwargs = points[0]
137
- segments = [("move", [(pt, smooth, name, kwargs)])]
147
+ segments: SegmentList = [("move", [(pt, smooth, name, kwargs)])]
138
148
  self._flushContour(segments)
139
149
  return
140
150
  segments = []
@@ -162,7 +172,7 @@ class BasePointToSegmentPen(AbstractPointPen):
162
172
  else:
163
173
  points = points[firstOnCurve + 1 :] + points[: firstOnCurve + 1]
164
174
 
165
- currentSegment = []
175
+ currentSegment: SegmentPointList = []
166
176
  for pt, segmentType, smooth, name, kwargs in points:
167
177
  currentSegment.append((pt, smooth, name, kwargs))
168
178
  if segmentType is None:
@@ -189,7 +199,7 @@ class PointToSegmentPen(BasePointToSegmentPen):
189
199
  and kwargs.
190
200
  """
191
201
 
192
- def __init__(self, segmentPen, outputImpliedClosingLine=False):
202
+ def __init__(self, segmentPen, outputImpliedClosingLine: bool = False) -> None:
193
203
  BasePointToSegmentPen.__init__(self)
194
204
  self.pen = segmentPen
195
205
  self.outputImpliedClosingLine = outputImpliedClosingLine
@@ -271,14 +281,14 @@ class SegmentToPointPen(AbstractPen):
271
281
  PointPen protocol.
272
282
  """
273
283
 
274
- def __init__(self, pointPen, guessSmooth=True):
284
+ def __init__(self, pointPen, guessSmooth=True) -> None:
275
285
  if guessSmooth:
276
286
  self.pen = GuessSmoothPointPen(pointPen)
277
287
  else:
278
288
  self.pen = pointPen
279
- self.contour = None
289
+ self.contour: Optional[List[Tuple[Point, SegmentType]]] = None
280
290
 
281
- def _flushContour(self):
291
+ def _flushContour(self) -> None:
282
292
  pen = self.pen
283
293
  pen.beginPath()
284
294
  for pt, segmentType in self.contour:
@@ -594,7 +604,6 @@ class DecomposingPointPen(LogMixin, AbstractPointPen):
594
604
  # if the transformation has a negative determinant, it will
595
605
  # reverse the contour direction of the component
596
606
  a, b, c, d = transformation[:4]
597
- det = a * d - b * c
598
607
  if a * d - b * c < 0:
599
608
  pen = ReverseContourPointPen(pen)
600
609
  glyph.drawPoints(pen)