fonttools 4.58.0__cp310-cp310-musllinux_1_2_aarch64.whl → 4.58.2__cp310-cp310-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 (38) hide show
  1. fontTools/__init__.py +1 -1
  2. fontTools/cffLib/specializer.py +4 -1
  3. fontTools/cu2qu/cu2qu.c +36 -24
  4. fontTools/cu2qu/cu2qu.cpython-310-aarch64-linux-gnu.so +0 -0
  5. fontTools/feaLib/ast.py +1 -72
  6. fontTools/feaLib/builder.py +55 -45
  7. fontTools/feaLib/lexer.c +60 -43
  8. fontTools/feaLib/lexer.cpython-310-aarch64-linux-gnu.so +0 -0
  9. fontTools/merge/cmap.py +33 -1
  10. fontTools/merge/tables.py +12 -1
  11. fontTools/misc/bezierTools.c +137 -125
  12. fontTools/misc/bezierTools.cpython-310-aarch64-linux-gnu.so +0 -0
  13. fontTools/misc/loggingTools.py +1 -1
  14. fontTools/misc/symfont.py +6 -8
  15. fontTools/mtiLib/__init__.py +1 -1
  16. fontTools/otlLib/builder.py +164 -0
  17. fontTools/pens/momentsPen.c +42 -25
  18. fontTools/pens/momentsPen.cpython-310-aarch64-linux-gnu.so +0 -0
  19. fontTools/pens/t2CharStringPen.py +31 -11
  20. fontTools/qu2cu/qu2cu.c +47 -35
  21. fontTools/qu2cu/qu2cu.cpython-310-aarch64-linux-gnu.so +0 -0
  22. fontTools/subset/__init__.py +82 -2
  23. fontTools/ttLib/reorderGlyphs.py +8 -7
  24. fontTools/ufoLib/__init__.py +1 -1
  25. fontTools/varLib/__init__.py +18 -6
  26. fontTools/varLib/featureVars.py +13 -7
  27. fontTools/varLib/hvar.py +1 -1
  28. fontTools/varLib/instancer/__init__.py +14 -5
  29. fontTools/varLib/iup.c +52 -40
  30. fontTools/varLib/iup.cpython-310-aarch64-linux-gnu.so +0 -0
  31. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/METADATA +26 -1
  32. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/RECORD +38 -38
  33. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/WHEEL +1 -1
  34. {fonttools-4.58.0.data → fonttools-4.58.2.data}/data/share/man/man1/ttx.1 +0 -0
  35. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/entry_points.txt +0 -0
  36. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/licenses/LICENSE +0 -0
  37. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/licenses/LICENSE.external +0 -0
  38. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/top_level.txt +0 -0
@@ -1375,7 +1375,7 @@ def main(args=None, font=None):
1375
1375
 
1376
1376
  for f in args.inputs:
1377
1377
  log.debug("Processing %s", f)
1378
- with open(f, "rt", encoding="utf-8") as f:
1378
+ with open(f, "rt", encoding="utf-8-sig") as f:
1379
1379
  table = build(f, font, tableTag=args.tableTag)
1380
1380
  blob = table.compile(font) # Make sure it compiles
1381
1381
  decompiled = table.__class__()
@@ -170,6 +170,9 @@ class LookupBuilder(object):
170
170
  and self.extension == other.extension
171
171
  )
172
172
 
173
+ def promote_lookup_type(self, is_named_lookup):
174
+ return [self]
175
+
173
176
  def inferGlyphClasses(self):
174
177
  """Infers glyph glasses for the GDEF table, such as {"cedilla":3}."""
175
178
  return {}
@@ -883,6 +886,14 @@ class LigatureSubstBuilder(LookupBuilder):
883
886
  )
884
887
  return self.buildLookup_(subtables)
885
888
 
