fonttools 4.58.2__cp312-cp312-macosx_10_13_universal2.whl → 4.58.3__cp312-cp312-macosx_10_13_universal2.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/qu2cu/qu2cu.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.1 */
1
+ /* Generated by Cython 3.1.2 */
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 "3_1_1"
36
- #define CYTHON_HEX_VERSION 0x030101F0
35
+ #define __PYX_ABI_VERSION "3_1_2"
36
+ #define CYTHON_HEX_VERSION 0x030102F0
37
37
  #define CYTHON_FUTURE_DIVISION 1
38
38
  /* CModulePreamble */
39
39
  #include <stddef.h>
@@ -448,7 +448,7 @@ END: Cython Metadata */
448
448
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
449
449
  #endif
450
450
  #ifndef CYTHON_NCP_UNUSED
451
- # if CYTHON_COMPILING_IN_CPYTHON
451
+ # if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
452
452
  # define CYTHON_NCP_UNUSED
453
453
  # else
454
454
  # define CYTHON_NCP_UNUSED CYTHON_UNUSED
@@ -893,11 +893,19 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
893
893
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
894
894
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
895
895
  #endif
896
- #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
896
+ #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
897
897
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
898
898
  #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
899
+ #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
900
+ #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
899
901
  #else
900
- #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i)
902
+ #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
903
+ #endif
904
+ #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
905
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
906
+ #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
907
+ #else
908
+ #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
901
909
  #endif
902
910
  #else
903
911
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
@@ -1305,7 +1313,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1305
1313
  #endif /* __GNUC__ */
1306
1314
  /* PretendToInitialize */
1307
1315
  #ifdef __cplusplus
1316
+ #if __cplusplus > 201103L
1308
1317
  #include <type_traits>
1318
+ #endif
1309
1319
  template <typename T>
1310
1320
  static void __Pyx_pretend_to_initialize(T* ptr) {
1311
1321
  #if __cplusplus > 201103L
@@ -1896,18 +1906,18 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1896
1906
  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1897
1907
 
1898
1908
  /* GetItemInt.proto */
1899
- #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1909
+ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
1900
1910
  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1901
1911
  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1902
1912
  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1903
1913
  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1904
- #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1914
+ #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
1905
1915
  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1906
1916
  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1907
1917
  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1908
1918
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1909
1919
  int wraparound, int boundscheck);
1910
- #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1920
+ #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
1911
1921
  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1912
1922
  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1913
1923
  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
@@ -2196,6 +2206,15 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2196
2206
  static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
2197
2207
  #endif
2198
2208
 
2209
+ /* LimitedApiGetTypeDict.proto */
2210
+ #if CYTHON_COMPILING_IN_LIMITED_API
2211
+ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
2212
+ #endif
2213
+
2214
+ /* SetItemOnTypeDict.proto */
2215
+ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
2216
+ #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
2217
+
2199
2218
  /* FixUpExtensionType.proto */
2200
2219
  static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2201
2220
 
@@ -2221,7 +2240,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2221
2240
  static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);
2222
2241
 
2223
2242
  /* FetchCommonType.proto */
2224
- static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2243
+ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2244
+
2245
+ /* CommonTypesMetaclass.proto */
2246
+ static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2247
+ #define __Pyx_CommonTypesMetaclass_USED
2225
2248
 
2226
2249
  /* PyMethodNew.proto */
2227
2250
  static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
@@ -2608,6 +2631,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos
2608
2631
  #if __PYX_HAS_PY_AM_SEND == 2
2609
2632
  static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
2610
2633
  #endif
2634
+ static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);
2611
2635
 
2612
2636
  /* Generator.proto */
2613
2637
  #define __Pyx_Generator_USED
@@ -2775,6 +2799,7 @@ static const char __pyx_k_best_sol[] = "best_sol";
2775
2799
  static const char __pyx_k_is_cubic[] = "is_cubic";
2776
2800
  static const char __pyx_k_qualname[] = "__qualname__";
2777
2801
  static const char __pyx_k_reversed[] = "reversed";
2802
+ static const char __pyx_k_set_name[] = "__set_name__";
2778
2803
  static const char __pyx_k_all_cubic[] = "all_cubic";
2779
2804
  static const char __pyx_k_enumerate[] = "enumerate";
2780
2805
  static const char __pyx_k_isenabled[] = "isenabled";
