fonttools 4.59.0__cp312-cp312-macosx_10_13_x86_64.whl → 4.59.1__cp312-cp312-macosx_10_13_x86_64.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/CFF2ToCFF.py +40 -10
- fontTools/cffLib/transforms.py +11 -6
- fontTools/cu2qu/cu2qu.c +21 -6
- fontTools/cu2qu/cu2qu.cpython-312-darwin.so +0 -0
- fontTools/feaLib/builder.py +6 -1
- fontTools/feaLib/lexer.c +21 -6
- fontTools/feaLib/lexer.cpython-312-darwin.so +0 -0
- fontTools/misc/bezierTools.c +24 -9
- fontTools/misc/bezierTools.cpython-312-darwin.so +0 -0
- fontTools/misc/psCharStrings.py +17 -2
- fontTools/pens/momentsPen.c +11 -4
- fontTools/pens/momentsPen.cpython-312-darwin.so +0 -0
- fontTools/qu2cu/qu2cu.c +23 -8
- fontTools/qu2cu/qu2cu.cpython-312-darwin.so +0 -0
- fontTools/ttLib/tables/_g_v_a_r.py +6 -3
- fontTools/ttLib/tables/_h_m_t_x.py +7 -3
- fontTools/varLib/featureVars.py +8 -0
- fontTools/varLib/instancer/__init__.py +65 -5
- fontTools/varLib/iup.c +23 -8
- fontTools/varLib/iup.cpython-312-darwin.so +0 -0
- fontTools/varLib/mutator.py +11 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/METADATA +24 -10
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/RECORD +30 -30
- {fonttools-4.59.0.data → fonttools-4.59.1.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/WHEEL +0 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/entry_points.txt +0 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/licenses/LICENSE +0 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/licenses/LICENSE.external +0 -0
- {fonttools-4.59.0.dist-info → fonttools-4.59.1.dist-info}/top_level.txt +0 -0
fontTools/__init__.py
CHANGED
fontTools/cffLib/CFF2ToCFF.py
CHANGED
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from fontTools.ttLib import TTFont, newTable
|
|
4
4
|
from fontTools.misc.cliTools import makeOutputFileName
|
|
5
|
+
from fontTools.misc.psCharStrings import T2StackUseExtractor
|
|
5
6
|
from fontTools.cffLib import (
|
|
6
7
|
TopDictIndex,
|
|
7
8
|
buildOrder,
|
|
8
9
|
buildDefaults,
|
|
9
10
|
topDictOperators,
|
|
10
11
|
privateDictOperators,
|
|
12
|
+
FDSelect,
|
|
11
13
|
)
|
|
14
|
+
from .transforms import desubroutinizeCharString
|
|
15
|
+
from .specializer import specializeProgram
|
|
12
16
|
from .width import optimizeWidths
|
|
13
17
|
from collections import defaultdict
|
|
14
18
|
import logging
|
|
@@ -27,7 +31,7 @@ def _convertCFF2ToCFF(cff, otFont):
|
|
|
27
31
|
The CFF2 font cannot be variable. (TODO Accept those and convert to the
|
|
28
32
|
default instance?)
|
|
29
33
|
|
|
30
|
-
This assumes a decompiled
|
|
34
|
+
This assumes a decompiled CFF2 table. (i.e. that the object has been
|
|
31
35
|
filled via :meth:`decompile` and e.g. not loaded from XML.)"""
|
|
32
36
|
|
|
33
37
|
cff.major = 1
|
|
@@ -51,9 +55,14 @@ def _convertCFF2ToCFF(cff, otFont):
|
|
|
51
55
|
if hasattr(topDict, key):
|
|
52
56
|
delattr(topDict, key)
|
|
53
57
|
|
|
54
|
-
fdArray = topDict.FDArray
|
|
55
58
|
charStrings = topDict.CharStrings
|
|
56
59
|
|
|
60
|
+
fdArray = topDict.FDArray
|
|
61
|
+
if not hasattr(topDict, "FDSelect"):
|
|
62
|
+
# FDSelect is optional in CFF2, but required in CFF.
|
|
63
|
+
fdSelect = topDict.FDSelect = FDSelect()
|
|
64
|
+
fdSelect.gidArray = [0] * len(charStrings.charStrings)
|
|
65
|
+
|
|
57
66
|
defaults = buildDefaults(privateDictOperators)
|
|
58
67
|
order = buildOrder(privateDictOperators)
|
|
59
68
|
for fd in fdArray:
|
|
@@ -69,6 +78,7 @@ def _convertCFF2ToCFF(cff, otFont):
|
|
|
69
78
|
if hasattr(privateDict, key):
|
|
70
79
|
delattr(privateDict, key)
|
|
71
80
|
|
|
81
|
+
# Add ending operators
|
|
72
82
|
for cs in charStrings.values():
|
|
73
83
|
cs.decompile()
|
|
74
84
|
cs.program.append("endchar")
|
|
@@ -100,23 +110,43 @@ def _convertCFF2ToCFF(cff, otFont):
|
|
|
100
110
|
if width != private.defaultWidthX:
|
|
101
111
|
cs.program.insert(0, width - private.nominalWidthX)
|
|
102
112
|
|
|
113
|
+
# Handle stack use since stack-depth is lower in CFF than in CFF2.
|
|
114
|
+
for glyphName in charStrings.keys():
|
|
115
|
+
cs, fdIndex = charStrings.getItemAndSelector(glyphName)
|
|
116
|
+
if fdIndex is None:
|
|
117
|
+
fdIndex = 0
|
|
118
|
+
private = fdArray[fdIndex].Private
|
|
119
|
+
extractor = T2StackUseExtractor(
|
|
120
|
+
getattr(private, "Subrs", []), cff.GlobalSubrs, private=private
|
|
121
|
+
)
|
|
122
|
+
stackUse = extractor.execute(cs)
|
|
123
|
+
if stackUse > 48: # CFF stack depth is 48
|
|
124
|
+
desubroutinizeCharString(cs)
|
|
125
|
+
cs.program = specializeProgram(cs.program)
|
|
126
|
+
|
|
127
|
+
# Unused subroutines are still in CFF2 (ie. lacking 'return' operator)
|
|
128
|
+
# because they were not decompiled when we added the 'return'.
|
|
129
|
+
# Moreover, some used subroutines may have become unused after the
|
|
130
|
+
# stack-use fixup. So we remove all unused subroutines now.
|
|
131
|
+
cff.remove_unused_subroutines()
|
|
132
|
+
|
|
103
133
|
mapping = {
|
|
104
|
-
name: ("cid" + str(n) if n else ".notdef")
|
|
134
|
+
name: ("cid" + str(n).zfill(5) if n else ".notdef")
|
|
105
135
|
for n, name in enumerate(topDict.charset)
|
|
106
136
|
}
|
|
107
137
|
topDict.charset = [
|
|
108
|
-
"cid" + str(n) if n else ".notdef" for n in range(len(topDict.charset))
|
|
138
|
+
"cid" + str(n).zfill(5) if n else ".notdef" for n in range(len(topDict.charset))
|
|
109
139
|
]
|
|
110
140
|
charStrings.charStrings = {
|
|
111
141
|
mapping[name]: v for name, v in charStrings.charStrings.items()
|
|
112
142
|
}
|
|
113
143
|
|
|
114
|
-
|
|
115
|
-
# the output if I add it.
|
|
116
|
-
# topDict.ROS = ("Adobe", "Identity", 0)
|
|
144
|
+
topDict.ROS = ("Adobe", "Identity", 0)
|
|
117
145
|
|
|
118
146
|
|
|
119
147
|
def convertCFF2ToCFF(font, *, updatePostTable=True):
|
|
148
|
+
if "CFF2" not in font:
|
|
149
|
+
raise ValueError("Input font does not contain a CFF2 table.")
|
|
120
150
|
cff = font["CFF2"].cff
|
|
121
151
|
_convertCFF2ToCFF(cff, font)
|
|
122
152
|
del font["CFF2"]
|
|
@@ -131,7 +161,7 @@ def convertCFF2ToCFF(font, *, updatePostTable=True):
|
|
|
131
161
|
|
|
132
162
|
|
|
133
163
|
def main(args=None):
|
|
134
|
-
"""Convert
|
|
164
|
+
"""Convert CFF2 OTF font to CFF OTF font"""
|
|
135
165
|
if args is None:
|
|
136
166
|
import sys
|
|
137
167
|
|
|
@@ -140,8 +170,8 @@ def main(args=None):
|
|
|
140
170
|
import argparse
|
|
141
171
|
|
|
142
172
|
parser = argparse.ArgumentParser(
|
|
143
|
-
"fonttools cffLib.
|
|
144
|
-
description="
|
|
173
|
+
"fonttools cffLib.CFF2ToCFF",
|
|
174
|
+
description="Convert a non-variable CFF2 font to CFF.",
|
|
145
175
|
)
|
|
146
176
|
parser.add_argument(
|
|
147
177
|
"input", metavar="INPUT.ttf", help="Input OTF file with CFF table."
|
fontTools/cffLib/transforms.py
CHANGED
|
@@ -94,17 +94,22 @@ class _DesubroutinizingT2Decompiler(SimpleT2Decompiler):
|
|
|
94
94
|
cs._patches.append((index, subr._desubroutinized))
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
def desubroutinizeCharString(cs):
|
|
98
|
+
"""Desubroutinize a charstring in-place."""
|
|
99
|
+
cs.decompile()
|
|
100
|
+
subrs = getattr(cs.private, "Subrs", [])
|
|
101
|
+
decompiler = _DesubroutinizingT2Decompiler(subrs, cs.globalSubrs, cs.private)
|
|
102
|
+
decompiler.execute(cs)
|
|
103
|
+
cs.program = cs._desubroutinized
|
|
104
|
+
del cs._desubroutinized
|
|
105
|
+
|
|
106
|
+
|
|
97
107
|
def desubroutinize(cff):
|
|
98
108
|
for fontName in cff.fontNames:
|
|
99
109
|
font = cff[fontName]
|
|
100
110
|
cs = font.CharStrings
|
|
101
111
|
for c in cs.values():
|
|
102
|
-
c
|
|
103
|
-
subrs = getattr(c.private, "Subrs", [])
|
|
104
|
-
decompiler = _DesubroutinizingT2Decompiler(subrs, c.globalSubrs, c.private)
|
|
105
|
-
decompiler.execute(c)
|
|
106
|
-
c.program = c._desubroutinized
|
|
107
|
-
del c._desubroutinized
|
|
112
|
+
desubroutinizeCharString(c)
|
|
108
113
|
# Delete all the local subrs
|
|
109
114
|
if hasattr(font, "FDArray"):
|
|
110
115
|
for fd in font.FDArray:
|
fontTools/cu2qu/cu2qu.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.3 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -32,8 +32,8 @@ END: Cython Metadata */
|
|
|
32
32
|
#elif PY_VERSION_HEX < 0x03080000
|
|
33
33
|
#error Cython requires Python 3.8+.
|
|
34
34
|
#else
|
|
35
|
-
#define __PYX_ABI_VERSION "
|
|
36
|
-
#define CYTHON_HEX_VERSION
|
|
35
|
+
#define __PYX_ABI_VERSION "3_1_3"
|
|
36
|
+
#define CYTHON_HEX_VERSION 0x030103F0
|
|
37
37
|
#define CYTHON_FUTURE_DIVISION 1
|
|
38
38
|
/* CModulePreamble */
|
|
39
39
|
#include <stddef.h>
|
|
@@ -396,6 +396,9 @@ END: Cython Metadata */
|
|
|
396
396
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
397
397
|
#endif
|
|
398
398
|
#endif
|
|
399
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
400
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
401
|
+
#endif
|
|
399
402
|
#ifndef __has_attribute
|
|
400
403
|
#define __has_attribute(x) 0
|
|
401
404
|
#endif
|
|
@@ -10305,6 +10308,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10305
10308
|
changed = 1;
|
|
10306
10309
|
}
|
|
10307
10310
|
#endif // CYTHON_METH_FASTCALL
|
|
10311
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
10308
10312
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
10309
10313
|
PyObject *descr;
|
|
10310
10314
|
assert(memb->type == T_OBJECT);
|
|
@@ -10319,11 +10323,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10319
10323
|
}
|
|
10320
10324
|
changed = 1;
|
|
10321
10325
|
}
|
|
10326
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
10322
10327
|
}
|
|
10323
10328
|
memb++;
|
|
10324
10329
|
}
|
|
10325
10330
|
}
|
|
10326
10331
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
10332
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
10327
10333
|
slot = spec->slots;
|
|
10328
10334
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
10329
10335
|
slot++;
|
|
@@ -10355,6 +10361,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10355
10361
|
++getset;
|
|
10356
10362
|
}
|
|
10357
10363
|
}
|
|
10364
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
10358
10365
|
if (changed)
|
|
10359
10366
|
PyType_Modified(type);
|
|
10360
10367
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -10465,6 +10472,13 @@ try_unpack:
|
|
|
10465
10472
|
|
|
10466
10473
|
/* PyObjectCallMethod0 */
|
|
10467
10474
|
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
|
10475
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
10476
|
+
PyObject *args[1] = {obj};
|
|
10477
|
+
(void) __Pyx_PyObject_GetMethod;
|
|
10478
|
+
(void) __Pyx_PyObject_CallOneArg;
|
|
10479
|
+
(void) __Pyx_PyObject_CallNoArg;
|
|
10480
|
+
return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
10481
|
+
#else
|
|
10468
10482
|
PyObject *method = NULL, *result = NULL;
|
|
10469
10483
|
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
|
10470
10484
|
if (likely(is_method)) {
|
|
@@ -10477,6 +10491,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name
|
|
|
10477
10491
|
Py_DECREF(method);
|
|
10478
10492
|
bad:
|
|
10479
10493
|
return result;
|
|
10494
|
+
#endif
|
|
10480
10495
|
}
|
|
10481
10496
|
|
|
10482
10497
|
/* ValidateBasesTuple */
|
|
@@ -11088,7 +11103,7 @@ bad:
|
|
|
11088
11103
|
}
|
|
11089
11104
|
|
|
11090
11105
|
/* CommonTypesMetaclass */
|
|
11091
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
11106
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
11092
11107
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
11093
11108
|
}
|
|
11094
11109
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
@@ -13654,7 +13669,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyOb
|
|
|
13654
13669
|
}
|
|
13655
13670
|
|
|
13656
13671
|
/* PyObjectCallMethod1 */
|
|
13657
|
-
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
13672
|
+
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
|
|
13658
13673
|
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
13659
13674
|
PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
|
|
13660
13675
|
Py_DECREF(method);
|
|
@@ -13662,7 +13677,7 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
|
13662
13677
|
}
|
|
13663
13678
|
#endif
|
|
13664
13679
|
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
|
|
13665
|
-
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
|
|
13680
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
13666
13681
|
PyObject *args[2] = {obj, arg};
|
|
13667
13682
|
(void) __Pyx_PyObject_GetMethod;
|
|
13668
13683
|
(void) __Pyx_PyObject_CallOneArg;
|
|
Binary file
|
fontTools/feaLib/builder.py
CHANGED
|
@@ -926,6 +926,11 @@ class Builder(object):
|
|
|
926
926
|
l.lookup_index for l in lookups if l.lookup_index is not None
|
|
927
927
|
)
|
|
928
928
|
)
|
|
929
|
+
# order doesn't matter, but lookup_indices preserves it.
|
|
930
|
+
# We want to combine identical sets of lookups (order doesn't matter)
|
|
931
|
+
# but also respect the order provided by the user (although there's
|
|
932
|
+
# a reasonable argument to just sort and dedupe, which fontc does)
|
|
933
|
+
lookup_key = frozenset(lookup_indices)
|
|
929
934
|
|
|
930
935
|
size_feature = tag == "GPOS" and feature_tag == "size"
|
|
931
936
|
force_feature = self.any_feature_variations(feature_tag, tag)
|
|
@@ -943,7 +948,7 @@ class Builder(object):
|
|
|
943
948
|
"stash debug information. See fonttools#2065."
|
|
944
949
|
)
|
|
945
950
|
|
|
946
|
-
feature_key = (feature_tag,
|
|
951
|
+
feature_key = (feature_tag, lookup_key)
|
|
947
952
|
feature_index = feature_indices.get(feature_key)
|
|
948
953
|
if feature_index is None:
|
|
949
954
|
feature_index = len(table.FeatureList.FeatureRecord)
|
fontTools/feaLib/lexer.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.3 */
|
|
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 "
|
|
30
|
-
#define CYTHON_HEX_VERSION
|
|
29
|
+
#define __PYX_ABI_VERSION "3_1_3"
|
|
30
|
+
#define CYTHON_HEX_VERSION 0x030103F0
|
|
31
31
|
#define CYTHON_FUTURE_DIVISION 1
|
|
32
32
|
/* CModulePreamble */
|
|
33
33
|
#include <stddef.h>
|
|
@@ -390,6 +390,9 @@ END: Cython Metadata */
|
|
|
390
390
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
391
391
|
#endif
|
|
392
392
|
#endif
|
|
393
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
394
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
395
|
+
#endif
|
|
393
396
|
#ifndef __has_attribute
|
|
394
397
|
#define __has_attribute(x) 0
|
|
395
398
|
#endif
|
|
@@ -13414,6 +13417,13 @@ try_unpack:
|
|
|
13414
13417
|
|
|
13415
13418
|
/* PyObjectCallMethod0 */
|
|
13416
13419
|
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
|
13420
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
13421
|
+
PyObject *args[1] = {obj};
|
|
13422
|
+
(void) __Pyx_PyObject_GetMethod;
|
|
13423
|
+
(void) __Pyx_PyObject_CallOneArg;
|
|
13424
|
+
(void) __Pyx_PyObject_CallNoArg;
|
|
13425
|
+
return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
13426
|
+
#else
|
|
13417
13427
|
PyObject *method = NULL, *result = NULL;
|
|
13418
13428
|
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
|
13419
13429
|
if (likely(is_method)) {
|
|
@@ -13426,6 +13436,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name
|
|
|
13426
13436
|
Py_DECREF(method);
|
|
13427
13437
|
bad:
|
|
13428
13438
|
return result;
|
|
13439
|
+
#endif
|
|
13429
13440
|
}
|
|
13430
13441
|
|
|
13431
13442
|
/* CallUnboundCMethod0 */
|
|
@@ -13493,7 +13504,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyOb
|
|
|
13493
13504
|
}
|
|
13494
13505
|
|
|
13495
13506
|
/* PyObjectCallMethod1 */
|
|
13496
|
-
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
13507
|
+
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
|
|
13497
13508
|
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
13498
13509
|
PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
|
|
13499
13510
|
Py_DECREF(method);
|
|
@@ -13501,7 +13512,7 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
|
13501
13512
|
}
|
|
13502
13513
|
#endif
|
|
13503
13514
|
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
|
|
13504
|
-
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
|
|
13515
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
13505
13516
|
PyObject *args[2] = {obj, arg};
|
|
13506
13517
|
(void) __Pyx_PyObject_GetMethod;
|
|
13507
13518
|
(void) __Pyx_PyObject_CallOneArg;
|
|
@@ -14087,6 +14098,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
14087
14098
|
changed = 1;
|
|
14088
14099
|
}
|
|
14089
14100
|
#endif // CYTHON_METH_FASTCALL
|
|
14101
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
14090
14102
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
14091
14103
|
PyObject *descr;
|
|
14092
14104
|
assert(memb->type == T_OBJECT);
|
|
@@ -14101,11 +14113,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
14101
14113
|
}
|
|
14102
14114
|
changed = 1;
|
|
14103
14115
|
}
|
|
14116
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
14104
14117
|
}
|
|
14105
14118
|
memb++;
|
|
14106
14119
|
}
|
|
14107
14120
|
}
|
|
14108
14121
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
14122
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
14109
14123
|
slot = spec->slots;
|
|
14110
14124
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
14111
14125
|
slot++;
|
|
@@ -14137,6 +14151,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
14137
14151
|
++getset;
|
|
14138
14152
|
}
|
|
14139
14153
|
}
|
|
14154
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
14140
14155
|
if (changed)
|
|
14141
14156
|
PyType_Modified(type);
|
|
14142
14157
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -14269,7 +14284,7 @@ bad:
|
|
|
14269
14284
|
}
|
|
14270
14285
|
|
|
14271
14286
|
/* CommonTypesMetaclass */
|
|
14272
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
14287
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
14273
14288
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
14274
14289
|
}
|
|
14275
14290
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
Binary file
|
fontTools/misc/bezierTools.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.3 */
|
|
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 "
|
|
30
|
-
#define CYTHON_HEX_VERSION
|
|
29
|
+
#define __PYX_ABI_VERSION "3_1_3"
|
|
30
|
+
#define CYTHON_HEX_VERSION 0x030103F0
|
|
31
31
|
#define CYTHON_FUTURE_DIVISION 1
|
|
32
32
|
/* CModulePreamble */
|
|
33
33
|
#include <stddef.h>
|
|
@@ -390,6 +390,9 @@ END: Cython Metadata */
|
|
|
390
390
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
391
391
|
#endif
|
|
392
392
|
#endif
|
|
393
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
394
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
395
|
+
#endif
|
|
393
396
|
#ifndef __has_attribute
|
|
394
397
|
#define __has_attribute(x) 0
|
|
395
398
|
#endif
|
|
@@ -2390,7 +2393,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2
|
|
|
2390
2393
|
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
|
|
2391
2394
|
#define __Pyx_PyNumber_Absolute(x)\
|
|
2392
2395
|
((likely(PyLong_CheckExact(x))) ?\
|
|
2393
|
-
(likely(__Pyx_PyLong_IsNonNeg(x)) ? (
|
|
2396
|
+
(likely(__Pyx_PyLong_IsNonNeg(x)) ? __Pyx_NewRef(x) : __Pyx_PyLong_AbsNeg(x)) :\
|
|
2394
2397
|
PyNumber_Absolute(x))
|
|
2395
2398
|
#else
|
|
2396
2399
|
#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
|
|
@@ -3261,7 +3264,7 @@ static const char __pyx_k_segmentPointAtT[] = "segmentPointAtT";
|
|
|
3261
3264
|
static const char __pyx_k_splitCubicAtT_2[] = "splitCubicAtT";
|
|
3262
3265
|
static const char __pyx_k_transformPoints[] = "transformPoints";
|
|
3263
3266
|
static const char __pyx_k_1_a_r_wb_gRvWBfA[] = "\320\000+\2501\360\034\000\005\014\320\013\036\230a\330\010\017\210r\220\026\220w\230b\240\006\240g\250R\250v\260W\270B\270f\300A";
|
|
3264
|
-
static const char __pyx_k_s_3c_A_AS_1_b_AQ[] = "\200\001\330\004\007\200s\210!\2103\210c\220\021\330\010\017\320\017\"\240\"\240A\330\t\014\210A\210S\220\003\2201\330\010\017\210
|
|
3267
|
+
static const char __pyx_k_s_3c_A_AS_1_b_AQ[] = "\200\001\330\004\007\200s\210!\2103\210c\220\021\330\010\017\320\017\"\240\"\240A\330\t\014\210A\210S\220\003\2201\330\010\017\210\177\230b\240\001\330\004\n\210*\220A\220Q";
|
|
3265
3268
|
static const char __pyx_k_splitCubicAtTC_2[] = "_splitCubicAtTC";
|
|
3266
3269
|
static const char __pyx_k_quadraticPointAtT[] = "quadraticPointAtT";
|
|
3267
3270
|
static const char __pyx_k_splitQuadraticAtT[] = "_splitQuadraticAtT";
|
|
@@ -34135,6 +34138,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
34135
34138
|
changed = 1;
|
|
34136
34139
|
}
|
|
34137
34140
|
#endif // CYTHON_METH_FASTCALL
|
|
34141
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
34138
34142
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
34139
34143
|
PyObject *descr;
|
|
34140
34144
|
assert(memb->type == T_OBJECT);
|
|
@@ -34149,11 +34153,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
34149
34153
|
}
|
|
34150
34154
|
changed = 1;
|
|
34151
34155
|
}
|
|
34156
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
34152
34157
|
}
|
|
34153
34158
|
memb++;
|
|
34154
34159
|
}
|
|
34155
34160
|
}
|
|
34156
34161
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
34162
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
34157
34163
|
slot = spec->slots;
|
|
34158
34164
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
34159
34165
|
slot++;
|
|
@@ -34185,6 +34191,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
34185
34191
|
++getset;
|
|
34186
34192
|
}
|
|
34187
34193
|
}
|
|
34194
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
34188
34195
|
if (changed)
|
|
34189
34196
|
PyType_Modified(type);
|
|
34190
34197
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -34317,7 +34324,7 @@ bad:
|
|
|
34317
34324
|
}
|
|
34318
34325
|
|
|
34319
34326
|
/* CommonTypesMetaclass */
|
|
34320
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
34327
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
34321
34328
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
34322
34329
|
}
|
|
34323
34330
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
@@ -34735,7 +34742,7 @@ try_unpack:
|
|
|
34735
34742
|
}
|
|
34736
34743
|
|
|
34737
34744
|
/* PyObjectCallMethod1 */
|
|
34738
|
-
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
34745
|
+
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
|
|
34739
34746
|
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
34740
34747
|
PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
|
|
34741
34748
|
Py_DECREF(method);
|
|
@@ -34743,7 +34750,7 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
|
34743
34750
|
}
|
|
34744
34751
|
#endif
|
|
34745
34752
|
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
|
|
34746
|
-
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
|
|
34753
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
34747
34754
|
PyObject *args[2] = {obj, arg};
|
|
34748
34755
|
(void) __Pyx_PyObject_GetMethod;
|
|
34749
34756
|
(void) __Pyx_PyObject_CallOneArg;
|
|
@@ -36076,7 +36083,7 @@ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
|
|
|
36076
36083
|
PyObject *copy = _PyLong_Copy((PyLongObject*)n);
|
|
36077
36084
|
if (likely(copy)) {
|
|
36078
36085
|
#if PY_VERSION_HEX >= 0x030C00A7
|
|
36079
|
-
((PyLongObject*)copy)->long_value.lv_tag
|
|
36086
|
+
((PyLongObject*)copy)->long_value.lv_tag ^= ((PyLongObject*)copy)->long_value.lv_tag & _PyLong_SIGN_MASK;
|
|
36080
36087
|
#else
|
|
36081
36088
|
__Pyx_SET_SIZE(copy, -Py_SIZE(copy));
|
|
36082
36089
|
#endif
|
|
@@ -37773,6 +37780,13 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in
|
|
|
37773
37780
|
|
|
37774
37781
|
/* PyObjectCallMethod0 */
|
|
37775
37782
|
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
|
37783
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
37784
|
+
PyObject *args[1] = {obj};
|
|
37785
|
+
(void) __Pyx_PyObject_GetMethod;
|
|
37786
|
+
(void) __Pyx_PyObject_CallOneArg;
|
|
37787
|
+
(void) __Pyx_PyObject_CallNoArg;
|
|
37788
|
+
return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
37789
|
+
#else
|
|
37776
37790
|
PyObject *method = NULL, *result = NULL;
|
|
37777
37791
|
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
|
37778
37792
|
if (likely(is_method)) {
|
|
@@ -37785,6 +37799,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name
|
|
|
37785
37799
|
Py_DECREF(method);
|
|
37786
37800
|
bad:
|
|
37787
37801
|
return result;
|
|
37802
|
+
#endif
|
|
37788
37803
|
}
|
|
37789
37804
|
|
|
37790
37805
|
/* ValidateBasesTuple */
|
|
Binary file
|
fontTools/misc/psCharStrings.py
CHANGED
|
@@ -338,7 +338,7 @@ class SimpleT2Decompiler(object):
|
|
|
338
338
|
self.numRegions = 0
|
|
339
339
|
self.vsIndex = 0
|
|
340
340
|
|
|
341
|
-
def execute(self, charString):
|
|
341
|
+
def execute(self, charString, *, pushToStack=None):
|
|
342
342
|
self.callingStack.append(charString)
|
|
343
343
|
needsDecompilation = charString.needsDecompilation()
|
|
344
344
|
if needsDecompilation:
|
|
@@ -346,7 +346,8 @@ class SimpleT2Decompiler(object):
|
|
|
346
346
|
pushToProgram = program.append
|
|
347
347
|
else:
|
|
348
348
|
pushToProgram = lambda x: None
|
|
349
|
-
pushToStack
|
|
349
|
+
if pushToStack is None:
|
|
350
|
+
pushToStack = self.operandStack.append
|
|
350
351
|
index = 0
|
|
351
352
|
while True:
|
|
352
353
|
token, isOperator, index = charString.getToken(index)
|
|
@@ -551,6 +552,20 @@ t1Operators = [
|
|
|
551
552
|
]
|
|
552
553
|
|
|
553
554
|
|
|
555
|
+
class T2StackUseExtractor(SimpleT2Decompiler):
|
|
556
|
+
|
|
557
|
+
def execute(self, charString):
|
|
558
|
+
maxStackUse = 0
|
|
559
|
+
|
|
560
|
+
def pushToStack(value):
|
|
561
|
+
nonlocal maxStackUse
|
|
562
|
+
self.operandStack.append(value)
|
|
563
|
+
maxStackUse = max(maxStackUse, len(self.operandStack))
|
|
564
|
+
|
|
565
|
+
super().execute(charString, pushToStack=pushToStack)
|
|
566
|
+
return maxStackUse
|
|
567
|
+
|
|
568
|
+
|
|
554
569
|
class T2WidthExtractor(SimpleT2Decompiler):
|
|
555
570
|
def __init__(
|
|
556
571
|
self,
|
fontTools/pens/momentsPen.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.3 */
|
|
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 "
|
|
30
|
-
#define CYTHON_HEX_VERSION
|
|
29
|
+
#define __PYX_ABI_VERSION "3_1_3"
|
|
30
|
+
#define CYTHON_HEX_VERSION 0x030103F0
|
|
31
31
|
#define CYTHON_FUTURE_DIVISION 1
|
|
32
32
|
/* CModulePreamble */
|
|
33
33
|
#include <stddef.h>
|
|
@@ -390,6 +390,9 @@ END: Cython Metadata */
|
|
|
390
390
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
391
391
|
#endif
|
|
392
392
|
#endif
|
|
393
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
394
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
395
|
+
#endif
|
|
393
396
|
#ifndef __has_attribute
|
|
394
397
|
#define __has_attribute(x) 0
|
|
395
398
|
#endif
|
|
@@ -10172,6 +10175,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10172
10175
|
changed = 1;
|
|
10173
10176
|
}
|
|
10174
10177
|
#endif // CYTHON_METH_FASTCALL
|
|
10178
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
10175
10179
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
10176
10180
|
PyObject *descr;
|
|
10177
10181
|
assert(memb->type == T_OBJECT);
|
|
@@ -10186,11 +10190,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10186
10190
|
}
|
|
10187
10191
|
changed = 1;
|
|
10188
10192
|
}
|
|
10193
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
10189
10194
|
}
|
|
10190
10195
|
memb++;
|
|
10191
10196
|
}
|
|
10192
10197
|
}
|
|
10193
10198
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
10199
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
10194
10200
|
slot = spec->slots;
|
|
10195
10201
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
10196
10202
|
slot++;
|
|
@@ -10222,6 +10228,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
10222
10228
|
++getset;
|
|
10223
10229
|
}
|
|
10224
10230
|
}
|
|
10231
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
10225
10232
|
if (changed)
|
|
10226
10233
|
PyType_Modified(type);
|
|
10227
10234
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -10354,7 +10361,7 @@ bad:
|
|
|
10354
10361
|
}
|
|
10355
10362
|
|
|
10356
10363
|
/* CommonTypesMetaclass */
|
|
10357
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
10364
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
10358
10365
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
10359
10366
|
}
|
|
10360
10367
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
Binary file
|