889
+ def getAlternateGlyphs(self):
890
+ # https://github.com/fonttools/fonttools/issues/3845
891
+ return {
892
+ components[0]: [ligature]
893
+ for components, ligature in self.ligatures.items()
894
+ if len(components) == 1
895
+ }
896
+
886
897
  def add_subtable_break(self, location):
887
898
  self.ligatures[(self.SUBTABLE_BREAK_, location)] = self.SUBTABLE_BREAK_
888
899
 
@@ -921,6 +932,14 @@ class MultipleSubstBuilder(LookupBuilder):
921
932
  subtables = self.build_subst_subtables(self.mapping, buildMultipleSubstSubtable)
922
933
  return self.buildLookup_(subtables)
923
934
 
935
+ def getAlternateGlyphs(self):
936
+ # https://github.com/fonttools/fonttools/issues/3845
937
+ return {
938
+ glyph: replacements
939
+ for glyph, replacements in self.mapping.items()
940
+ if len(replacements) == 1
941
+ }
942
+
924
943
  def add_subtable_break(self, location):
925
944
  self.mapping[(self.SUBTABLE_BREAK_, location)] = self.SUBTABLE_BREAK_
926
945
 
@@ -1308,6 +1327,151 @@ class ReverseChainSingleSubstBuilder(LookupBuilder):
1308
1327
  pass
1309
1328
 
1310
1329
 