@@ -2891,7 +2916,7 @@ typedef struct {
2891
2916
  PyObject *__pyx_slice[1];
2892
2917
  PyObject *__pyx_tuple[1];
2893
2918
  PyObject *__pyx_codeobj_tab[7];
2894
- PyObject *__pyx_string_tab[132];
2919
+ PyObject *__pyx_string_tab[133];
2895
2920
  PyObject *__pyx_int_0;
2896
2921
  PyObject *__pyx_int_1;
2897
2922
  PyObject *__pyx_int_3;
@@ -2906,6 +2931,9 @@ int __pyx_freecount_9fontTools_5qu2cu_5qu2cu___pyx_scope_struct__genexpr;
2906
2931
  struct __pyx_obj_9fontTools_5qu2cu_5qu2cu___pyx_scope_struct_1_genexpr *__pyx_freelist_9fontTools_5qu2cu_5qu2cu___pyx_scope_struct_1_genexpr[8];
2907
2932
  int __pyx_freecount_9fontTools_5qu2cu_5qu2cu___pyx_scope_struct_1_genexpr;
2908
2933
  #endif
2934
+ /* CommonTypesMetaclass.module_state_decls */
2935
+ PyTypeObject *__pyx_CommonTypesMetaclassType;
2936
+
2909
2937
  /* CachedMethodType.module_state_decls */
2910
2938
  #if CYTHON_COMPILING_IN_LIMITED_API
2911
2939
  PyObject *__Pyx_CachedMethodType;
@@ -3055,27 +3083,28 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
3055
3083
  #define __pyx_n_u_return __pyx_string_tab[108]
3056
3084
  #define __pyx_n_u_reversed __pyx_string_tab[109]
3057
3085
  #define __pyx_n_u_send __pyx_string_tab[110]
3058
- #define __pyx_n_u_sols __pyx_string_tab[111]
3059
- #define __pyx_n_u_spec __pyx_string_tab[112]
3060
- #define __pyx_n_u_spline_to_curves __pyx_string_tab[113]
3061
- #define __pyx_n_u_spline_to_curves_locals_genexpr __pyx_string_tab[114]
3062
- #define __pyx_n_u_splitCubicAtTC __pyx_string_tab[115]
3063
- #define __pyx_n_u_splits __pyx_string_tab[116]
3064
- #define __pyx_n_u_start __pyx_string_tab[117]
3065
- #define __pyx_n_u_start_index __pyx_string_tab[118]
3066
- #define __pyx_n_u_test __pyx_string_tab[119]
3067
- #define __pyx_n_u_this_count __pyx_string_tab[120]
3068
- #define __pyx_n_u_this_sol_count __pyx_string_tab[121]
3069
- #define __pyx_n_u_throw __pyx_string_tab[122]
3070
- #define __pyx_n_u_tolerance __pyx_string_tab[123]
3071
- #define __pyx_n_u_ts __pyx_string_tab[124]
3072
- #define __pyx_n_u_typing __pyx_string_tab[125]
3073
- #define __pyx_n_u_u __pyx_string_tab[126]
3074
- #define __pyx_n_u_v __pyx_string_tab[127]
3075
- #define __pyx_n_u_value __pyx_string_tab[128]
3076
- #define __pyx_n_u_x __pyx_string_tab[129]
3077
- #define __pyx_n_u_y __pyx_string_tab[130]
3078
- #define __pyx_n_u_zip __pyx_string_tab[131]
3086
+ #define __pyx_n_u_set_name __pyx_string_tab[111]
3087
+ #define __pyx_n_u_sols __pyx_string_tab[112]
3088
+ #define __pyx_n_u_spec __pyx_string_tab[113]
3089
+ #define __pyx_n_u_spline_to_curves __pyx_string_tab[114]
3090
+ #define __pyx_n_u_spline_to_curves_locals_genexpr __pyx_string_tab[115]
3091
+ #define __pyx_n_u_splitCubicAtTC __pyx_string_tab[116]
3092
+ #define __pyx_n_u_splits __pyx_string_tab[117]
3093
+ #define __pyx_n_u_start __pyx_string_tab[118]
3094
+ #define __pyx_n_u_start_index __pyx_string_tab[119]
3095
+ #define __pyx_n_u_test __pyx_string_tab[120]
3096
+ #define __pyx_n_u_this_count __pyx_string_tab[121]
3097
+ #define __pyx_n_u_this_sol_count __pyx_string_tab[122]
3098
+ #define __pyx_n_u_throw __pyx_string_tab[123]
3099
+ #define __pyx_n_u_tolerance __pyx_string_tab[124]
3100
+ #define __pyx_n_u_ts __pyx_string_tab[125]
3101
+ #define __pyx_n_u_typing __pyx_string_tab[126]
3102
+ #define __pyx_n_u_u __pyx_string_tab[127]
3103
+ #define __pyx_n_u_v __pyx_string_tab[128]
3104
+ #define __pyx_n_u_value __pyx_string_tab[129]
3105
+ #define __pyx_n_u_x __pyx_string_tab[130]
3106
+ #define __pyx_n_u_y __pyx_string_tab[131]
3107
+ #define __pyx_n_u_zip __pyx_string_tab[132]
3079
3108
  /* #### Code section: module_state_clear ### */
3080
3109
  #if CYTHON_USE_MODULE_STATE
3081
3110
  static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
@@ -3103,7 +3132,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3103
3132
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
3104
3133
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3105
3134
  for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3106
- for (int i=0; i<132; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3135
+ for (int i=0; i<133; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3107
3136
  Py_CLEAR(clear_module_state->__pyx_int_0);
3108
3137
  Py_CLEAR(clear_module_state->__pyx_int_1);
3109
3138
  Py_CLEAR(clear_module_state->__pyx_int_3);
@@ -3134,7 +3163,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
3134
3163
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
3135
3164
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
3136
3165
  for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3137
- for (int i=0; i<132; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3166
+ for (int i=0; i<133; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3138
3167
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
3139
3168
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
3140
3169
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_3);
@@ -3306,7 +3335,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
3306
3335
  PyObject *__pyx_args, PyObject *__pyx_kwds
3307
3336
  #endif
3308
3337
  ); /*proto*/
3309
- PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_elevate_quadratic, "elevate_quadratic(double complex p0, double complex p1, double complex p2)\nGiven a quadratic bezier curve, return its degree-elevated cubic.");
3338
+ PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_elevate_quadratic, "elevate_quadratic(double complex p0, double complex p1, double complex p2)\n\nGiven a quadratic bezier curve, return its degree-elevated cubic.");
3310
3339
  static PyMethodDef __pyx_mdef_9fontTools_5qu2cu_5qu2cu_1elevate_quadratic = {"elevate_quadratic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_5qu2cu_5qu2cu_1elevate_quadratic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_5qu2cu_5qu2cu_elevate_quadratic};
3311
3340
  static PyObject *__pyx_pw_9fontTools_5qu2cu_5qu2cu_1elevate_quadratic(PyObject *__pyx_self,
3312
3341
  #if CYTHON_METH_FASTCALL
@@ -3620,7 +3649,7 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3620
3649
  *
3621
3650
  */
3622
3651
  __pyx_t_5 = (__pyx_v_start + __pyx_v_k);
3623
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
3652
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
3624
3653
  __Pyx_GOTREF(__pyx_t_1);
3625
3654
  __Pyx_XDECREF_SET(__pyx_v_ck, __pyx_t_1);
3626
3655
  __pyx_t_1 = 0;
@@ -3633,7 +3662,7 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3633
3662
  * # |t_(k+1) - t_k| / |t_k - t_(k - 1)| = ratio
3634
3663
  */
3635
3664
  __pyx_t_6 = ((__pyx_v_start + __pyx_v_k) - 1);
3636
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
3665
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
3637
3666
  __Pyx_GOTREF(__pyx_t_1);
3638
3667
  __Pyx_XDECREF_SET(__pyx_v_c_before, __pyx_t_1);
3639
3668
  __pyx_t_1 = 0;
@@ -3647,9 +3676,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3647
3676
  */
3648
3677
  #ifndef CYTHON_WITHOUT_ASSERTIONS
3649
3678
  if (unlikely(__pyx_assertions_enabled())) {
3650
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ck, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3679
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ck, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3651
3680
  __Pyx_GOTREF(__pyx_t_1);
3652
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_c_before, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
3681
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_c_before, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
3653
3682
  __Pyx_GOTREF(__pyx_t_7);
3654
3683
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 129, __pyx_L1_error)
3655
3684
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -3672,9 +3701,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3672
3701
  *
3673
3702
  * prod_ratio *= ratio
3674
3703
  */
3675
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ck, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
3704
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ck, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
3676
3705
  __Pyx_GOTREF(__pyx_t_8);
3677
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ck, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
3706
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ck, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
3678
3707
  __Pyx_GOTREF(__pyx_t_7);
3679
3708
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
3680
3709
  __Pyx_GOTREF(__pyx_t_1);
@@ -3683,9 +3712,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3683
3712
  __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
3684
3713
  __Pyx_GOTREF(__pyx_t_7);
3685
3714
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3686
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_c_before, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
3715
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_c_before, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
3687
3716
  __Pyx_GOTREF(__pyx_t_1);
3688
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_c_before, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
3717
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_c_before, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
3689
3718
  __Pyx_GOTREF(__pyx_t_8);
3690
3719
  __pyx_t_10 = PyNumber_Subtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error)
3691
3720
  __Pyx_GOTREF(__pyx_t_10);
@@ -3784,9 +3813,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3784
3813
  * p1 = curves[start][1]
3785
3814
  * p2 = curves[start + n - 1][2]
3786
3815
  */
3787
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_v_start, int, 1, __Pyx_PyLong_From_int, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error)
3816
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_v_start, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error)
3788
3817
  __Pyx_GOTREF(__pyx_t_10);
3789
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error)
3818
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error)
3790
3819
  __Pyx_GOTREF(__pyx_t_7);
3791
3820
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3792
3821
  __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
@@ -3800,9 +3829,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3800
3829
  * p2 = curves[start + n - 1][2]
3801
3830
  * p3 = curves[start + n - 1][3]
3802
3831
  */
3803
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_v_start, int, 1, __Pyx_PyLong_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
3832
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_v_start, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
3804
3833
  __Pyx_GOTREF(__pyx_t_7);
3805
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
3834
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
3806
3835
  __Pyx_GOTREF(__pyx_t_10);
3807
3836
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3808
3837
  __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
@@ -3817,9 +3846,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3817
3846
  *
3818
3847
  */
3819
3848
  __pyx_t_6 = ((__pyx_v_start + __pyx_v_n) - 1);
3820
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 142, __pyx_L1_error)
3849
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 142, __pyx_L1_error)
3821
3850
  __Pyx_GOTREF(__pyx_t_10);
3822
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
3851
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
3823
3852
  __Pyx_GOTREF(__pyx_t_7);
3824
3853
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3825
3854
  __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error)
@@ -3834,9 +3863,9 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3834
3863
  * # Build the curve by scaling the control-points.
3835
3864
  */
3836
3865
  __pyx_t_6 = ((__pyx_v_start + __pyx_v_n) - 1);
3837
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
3866
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_curves, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
3838
3867
  __Pyx_GOTREF(__pyx_t_7);
3839
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 143, __pyx_L1_error)
3868
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 143, __pyx_L1_error)
3840
3869
  __Pyx_GOTREF(__pyx_t_10);
3841
3870
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3842
3871
  __pyx_t_14 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