1330
+ class AnySubstBuilder(LookupBuilder):
1331
+ """A temporary builder for Single, Multiple, or Ligature substitution lookup.
1332
+
1333
+ Users are expected to manually add substitutions to the ``mapping``
1334
+ attribute after the object has been initialized, e.g.::
1335
+
1336
+ # sub x by y;
1337
+ builder.mapping[("x",)] = ("y",)
1338
+ # sub a by b c;
1339
+ builder.mapping[("a",)] = ("b", "c")
1340
+ # sub f i by f_i;
1341
+ builder.mapping[("f", "i")] = ("f_i",)
1342
+
1343
+ Then call `promote_lookup_type()` to convert this builder into the
1344
+ appropriate type of substitution lookup builder. This would promote single
1345
+ substitutions to either multiple or ligature substitutions, depending on the
1346
+ rest of the rules in the mapping.
1347
+
1348
+ Attributes:
1349
+ font (``fontTools.TTLib.TTFont``): A font object.
1350
+ location: A string or tuple representing the location in the original
1351
+ source which produced this lookup.
1352
+ mapping: An ordered dictionary mapping a tuple of glyph names to another
1353
+ tuple of glyph names.
1354
+ lookupflag (int): The lookup's flag
1355
+ markFilterSet: Either ``None`` if no mark filtering set is used, or
1356
+ an integer representing the filtering set to be used for this
1357
+ lookup. If a mark filtering set is provided,
1358
+ `LOOKUP_FLAG_USE_MARK_FILTERING_SET` will be set on the lookup's
1359
+ flags.
1360
+ """
1361
+
1362
+ def __init__(self, font, location):
1363
+ LookupBuilder.__init__(self, font, location, "GSUB", 0)
1364
+ self.mapping = OrderedDict()
1365
+
1366
+ def _add_to_single_subst(self, builder, key, value):
1367
+ if key[0] != self.SUBTABLE_BREAK_:
1368
+ key = key[0]
1369
+ builder.mapping[key] = value[0]
1370
+
1371
+ def _add_to_multiple_subst(self, builder, key, value):
1372
+ if key[0] != self.SUBTABLE_BREAK_:
1373
+ key = key[0]
1374
+ builder.mapping[key] = value
1375
+
1376
+ def _add_to_ligature_subst(self, builder, key, value):
1377
+ builder.ligatures[key] = value[0]
1378
+
1379
+ def promote_lookup_type(self, is_named_lookup):
1380
+ # https://github.com/fonttools/fonttools/issues/612
1381
+ # A multiple substitution may have a single destination, in which case
1382
+ # it will look just like a single substitution. So if there are both
1383
+ # multiple and single substitutions, upgrade all the single ones to
1384
+ # multiple substitutions. Similarly, a ligature substitution may have a
1385
+ # single source glyph, so if there are both ligature and single
1386
+ # substitutions, upgrade all the single ones to ligature substitutions.
1387
+ builder_classes = []
1388
+ for key, value in self.mapping.items():
1389
+ if key[0] == self.SUBTABLE_BREAK_:
1390
+ builder_classes.append(None)
1391
+ elif len(key) == 1 and len(value) == 1:
1392
+ builder_classes.append(SingleSubstBuilder)
1393
+ elif len(key) == 1 and len(value) != 1:
1394
+ builder_classes.append(MultipleSubstBuilder)
1395
+ elif len(key) > 1 and len(value) == 1:
1396
+ builder_classes.append(LigatureSubstBuilder)
1397
+ else:
1398
+ assert False, "Should not happen"
1399
+
1400
+ has_multiple = any(b is MultipleSubstBuilder for b in builder_classes)
1401
+ has_ligature = any(b is LigatureSubstBuilder for b in builder_classes)
1402
+
1403
+ # If we have mixed single and multiple substitutions,
1404
+ # upgrade all single substitutions to multiple substitutions.
1405
+ to_multiple = has_multiple and not has_ligature
1406
+
1407
+ # If we have mixed single and ligature substitutions,
1408
+ # upgrade all single substitutions to ligature substitutions.
1409
+ to_ligature = has_ligature and not has_multiple
1410
+
1411
+ # If we have only single substitutions, we can keep them as is.
1412
+ to_single = not has_ligature and not has_multiple
1413
+
1414
+ ret = []
1415
+ if to_single:
1416
+ builder = SingleSubstBuilder(self.font, self.location)
1417
+ for key, value in self.mapping.items():
1418
+ self._add_to_single_subst(builder, key, value)
1419
+ ret = [builder]
1420
+ elif to_multiple:
1421
+ builder = MultipleSubstBuilder(self.font, self.location)
1422
+ for key, value in self.mapping.items():
1423
+ self._add_to_multiple_subst(builder, key, value)
1424
+ ret = [builder]
1425
+ elif to_ligature:
1426
+ builder = LigatureSubstBuilder(self.font, self.location)
1427
+ for key, value in self.mapping.items():
1428
+ self._add_to_ligature_subst(builder, key, value)
1429
+ ret = [builder]
1430
+ elif is_named_lookup:
1431
+ # This is a named lookup with mixed substitutions that can’t be promoted,
1432
+ # since we can’t split it into multiple lookups, we return None here to
1433
+ # signal that to the caller
1434
+ return None
1435
+ else:
1436
+ curr_builder = None
1437
+ for builder_class, (key, value) in zip(
1438
+ builder_classes, self.mapping.items()
1439
+ ):
1440
+ if curr_builder is None or type(curr_builder) is not builder_class:
1441
+ curr_builder = builder_class(self.font, self.location)
1442
+ ret.append(curr_builder)
1443
+ if builder_class is SingleSubstBuilder:
1444
+ self._add_to_single_subst(curr_builder, key, value)
1445
+ elif builder_class is MultipleSubstBuilder:
1446
+ self._add_to_multiple_subst(curr_builder, key, value)
1447
+ elif builder_class is LigatureSubstBuilder:
1448
+ self._add_to_ligature_subst(curr_builder, key, value)
1449
+ else:
1450
+ assert False, "Should not happen"
1451
+
1452
+ for builder in ret:
1453
+ builder.extension = self.extension
1454
+ builder.lookupflag = self.lookupflag
1455
+ builder.markFilterSet = self.markFilterSet
1456
+ return ret
1457
+
1458
+ def equals(self, other):
1459
+ return LookupBuilder.equals(self, other) and self.mapping == other.mapping
1460
+
1461
+ def build(self):
1462
+ assert False
1463
+
1464
+ def getAlternateGlyphs(self):
1465
+ return {
1466
+ key[0]: value
1467
+ for key, value in self.mapping.items()
1468
+ if len(key) == 1 and len(value) == 1
1469
+ }
1470
+
1471
+ def add_subtable_break(self, location):
1472
+ self.mapping[(self.SUBTABLE_BREAK_, location)] = self.SUBTABLE_BREAK_
1473
+
1474
+
1311
1475
  class SingleSubstBuilder(LookupBuilder):