@@ -3858,7 +3887,7 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3858
3887
  __pyx_t_9 = (__Pyx_PyList_GET_SIZE(__pyx_v_ts) != 0);
3859
3888
  if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_9 < 0))) __PYX_ERR(0, 146, __pyx_L1_error)
3860
3889
  if (__pyx_t_9) {
3861
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3890
+ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3862
3891
  __Pyx_GOTREF(__pyx_t_1);
3863
3892
  __pyx_t_8 = __pyx_t_1;
3864
3893
  __pyx_t_1 = 0;
@@ -3893,7 +3922,7 @@ static PyObject *__pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(PyObject *__pyx_v
3893
3922
  __pyx_t_9 = (__Pyx_PyList_GET_SIZE(__pyx_v_ts) != 0);
3894
3923
  if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_9 < 0))) __PYX_ERR(0, 147, __pyx_L1_error)
3895
3924
  if (__pyx_t_9) {
3896
- __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_ts, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
3925
+ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_ts, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
3897
3926
  __Pyx_GOTREF(__pyx_t_7);
3898
3927
  __pyx_t_15 = __Pyx_PyLong_SubtractCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_7, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 147, __pyx_L1_error)
3899
3928
  __Pyx_GOTREF(__pyx_t_15);
@@ -4162,7 +4191,7 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_2add_implicit_on_curves(CYTHO
4162
4191
  * off2 = p[i + 1]
4163
4192
  * on = off1 + (off2 - off1) * 0.5
4164
4193
  */
4165
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
4194
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
4166
4195
  __Pyx_GOTREF(__pyx_t_1);
4167
4196
  __pyx_t_6 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error)
4168
4197
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -4176,7 +4205,7 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_2add_implicit_on_curves(CYTHO
4176
4205
  * q.insert(i + 1 + count, on)
4177
4206
  */
4178
4207
  __pyx_t_7 = (__pyx_v_i + 1);
4179
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, __pyx_t_7, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4208
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, __pyx_t_7, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4180
4209
  __Pyx_GOTREF(__pyx_t_1);
4181
4210
  __pyx_t_6 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
4182
4211
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -4261,7 +4290,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4261
4290
  PyObject *__pyx_args, PyObject *__pyx_kwds
4262
4291
  #endif
4263
4292
  ); /*proto*/
4264
- PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves, "quadratic_to_curves(list quads: List[List[Point]], double max_err: float = 0.5, all_cubic: bool = False) -> List[Tuple[Point, ...]]\nConverts a connecting list of quadratic splines to a list of quadratic\nand cubic curves.\n\nA quadratic spline is specified as a list of points. Either each point is\na 2-tuple of X,Y coordinates, or each point is a complex number with\nreal/imaginary components representing X,Y coordinates.\n\nThe first and last points are on-curve points and the rest are off-curve\npoints, with an implied on-curve point in the middle between every two\nconsequtive off-curve points.\n\nReturns:\n The output is a list of tuples of points. Points are represented\n in the same format as the input, either as 2-tuples or complex numbers.\n\n Each tuple is either of length three, for a quadratic curve, or four,\n for a cubic curve. Each curve's last point is the same as the next\n curve's first point.\n\nArgs:\n quads: quadratic splines\n\n max_err: absolute error tolerance; defaults to 0.5\n\n all_cubic: if True, only cubic curves are generated; defaults to False");
4293
+ PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves, "quadratic_to_curves(list quads: List[List[Point]], double max_err: float = 0.5, all_cubic: bool = False) -> List[Tuple[Point, ...]]\n\nConverts a connecting list of quadratic splines to a list of quadratic\nand cubic curves.\n\nA quadratic spline is specified as a list of points. Either each point is\na 2-tuple of X,Y coordinates, or each point is a complex number with\nreal/imaginary components representing X,Y coordinates.\n\nThe first and last points are on-curve points and the rest are off-curve\npoints, with an implied on-curve point in the middle between every two\nconsequtive off-curve points.\n\nReturns:\n The output is a list of tuples of points. Points are represented\n in the same format as the input, either as 2-tuples or complex numbers.\n\n Each tuple is either of length three, for a quadratic curve, or four,\n for a cubic curve. Each curve's last point is the same as the next\n curve's first point.\n\nArgs:\n quads: quadratic splines\n\n max_err: absolute error tolerance; defaults to 0.5\n\n all_cubic: if True, only cubic curves are generated; defaults to False");
4265
4294
  static PyMethodDef __pyx_mdef_9fontTools_5qu2cu_5qu2cu_5quadratic_to_curves = {"quadratic_to_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_5qu2cu_5qu2cu_5quadratic_to_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves};
4266
4295
  static PyObject *__pyx_pw_9fontTools_5qu2cu_5qu2cu_5quadratic_to_curves(PyObject *__pyx_self,
4267
4296
  #if CYTHON_METH_FASTCALL
@@ -4632,9 +4661,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves(CYTHON_U
4632
4661
  * if not is_complex:
4633
4662
  * quads = [[complex(x, y) for (x, y) in p] for p in quads]
4634
4663
  */
4635
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_quads, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
4664
+ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_quads, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
4636
4665
  __Pyx_GOTREF(__pyx_t_1);
4637
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
4666
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
4638
4667
  __Pyx_GOTREF(__pyx_t_2);
4639
4668
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4640
4669
  __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_t_2)) == ((PyObject *)(&PyComplex_Type)));