1312
1476
  """Builds a Single Substitution (GSUB1) lookup.
1313
1477
 
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.0 */
1
+ /* Generated by Cython 3.1.1 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -26,8 +26,8 @@ END: Cython Metadata */
26
26
  #elif PY_VERSION_HEX < 0x03080000
27
27
  #error Cython requires Python 3.8+.
28
28
  #else
29
- #define __PYX_ABI_VERSION "3_1_0"
30
- #define CYTHON_HEX_VERSION 0x030100F0
29
+ #define __PYX_ABI_VERSION "3_1_1"
30
+ #define CYTHON_HEX_VERSION 0x030101F0
31
31
  #define CYTHON_FUTURE_DIVISION 1
32
32
  /* CModulePreamble */
33
33
  #include <stddef.h>
@@ -1844,12 +1844,19 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve
1844
1844
  static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1845
1845
  #endif
1846
1846
 
1847
+ /* PyObjectDelAttr.proto */
1848
+ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
1849
+ #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
1850
+ #else
1851
+ #define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
1852
+ #endif
1853
+
1847
1854
  /* PyObjectSetAttrStr.proto */
1848
1855
  #if CYTHON_USE_TYPE_SLOTS
1849
1856
  #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1850
1857
  static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1851
1858
  #else
1852
- #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1859
+ #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
1853
1860
  #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1854
1861
  #endif
1855
1862
 
@@ -8267,8 +8274,8 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
8267
8274
  } __Pyx_PyCode_New_function_description;
8268
8275
  /* NewCodeObj.proto */
8269
8276
  static PyObject* __Pyx_PyCode_New(
8270
- __Pyx_PyCode_New_function_description descr,
8271
- PyObject **varnames,
8277
+ const __Pyx_PyCode_New_function_description descr,
8278
+ PyObject * const *varnames,
8272
8279
  PyObject *filename,
8273
8280
  PyObject *funcname,
8274
8281
  const char *line_table,
@@ -8280,38 +8287,38 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
8280
8287
  PyObject* tuple_dedup_map = PyDict_New();
8281
8288
  if (unlikely(!tuple_dedup_map)) return -1;
8282
8289
  {
8283
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 58};
8284
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_glyphset};
8290
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 58};
8291
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_glyphset};
8285
8292
  __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_y_q_HA_Kq_Kq_L_L_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
8286
8293
  }
8287
8294
  {
8288
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 26, 9};
8289
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8295
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 26, 9};
8296
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8290
8297
  __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_moveTo, __pyx_k_A_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
8291
8298
  }
8292
8299
  {
8293
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 34};
8294
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8300
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 34};
8301
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8295
8302
  __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_closePath, __pyx_k_A_T_3c_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
8296
8303
  }
8297
8304
  {
8298
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 34, 33};
8299
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8305
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 34, 33};
8306
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
8300
8307
  __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_endPath, __pyx_k_A_T_3c_Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
8301
8308
  }
8302
8309
  {
8303
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 568};
8304
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8310
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 568};
8311
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8305
8312
  __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_lineTo, __pyx_k_A_E_a_E_S_S_Rr_S_S_S_Rr_Rr_Rr_Rr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
8306
8313
  }
8307
8314
  {
8308
- __Pyx_PyCode_New_function_description descr = {3, 0, 0, 63, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99, 1710};
8309
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8315
+ const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 63, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99, 1710};
8316
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8310
8317
  __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_qCurveToOne, __pyx_k_At_E_a_E_E_Rr_S_S_Rr_Rr_Rr_Rr_Rr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
8311
8318
  }
8312
8319
  {
8313
- __Pyx_PyCode_New_function_description descr = {4, 0, 0, 145, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310, 4139};
8314
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_p3, __pyx_mstate->__pyx_n_u_x3, __pyx_mstate->__pyx_n_u_y3, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r132, __pyx_mstate->__pyx_n_u_r131, __pyx_mstate->__pyx_n_u_r130, __pyx_mstate->__pyx_n_u_r129, __pyx_mstate->__pyx_n_u_r128, __pyx_mstate->__pyx_n_u_r127, __pyx_mstate->__pyx_n_u_r126, __pyx_mstate->__pyx_n_u_r125, __pyx_mstate->__pyx_n_u_r124, __pyx_mstate->__pyx_n_u_r123, __pyx_mstate->__pyx_n_u_r122, __pyx_mstate->__pyx_n_u_r121, __pyx_mstate->__pyx_n_u_r120, __pyx_mstate->__pyx_n_u_r119, __pyx_mstate->__pyx_n_u_r118, __pyx_mstate->__pyx_n_u_r117, __pyx_mstate->__pyx_n_u_r116, __pyx_mstate->__pyx_n_u_r115, __pyx_mstate->__pyx_n_u_r114, __pyx_mstate->__pyx_n_u_r113, __pyx_mstate->__pyx_n_u_r112, __pyx_mstate->__pyx_n_u_r111, __pyx_mstate->__pyx_n_u_r110, __pyx_mstate->__pyx_n_u_r109, __pyx_mstate->__pyx_n_u_r108, __pyx_mstate->__pyx_n_u_r107, __pyx_mstate->__pyx_n_u_r106, __pyx_mstate->__pyx_n_u_r105, __pyx_mstate->__pyx_n_u_r104, __pyx_mstate->__pyx_n_u_r103, __pyx_mstate->__pyx_n_u_r102, __pyx_mstate->__pyx_n_u_r101, __pyx_mstate->__pyx_n_u_r100, __pyx_mstate->__pyx_n_u_r99, __pyx_mstate->__pyx_n_u_r98, __pyx_mstate->__pyx_n_u_r97, __pyx_mstate->__pyx_n_u_r96, __pyx_mstate->__pyx_n_u_r95, __pyx_mstate->__pyx_n_u_r94, __pyx_mstate->__pyx_n_u_r93, __pyx_mstate->__pyx_n_u_r92, __pyx_mstate->__pyx_n_u_r91, __pyx_mstate->__pyx_n_u_r90, __pyx_mstate->__pyx_n_u_r89, __pyx_mstate->__pyx_n_u_r88, __pyx_mstate->__pyx_n_u_r87, __pyx_mstate->__pyx_n_u_r86, __pyx_mstate->__pyx_n_u_r85, __pyx_mstate->__pyx_n_u_r84, __pyx_mstate->__pyx_n_u_r83, __pyx_mstate->__pyx_n_u_r82, __pyx_mstate->__pyx_n_u_r81, __pyx_mstate->__pyx_n_u_r80, __pyx_mstate->__pyx_n_u_r79, __pyx_mstate->__pyx_n_u_r78, __pyx_mstate->__pyx_n_u_r77, __pyx_mstate->__pyx_n_u_r76, __pyx_mstate->__pyx_n_u_r75, __pyx_mstate->__pyx_n_u_r74, __pyx_mstate->__pyx_n_u_r73, __pyx_mstate->__pyx_n_u_r72, __pyx_mstate->__pyx_n_u_r71, __pyx_mstate->__pyx_n_u_r70, __pyx_mstate->__pyx_n_u_r69, __pyx_mstate->__pyx_n_u_r68, __pyx_mstate->__pyx_n_u_r67, __pyx_mstate->__pyx_n_u_r66, __pyx_mstate->__pyx_n_u_r65, __pyx_mstate->__pyx_n_u_r64, __pyx_mstate->__pyx_n_u_r63, __pyx_mstate->__pyx_n_u_r62, __pyx_mstate->__pyx_n_u_r61, __pyx_mstate->__pyx_n_u_r60, __pyx_mstate->__pyx_n_u_r59, __pyx_mstate->__pyx_n_u_r58, __pyx_mstate->__pyx_n_u_r57, __pyx_mstate->__pyx_n_u_r56, __pyx_mstate->__pyx_n_u_r55, __pyx_mstate->__pyx_n_u_r54, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8320
+ const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 145, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310, 4139};
8321
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_p3, __pyx_mstate->__pyx_n_u_x3, __pyx_mstate->__pyx_n_u_y3, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r132, __pyx_mstate->__pyx_n_u_r131, __pyx_mstate->__pyx_n_u_r130, __pyx_mstate->__pyx_n_u_r129, __pyx_mstate->__pyx_n_u_r128, __pyx_mstate->__pyx_n_u_r127, __pyx_mstate->__pyx_n_u_r126, __pyx_mstate->__pyx_n_u_r125, __pyx_mstate->__pyx_n_u_r124, __pyx_mstate->__pyx_n_u_r123, __pyx_mstate->__pyx_n_u_r122, __pyx_mstate->__pyx_n_u_r121, __pyx_mstate->__pyx_n_u_r120, __pyx_mstate->__pyx_n_u_r119, __pyx_mstate->__pyx_n_u_r118, __pyx_mstate->__pyx_n_u_r117, __pyx_mstate->__pyx_n_u_r116, __pyx_mstate->__pyx_n_u_r115, __pyx_mstate->__pyx_n_u_r114, __pyx_mstate->__pyx_n_u_r113, __pyx_mstate->__pyx_n_u_r112, __pyx_mstate->__pyx_n_u_r111, __pyx_mstate->__pyx_n_u_r110, __pyx_mstate->__pyx_n_u_r109, __pyx_mstate->__pyx_n_u_r108, __pyx_mstate->__pyx_n_u_r107, __pyx_mstate->__pyx_n_u_r106, __pyx_mstate->__pyx_n_u_r105, __pyx_mstate->__pyx_n_u_r104, __pyx_mstate->__pyx_n_u_r103, __pyx_mstate->__pyx_n_u_r102, __pyx_mstate->__pyx_n_u_r101, __pyx_mstate->__pyx_n_u_r100, __pyx_mstate->__pyx_n_u_r99, __pyx_mstate->__pyx_n_u_r98, __pyx_mstate->__pyx_n_u_r97, __pyx_mstate->__pyx_n_u_r96, __pyx_mstate->__pyx_n_u_r95, __pyx_mstate->__pyx_n_u_r94, __pyx_mstate->__pyx_n_u_r93, __pyx_mstate->__pyx_n_u_r92, __pyx_mstate->__pyx_n_u_r91, __pyx_mstate->__pyx_n_u_r90, __pyx_mstate->__pyx_n_u_r89, __pyx_mstate->__pyx_n_u_r88, __pyx_mstate->__pyx_n_u_r87, __pyx_mstate->__pyx_n_u_r86, __pyx_mstate->__pyx_n_u_r85, __pyx_mstate->__pyx_n_u_r84, __pyx_mstate->__pyx_n_u_r83, __pyx_mstate->__pyx_n_u_r82, __pyx_mstate->__pyx_n_u_r81, __pyx_mstate->__pyx_n_u_r80, __pyx_mstate->__pyx_n_u_r79, __pyx_mstate->__pyx_n_u_r78, __pyx_mstate->__pyx_n_u_r77, __pyx_mstate->__pyx_n_u_r76, __pyx_mstate->__pyx_n_u_r75, __pyx_mstate->__pyx_n_u_r74, __pyx_mstate->__pyx_n_u_r73, __pyx_mstate->__pyx_n_u_r72, __pyx_mstate->__pyx_n_u_r71, __pyx_mstate->__pyx_n_u_r70, __pyx_mstate->__pyx_n_u_r69, __pyx_mstate->__pyx_n_u_r68, __pyx_mstate->__pyx_n_u_r67, __pyx_mstate->__pyx_n_u_r66, __pyx_mstate->__pyx_n_u_r65, __pyx_mstate->__pyx_n_u_r64, __pyx_mstate->__pyx_n_u_r63, __pyx_mstate->__pyx_n_u_r62, __pyx_mstate->__pyx_n_u_r61, __pyx_mstate->__pyx_n_u_r60, __pyx_mstate->__pyx_n_u_r59, __pyx_mstate->__pyx_n_u_r58, __pyx_mstate->__pyx_n_u_r57, __pyx_mstate->__pyx_n_u_r56, __pyx_mstate->__pyx_n_u_r55, __pyx_mstate->__pyx_n_u_r54, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
8315
8322
  __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_curveToOne, __pyx_k_AT_E_a_E_E_E_Rr_S_S_S_Rr_Rr_Rr_R, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
8316
8323
  }
8317
8324
  Py_DECREF(tuple_dedup_map);
@@ -9031,6 +9038,11 @@ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *
9031
9038
  Py_DECREF(selfless_args);
9032
9039
  return result;
9033
9040
  }
9041
+ #elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
9042
+ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
9043
+ return _PyObject_Vectorcall
9044
+ (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
9045
+ }
9034
9046
  #else
9035
9047
  static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
9036
9048
  return
@@ -9354,7 +9366,9 @@ static int __Pyx_ParseKeywordDict(
9354
9366
  PyObject** const *name;
9355
9367
  PyObject** const *first_kw_arg = argnames + num_pos_args;
9356
9368
  Py_ssize_t extracted = 0;
9369
+ #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9357
9370
  if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
9371
+ #endif
9358
9372
  name = first_kw_arg;
9359
9373
  while (*name && num_kwargs > extracted) {
9360
9374
  PyObject * key = **name;
@@ -9402,7 +9416,9 @@ static int __Pyx_ParseKeywordDictToDict(
9402
9416
  PyObject** const *name;
9403
9417
  PyObject** const *first_kw_arg = argnames + num_pos_args;
9404
9418
  Py_ssize_t len;
9419
+ #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9405
9420
  if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
9421
+ #endif
9406
9422
  if (PyDict_Update(kwds2, kwds) < 0) goto bad;
9407
9423
  name = first_kw_arg;
9408
9424
  while (*name) {
@@ -9811,7 +9827,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
9811
9827
  if (unlikely(!empty_dict))
9812
9828
  goto bad;
9813
9829
  if (level == -1) {
9814
- if (strchr(__Pyx_MODULE_NAME, '.') != (0)) {
9830
+ const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
9831
+ if (package_sep != (0)) {
9815
9832
  module = PyImport_ImportModuleLevelObject(
9816
9833
  name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
9817
9834
  if (unlikely(!module)) {
@@ -11826,7 +11843,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
11826
11843
  return PyLong_FromLong((long) value);
11827
11844
  } else if (sizeof(long) <= sizeof(unsigned long)) {
11828
11845
  return PyLong_FromUnsignedLong((unsigned long) value);
11829
- #ifdef HAVE_LONG_LONG
11846
+ #if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
11830
11847
  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11831
11848
  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11832
11849
  #endif
@@ -12621,9 +12638,9 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
12621
12638
  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
12622
12639
  #endif
12623
12640
  static PyObject* __Pyx_PyCode_New(
12624
- __Pyx_PyCode_New_function_description descr,
12625
- PyObject **varnames,
12626
- PyObject* filename,
12641
+ const __Pyx_PyCode_New_function_description descr,
12642
+ PyObject * const *varnames,
12643
+ PyObject *filename,
12627
12644
  PyObject *funcname,
12628
12645
  const char *line_table,
12629
12646
  PyObject *tuple_dedup_map
@@ -1,10 +1,14 @@
1
1
  # Copyright (c) 2009 Type Supply LLC
2
2
  # Author: Tal Leming
3
3
 
4
- from fontTools.misc.roundTools import otRound, roundFunc
4
+ from __future__ import annotations
5
+
6
+ from typing import Any, Dict, List, Tuple
7
+
8
+ from fontTools.cffLib.specializer import commandsToProgram, specializeCommands
5
9
  from fontTools.misc.psCharStrings import T2CharString
10
+ from fontTools.misc.roundTools import otRound, roundFunc
6
11
  from fontTools.pens.basePen import BasePen
7
- from fontTools.cffLib.specializer import specializeCommands, commandsToProgram
8
12
 
9
13
 
10
14
  class T2CharStringPen(BasePen):
@@ -18,36 +22,52 @@ class T2CharStringPen(BasePen):
18
22
  which are close to their integral part within the tolerated range.
19
23
  """