@@ -4838,9 +4867,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves(CYTHON_U
4838
4867
  * costs = [1]
4839
4868
  * cost = 1
4840
4869
  */
4841
- __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_quads, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
4870
+ __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_quads, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
4842
4871
  __Pyx_GOTREF(__pyx_t_2);
4843
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
4872
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
4844
4873
  __Pyx_GOTREF(__pyx_t_1);
4845
4874
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4846
4875
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
@@ -4908,9 +4937,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_4quadratic_to_curves(CYTHON_U
4908
4937
  */
4909
4938
  #ifndef CYTHON_WITHOUT_ASSERTIONS
4910
4939
  if (unlikely(__pyx_assertions_enabled())) {
4911
- __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_q, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
4940
+ __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_q, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
4912
4941
  __Pyx_GOTREF(__pyx_t_1);
4913
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
4942
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
4914
4943
  __Pyx_GOTREF(__pyx_t_5);
4915
4944
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error)
4916
4945
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -5261,7 +5290,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5261
5290
  PyObject *__pyx_args, PyObject *__pyx_kwds
5262
5291
  #endif
5263
5292
  ); /*proto*/
5264
- PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_6spline_to_curves, "spline_to_curves(q, costs, double tolerance=0.5, int all_cubic=False)\nq: quadratic spline with alternating on-curve / off-curve points.\n\ncosts: cumulative list of encoding cost of q in terms of number of\n points that need to be encoded. Implied on-curve points do not\n contribute to the cost. If all points need to be encoded, then\n costs will be range(1, len(q)+1).");
5293
+ PyDoc_STRVAR(__pyx_doc_9fontTools_5qu2cu_5qu2cu_6spline_to_curves, "spline_to_curves(q, costs, double tolerance=0.5, int all_cubic=False)\n\nq: quadratic spline with alternating on-curve / off-curve points.\n\ncosts: cumulative list of encoding cost of q in terms of number of\n points that need to be encoded. Implied on-curve points do not\n contribute to the cost. If all points need to be encoded, then\n costs will be range(1, len(q)+1).");
5265
5294
  static PyMethodDef __pyx_mdef_9fontTools_5qu2cu_5qu2cu_7spline_to_curves = {"spline_to_curves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_5qu2cu_5qu2cu_7spline_to_curves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_5qu2cu_5qu2cu_6spline_to_curves};
5266
5295
  static PyObject *__pyx_pw_9fontTools_5qu2cu_5qu2cu_7spline_to_curves(PyObject *__pyx_self,
5267
5296
  #if CYTHON_METH_FASTCALL
@@ -5800,9 +5829,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
5800
5829
  * p2 = elevated_quadratics[i][1]
5801
5830
  */
5802
5831
  __pyx_t_9 = (__pyx_v_i - 1);
5803
- __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
5832
+ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
5804
5833
  __Pyx_GOTREF(__pyx_t_3);
5805
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
5834
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
5806
5835
  __Pyx_GOTREF(__pyx_t_7);
5807
5836
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5808
5837
  __pyx_t_10 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
@@ -5816,9 +5845,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
5816
5845
  * p2 = elevated_quadratics[i][1]
5817
5846
  * if abs(p1 - p0) + abs(p2 - p1) > tolerance + abs(p2 - p0):
5818
5847
  */
5819
- __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
5848
+ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
5820
5849
  __Pyx_GOTREF(__pyx_t_7);
5821
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
5850
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
5822
5851
  __Pyx_GOTREF(__pyx_t_3);
5823
5852
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5824
5853
  __pyx_t_10 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error)
@@ -5832,9 +5861,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
5832
5861
  * if abs(p1 - p0) + abs(p2 - p1) > tolerance + abs(p2 - p0):
5833
5862
  * forced.add(i)
5834
5863
  */
5835
- __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
5864
+ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
5836
5865
  __Pyx_GOTREF(__pyx_t_3);
5837
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
5866
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
5838
5867
  __Pyx_GOTREF(__pyx_t_7);
5839
5868
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5840
5869
  __pyx_t_10 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
@@ -5981,14 +6010,14 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
5981
6010
  *
5982
6011
  * if not all_cubic:
5983
6012
  */
5984
- __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error)
6013
+ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error)
5985
6014
  __Pyx_GOTREF(__pyx_t_7);
5986
6015
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_num_points); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 299, __pyx_L1_error)
5987
6016
  __Pyx_GOTREF(__pyx_t_8);
5988
6017
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5989
6018
  __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
5990
6019
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5991
- __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 299, __pyx_L1_error)
6020
+ __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_j, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 299, __pyx_L1_error)
5992
6021
  __Pyx_GOTREF(__pyx_t_8);
5993
6022
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error)
5994
6023
  __Pyx_GOTREF(__pyx_t_7);
@@ -6016,10 +6045,10 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
6016
6045
  * i_sol_error = j_sol_error
6017
6046
  */
6018
6047
  __pyx_t_9 = ((2 * __pyx_v_i) - 1);
6019
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_costs, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
6048
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_costs, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
6020
6049
  __Pyx_GOTREF(__pyx_t_7);
6021
6050
  __pyx_t_9 = (2 * __pyx_v_j);
6022
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_costs, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error)
6051
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_costs, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error)
6023
6052
  __Pyx_GOTREF(__pyx_t_8);
6024
6053
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
6025
6054
  __Pyx_GOTREF(__pyx_t_6);
@@ -6436,7 +6465,7 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
6436
6465
  * error = max(error, err)
6437
6466
  */
6438
6467
  __pyx_t_26 = (__pyx_v_j + __pyx_v_k);
6439
- __pyx_t_18 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_26, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 327, __pyx_L1_error)
6468
+ __pyx_t_18 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_26, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 327, __pyx_L1_error)
6440
6469
  __Pyx_GOTREF(__pyx_t_18);
6441
6470
  __Pyx_XDECREF_SET(__pyx_v_orig, __pyx_t_18);
6442
6471
  __pyx_t_18 = 0;
@@ -6448,9 +6477,9 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
6448
6477
  * error = max(error, err)
6449
6478
  * if error > tolerance:
6450
6479
  */
6451
- __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_reconst, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 328, __pyx_L1_error)
6480
+ __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_reconst, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 328, __pyx_L1_error)
6452
6481
  __Pyx_GOTREF(__pyx_t_18);
6453
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_orig, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
6482
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_orig, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
6454
6483
  __Pyx_GOTREF(__pyx_t_7);
6455
6484
  __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_t_7); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 328, __pyx_L1_error)
6456
6485
  __Pyx_GOTREF(__pyx_t_19);
@@ -6595,7 +6624,7 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
6595
6624
  *
6596
6625
  */
6597
6626
  __pyx_t_26 = (__pyx_v_j + __pyx_v_k);
6598
- __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_26, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
6627
+ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_elevated_quadratics, __pyx_t_26, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
6599
6628
  __Pyx_GOTREF(__pyx_t_7);
6600
6629
  __Pyx_XDECREF_SET(__pyx_v_orig, __pyx_t_7);
6601
6630
  __pyx_t_7 = 0;
@@ -6972,14 +7001,14 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
6972
7001
  * splits.append(i)
6973
7002
  * cubic.append(is_cubic)
6974
7003
  */
6975
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
7004
+ __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
6976
7005
  __Pyx_GOTREF(__pyx_t_6);
6977
7006
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_start_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
6978
7007
  __Pyx_GOTREF(__pyx_t_8);
6979
7008
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6980
7009
  __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
6981
7010
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6982
- __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
7011
+ __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sols, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
6983
7012
  __Pyx_GOTREF(__pyx_t_8);
6984
7013
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_is_cubic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
6985
7014
  __Pyx_GOTREF(__pyx_t_6);
@@ -7162,7 +7191,7 @@ static PyObject *__pyx_pf_9fontTools_5qu2cu_5qu2cu_6spline_to_curves(CYTHON_UNUS
7162
7191
  */
7163
7192
  __pyx_t_18 = __pyx_f_9fontTools_5qu2cu_5qu2cu_merge_curves(__pyx_v_elevated_quadratics, __pyx_v_j, (__pyx_v_i - __pyx_v_j)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 377, __pyx_L1_error)
7164
7193
  __Pyx_GOTREF(__pyx_t_18);
7165
- __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 377, __pyx_L1_error)
7194
+ __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 377, __pyx_L1_error)
7166
7195
  __Pyx_GOTREF(__pyx_t_19);
7167
7196
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7168
7197
  __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_curves, __pyx_t_19); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error)
@@ -8359,6 +8388,13 @@ __Pyx_RefNannySetupContext("PyInit_qu2cu", 0);
8359
8388
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
8360
8389
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
8361
8390
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
8391
+ /*--- Initialize various global constants etc. ---*/
8392
+ if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8393
+ stringtab_initialized = 1;
8394
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8395
+ #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED)
8396
+ if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8397
+ #endif
8362
8398
  #ifdef __Pyx_CyFunction_USED
8363
8399
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8364
8400
  #endif
@@ -8375,10 +8411,6 @@ __Pyx_RefNannySetupContext("PyInit_qu2cu", 0);
8375
8411
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8376
8412
  #endif
8377
8413
  /*--- Library function declarations ---*/
8378
- /*--- Initialize various global constants etc. ---*/
8379
- if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8380
- stringtab_initialized = 1;
8381
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8382
8414
  if (__pyx_module_is_main_fontTools__qu2cu__qu2cu) {
8383
8415
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8384
8416
  }