20
24
 
21
- def __init__(self, width, glyphSet, roundTolerance=0.5, CFF2=False):
25
+ def __init__(
26
+ self,
27
+ width: float | None,
28
+ glyphSet: Dict[str, Any] | None,
29
+ roundTolerance: float = 0.5,
30
+ CFF2: bool = False,
31
+ ) -> None:
22
32
  super(T2CharStringPen, self).__init__(glyphSet)
23
33
  self.round = roundFunc(roundTolerance)
24
34
  self._CFF2 = CFF2
25
35
  self._width = width
26
- self._commands = []
36
+ self._commands: List[Tuple[str | bytes, List[float]]] = []
27
37
  self._p0 = (0, 0)
28
38
 
29
- def _p(self, pt):
39
+ def _p(self, pt: Tuple[float, float]) -> List[float]:
30
40
  p0 = self._p0
31
41
  pt = self._p0 = (self.round(pt[0]), self.round(pt[1]))
32
42
  return [pt[0] - p0[0], pt[1] - p0[1]]
33
43
 
34
- def _moveTo(self, pt):
44
+ def _moveTo(self, pt: Tuple[float, float]) -> None:
35
45
  self._commands.append(("rmoveto", self._p(pt)))
36
46
 
37
- def _lineTo(self, pt):
47
+ def _lineTo(self, pt: Tuple[float, float]) -> None:
38
48
  self._commands.append(("rlineto", self._p(pt)))
39
49
 
40
- def _curveToOne(self, pt1, pt2, pt3):
50
+ def _curveToOne(
51
+ self,
52
+ pt1: Tuple[float, float],
53
+ pt2: Tuple[float, float],
54
+ pt3: Tuple[float, float],
55
+ ) -> None:
41
56
  _p = self._p
42
57
  self._commands.append(("rrcurveto", _p(pt1) + _p(pt2) + _p(pt3)))
43
58
 
44
- def _closePath(self):
59
+ def _closePath(self) -> None:
45
60
  pass
46
61
 
47
- def _endPath(self):
62
+ def _endPath(self) -> None:
48
63
  pass
49
64
 
50
- def getCharString(self, private=None, globalSubrs=None, optimize=True):
65
+ def getCharString(
66
+ self,
67
+ private: Dict | None = None,
68
+ globalSubrs: List | None = None,
69
+ optimize: bool = True,
70
+ ) -> T2CharString:
51
71
  commands = self._commands
52
72
  if optimize:
53
73
  maxstack = 48 if not self._CFF2 else 513