@@ -8901,6 +8933,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
8901
8933
  {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */
8902
8934
  {__pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reversed */
8903
8935
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
8936
+ {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
8904
8937
  {__pyx_k_sols, sizeof(__pyx_k_sols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sols */
8905
8938
  {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */
8906
8939
  {__pyx_k_spline_to_curves, sizeof(__pyx_k_spline_to_curves), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spline_to_curves */
@@ -11608,24 +11641,83 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi
11608
11641
  }
11609
11642
  #endif
11610
11643
 
11644
+ /* LimitedApiGetTypeDict */
11645
+ #if CYTHON_COMPILING_IN_LIMITED_API
11646
+ static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
11647
+ PyObject *tp_dictoffset_o;
11648
+ Py_ssize_t tp_dictoffset;
11649
+ tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
11650
+ if (unlikely(!tp_dictoffset_o)) return -1;
11651
+ tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
11652
+ Py_DECREF(tp_dictoffset_o);
11653
+ if (unlikely(tp_dictoffset == 0)) {
11654
+ PyErr_SetString(
11655
+ PyExc_TypeError,
11656
+ "'type' doesn't have a dictoffset");
11657
+ return -1;
11658
+ } else if (unlikely(tp_dictoffset < 0)) {
11659
+ PyErr_SetString(
11660
+ PyExc_TypeError,
11661
+ "'type' has an unexpected negative dictoffset. "
11662
+ "Please report this as Cython bug");
11663
+ return -1;
11664
+ }
11665
+ return tp_dictoffset;
11666
+ }
11667
+ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
11668
+ static Py_ssize_t tp_dictoffset = 0;
11669
+ if (unlikely(tp_dictoffset == 0)) {
11670
+ tp_dictoffset = __Pyx_GetTypeDictOffset();
11671
+ if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
11672
+ tp_dictoffset = 0; // try again next time?
11673
+ return NULL;
11674
+ }
11675
+ }
11676
+ return *(PyObject**)((char*)tp + tp_dictoffset);
11677
+ }
11678
+ #endif
11679
+
11680
+ /* SetItemOnTypeDict */
11681
+ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
11682
+ int result;
11683
+ PyObject *tp_dict;
11684
+ #if CYTHON_COMPILING_IN_LIMITED_API
11685
+ tp_dict = __Pyx_GetTypeDict(tp);
11686
+ if (unlikely(!tp_dict)) return -1;
11687
+ #else
11688
+ tp_dict = tp->tp_dict;
11689
+ #endif
11690
+ result = PyDict_SetItem(tp_dict, k, v);
11691
+ if (likely(!result)) {
11692
+ PyType_Modified(tp);
11693
+ if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
11694
+ PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
11695
+ if (!setNameResult) return -1;
11696
+ Py_DECREF(setNameResult);
11697
+ }
11698
+ }
11699
+ return result;
11700
+ }
11701
+
11611
11702
  /* FixUpExtensionType */
11612
11703
  static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
11613
- #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
11704
+ #if __PYX_LIMITED_VERSION_HEX > 0x030900B1
11614
11705
  CYTHON_UNUSED_VAR(spec);
11615
11706
  CYTHON_UNUSED_VAR(type);
11707
+ CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
11616
11708
  #else
11617
11709
  const PyType_Slot *slot = spec->slots;
11710
+ int changed = 0;
11711
+ #if !CYTHON_COMPILING_IN_LIMITED_API
11618
11712
  while (slot && slot->slot && slot->slot != Py_tp_members)
11619
11713
  slot++;
11620
11714
  if (slot && slot->slot == Py_tp_members) {
11621
- int changed = 0;
11622
- #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
11715
+ #if !CYTHON_COMPILING_IN_CPYTHON
11623
11716
  const
11624
- #endif
11717
+ #endif // !CYTHON_COMPILING_IN_CPYTHON)
11625
11718
  PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
11626
11719
  while (memb && memb->name) {
11627
11720
  if (memb->name[0] == '_' && memb->name[1] == '_') {
11628
- #if PY_VERSION_HEX < 0x030900b1
11629
11721
  if (strcmp(memb->name, "__weaklistoffset__") == 0) {
11630
11722
  assert(memb->type == T_PYSSIZET);
11631
11723
  assert(memb->flags == READONLY);
@@ -11649,11 +11741,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
11649
11741
  #endif
11650
11742
  changed = 1;
11651
11743
  }
11652
- #endif
11653
- #else
11654
- if ((0));
11655
- #endif
11656
- #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
11744
+ #endif // CYTHON_METH_FASTCALL
11657
11745
  else if (strcmp(memb->name, "__module__") == 0) {
11658
11746
  PyObject *descr;
11659
11747
  assert(memb->type == T_OBJECT);
@@ -11661,21 +11749,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
11661
11749
  descr = PyDescr_NewMember(type, memb);
11662
11750
  if (unlikely(!descr))
11663
11751
  return -1;
11664
- if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
11665
- Py_DECREF(descr);
11752
+ int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
11753
+ Py_DECREF(descr);
11754
+ if (unlikely(set_item_result < 0)) {
11666
11755
  return -1;
11667
11756
  }
11668
- Py_DECREF(descr);
11669
11757
  changed = 1;
11670
11758
  }
11671
- #endif
11672
11759
  }
11673
11760
  memb++;
11674
11761
  }
11675
- if (changed)
11676
- PyType_Modified(type);
11677
11762
  }
11678
- #endif
11763
+ #endif // !CYTHON_COMPILING_IN_LIMITED_API
11764
+ slot = spec->slots;
11765
+ while (slot && slot->slot && slot->slot != Py_tp_getset)
11766
+ slot++;
11767
+ if (slot && slot->slot == Py_tp_getset) {
11768
+ PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
11769
+ while (getset && getset->name) {
11770
+ if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
11771
+ PyObject *descr = PyDescr_NewGetSet(type, getset);
11772
+ if (unlikely(!descr))
11773
+ return -1;
11774
+ #if CYTHON_COMPILING_IN_LIMITED_API
11775
+ PyObject *pyname = PyUnicode_FromString(getset->name);
11776
+ if (unlikely(!pyname)) {
11777
+ Py_DECREF(descr);
11778
+ return -1;
11779
+ }
11780
+ int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
11781
+ Py_DECREF(pyname);
11782
+ #else
11783
+ CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
11784
+ int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
11785
+ #endif
11786
+ Py_DECREF(descr);
11787
+ if (unlikely(set_item_result < 0)) {
11788
+ return -1;
11789
+ }
11790
+ changed = 1;
11791
+ }
11792
+ ++getset;
11793
+ }
11794
+ }
11795
+ if (changed)
11796
+ PyType_Modified(type);
11797
+ #endif // PY_VERSION_HEX > 0x030900B1
11679
11798
  return 0;
11680
11799
  }
11681
11800
 
@@ -12005,6 +12124,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
12005
12124
  }
12006
12125
 
12007
12126
  /* FetchCommonType */
12127
+ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000
12128
+ static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12129
+ PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
12130
+ if (result && metaclass) {
12131
+ PyObject *old_tp = (PyObject*)Py_TYPE(result);
12132
+ Py_INCREF((PyObject*)metaclass);
12133
+ #if __PYX_LIMITED_VERSION_HEX >= 0x03090000
12134
+ Py_SET_TYPE(result, metaclass);
12135
+ #else
12136
+ result->ob_type = metaclass;
12137
+ #endif
12138
+ Py_DECREF(old_tp);
12139
+ }
12140
+ return result;
12141
+ }
12142
+ #else
12143
+ #define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
12144
+ #endif
12008
12145
  static int __Pyx_VerifyCachedType(PyObject *cached_type,
12009
12146
  const char *name,
12010
12147
  Py_ssize_t expected_basicsize) {
@@ -12014,6 +12151,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
12014
12151
  "Shared Cython type %.200s is not a type object", name);
12015
12152
  return -1;
12016
12153
  }
12154
+ if (expected_basicsize == 0) {
12155
+ return 0; // size is inherited, nothing useful to check
12156
+ }
12017
12157
  #if CYTHON_COMPILING_IN_LIMITED_API
12018
12158
  PyObject *py_basicsize;
12019
12159
  py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
@@ -12033,7 +12173,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
12033
12173
  }
12034
12174
  return 0;
12035
12175
  }
12036
- static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
12176
+ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12037
12177
  PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
12038
12178
  int get_item_ref_result;
12039
12179
  const char* object_name = strrchr(spec->name, '.');
@@ -12057,7 +12197,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec
12057
12197
  goto bad;
12058
12198
  }
12059
12199
  CYTHON_UNUSED_VAR(module);
12060
- cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
12200
+ cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases);
12061
12201
  if (unlikely(!cached_type)) goto bad;
12062
12202
  if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
12063
12203
  new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
@@ -12086,6 +12226,42 @@ bad:
12086
12226
  goto done;
12087
12227
  }
12088
12228
 
12229
+ /* CommonTypesMetaclass */
12230
+ PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
12231
+ return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
12232
+ }
12233
+ static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
12234
+ {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
12235
+ {0, 0, 0, 0, 0}
12236
+ };
12237
+ static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
12238
+ {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
12239
+ {0, 0}
12240
+ };
12241
+ static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
12242
+ __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
12243
+ 0,
12244
+ 0,
12245
+ #if PY_VERSION_HEX >= 0x030A0000
12246
+ Py_TPFLAGS_IMMUTABLETYPE |
12247
+ Py_TPFLAGS_DISALLOW_INSTANTIATION |
12248
+ #endif
12249
+ Py_TPFLAGS_DEFAULT,
12250
+ __pyx_CommonTypesMetaclass_slots
12251
+ };
12252
+ static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
12253
+ __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
12254
+ PyObject *bases = PyTuple_Pack(1, &PyType_Type);
12255
+ if (unlikely(!bases)) {
12256
+ return -1;
12257
+ }
12258
+ mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
12259
+ if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
12260
+ return -1;
12261
+ }
12262
+ return 0;
12263
+ }
12264
+
12089
12265
  /* PyMethodNew */
12090
12266
  #if CYTHON_COMPILING_IN_LIMITED_API
12091
12267
  static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
@@ -13183,7 +13359,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = {
13183
13359
  };
13184
13360
  static int __pyx_CyFunction_init(PyObject *module) {
13185
13361
  __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
13186
- mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
13362
+ mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
13363
+ mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
13187
13364
  if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
13188
13365
  return -1;
13189
13366
  }
@@ -15698,6 +15875,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods
15698
15875
  type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
15699
15876
  }
15700
15877
  #endif
15878
+ static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
15879
+ CYTHON_UNUSED_VAR(arg);
15880
+ __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
15881
+ PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
15882
+ self_type_name);
15883
+ __Pyx_DECREF_TypeName(self_type_name);
15884
+ return NULL;
15885
+ }
15701
15886
 
15702
15887
  /* Generator */
15703
15888
  static PyMethodDef __pyx_Generator_methods[] = {
@@ -15707,6 +15892,8 @@ static PyMethodDef __pyx_Generator_methods[] = {
15707
15892
  PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
15708
15893
  {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
15709
15894
  PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
15895
+ {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
15896
+ {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
15710
15897
  {0, 0, 0, 0}
15711
15898
  };
15712
15899
  static PyMemberDef __pyx_Generator_memberlist[] = {
@@ -15759,7 +15946,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
15759
15946
  #endif
15760
15947
  static int __pyx_Generator_init(PyObject *module) {
15761
15948
  __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
15762
- mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
15949
+ mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
15950
+ mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
15763
15951
  if (unlikely(!mstate->__pyx_GeneratorType)) {
15764
15952
  return -1;
15765
15953
  }