fonttools 4.58.0__cp313-cp313-macosx_10_13_universal2.whl → 4.58.2__cp313-cp313-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.

Files changed (38) hide show
  1. fontTools/__init__.py +1 -1
  2. fontTools/cffLib/specializer.py +4 -1
  3. fontTools/cu2qu/cu2qu.c +36 -24
  4. fontTools/cu2qu/cu2qu.cpython-313-darwin.so +0 -0
  5. fontTools/feaLib/ast.py +1 -72
  6. fontTools/feaLib/builder.py +55 -45
  7. fontTools/feaLib/lexer.c +60 -43
  8. fontTools/feaLib/lexer.cpython-313-darwin.so +0 -0
  9. fontTools/merge/cmap.py +33 -1
  10. fontTools/merge/tables.py +12 -1
  11. fontTools/misc/bezierTools.c +137 -125
  12. fontTools/misc/bezierTools.cpython-313-darwin.so +0 -0
  13. fontTools/misc/loggingTools.py +1 -1
  14. fontTools/misc/symfont.py +6 -8
  15. fontTools/mtiLib/__init__.py +1 -1
  16. fontTools/otlLib/builder.py +164 -0
  17. fontTools/pens/momentsPen.c +42 -25
  18. fontTools/pens/momentsPen.cpython-313-darwin.so +0 -0
  19. fontTools/pens/t2CharStringPen.py +31 -11
  20. fontTools/qu2cu/qu2cu.c +47 -35
  21. fontTools/qu2cu/qu2cu.cpython-313-darwin.so +0 -0
  22. fontTools/subset/__init__.py +82 -2
  23. fontTools/ttLib/reorderGlyphs.py +8 -7
  24. fontTools/ufoLib/__init__.py +1 -1
  25. fontTools/varLib/__init__.py +18 -6
  26. fontTools/varLib/featureVars.py +13 -7
  27. fontTools/varLib/hvar.py +1 -1
  28. fontTools/varLib/instancer/__init__.py +14 -5
  29. fontTools/varLib/iup.c +52 -40
  30. fontTools/varLib/iup.cpython-313-darwin.so +0 -0
  31. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/METADATA +26 -1
  32. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/RECORD +38 -38
  33. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/WHEEL +1 -1
  34. {fonttools-4.58.0.data → fonttools-4.58.2.data}/data/share/man/man1/ttx.1 +0 -0
  35. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/entry_points.txt +0 -0
  36. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/licenses/LICENSE +0 -0
  37. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/licenses/LICENSE.external +0 -0
  38. {fonttools-4.58.0.dist-info → fonttools-4.58.2.dist-info}/top_level.txt +0 -0
fontTools/feaLib/lexer.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.0 */
1
+ /* Generated by Cython 3.1.1 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -26,8 +26,8 @@ END: Cython Metadata */
26
26
  #elif PY_VERSION_HEX < 0x03080000
27
27
  #error Cython requires Python 3.8+.
28
28
  #else
29
- #define __PYX_ABI_VERSION "3_1_0"
30
- #define CYTHON_HEX_VERSION 0x030100F0
29
+ #define __PYX_ABI_VERSION "3_1_1"
30
+ #define CYTHON_HEX_VERSION 0x030101F0
31
31
  #define CYTHON_FUTURE_DIVISION 1
32
32
  /* CModulePreamble */
33
33
  #include <stddef.h>
@@ -1797,12 +1797,19 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *
1797
1797
  static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1798
1798
  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1799
1799
 
1800
+ /* PyObjectDelAttr.proto */
1801
+ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
1802
+ #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
1803
+ #else
1804
+ #define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
1805
+ #endif
1806
+
1800
1807
  /* PyObjectSetAttrStr.proto */
1801
1808
  #if CYTHON_USE_TYPE_SLOTS
1802
1809
  #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1803
1810
  static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1804
1811
  #else
1805
- #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1812
+ #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
1806
1813
  #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1807
1814
  #endif
1808
1815
 
@@ -10795,8 +10802,8 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
10795
10802
  } __Pyx_PyCode_New_function_description;
10796
10803
  /* NewCodeObj.proto */
10797
10804
  static PyObject* __Pyx_PyCode_New(
10798
- __Pyx_PyCode_New_function_description descr,
10799
- PyObject **varnames,
10805
+ const __Pyx_PyCode_New_function_description descr,
10806
+ PyObject * const *varnames,
10800
10807
  PyObject *filename,
10801
10808
  PyObject *funcname,
10802
10809
  const char *line_table,
@@ -10808,83 +10815,83 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
10808
10815
  PyObject* tuple_dedup_map = PyDict_New();
10809
10816
  if (unlikely(!tuple_dedup_map)) return -1;
10810
10817
  {
10811
- __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43, 58};
10812
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_text, __pyx_mstate->__pyx_n_u_filename};
10818
+ const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43, 58};
10819
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_text, __pyx_mstate->__pyx_n_u_filename};
10813
10820
  __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_M_IQ_HA_O1_IQ_Cq_IU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
10814
10821
  }
10815
10822
  {
10816
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 52, 7};
10817
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self};
10823
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 52, 7};
10824
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
10818
10825
  __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_iter, __pyx_k_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
10819
10826
  }
10820
10827
  {
10821
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 55, 11};
10822
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self};
10828
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 55, 11};
10829
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
10823
10830
  __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next_3, __pyx_k_A_t9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
10824
10831
  }
10825
10832
  {
10826
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 58, 38};
10827
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token_type, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_location_2};
10833
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 58, 38};
10834
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token_type, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_location_2};
10828
10835
  __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next, __pyx_k_A_fA_U_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
10829
10836
  }
10830
10837
  {
10831
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 41};
10832
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column};
10838
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 41};
10839
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column};
10833
10840
  __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_location, __pyx_k_A_V2T_b_k_N_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
10834
10841
  }
10835
10842
  {
10836
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 68, 1121};
10837
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_text, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_cur_char, __pyx_mstate->__pyx_n_u_next_char, __pyx_mstate->__pyx_n_u_glyphclass, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_string};
10843
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 68, 1121};
10844
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_text, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_cur_char, __pyx_mstate->__pyx_n_u_next_char, __pyx_mstate->__pyx_n_u_glyphclass, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_string};
10838
10845
  __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next_2, __pyx_k_A_Kq_Q_4z_A_t1_1A_6_A_q_4q_D_r_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
10839
10846
  }
10840
10847
  {
10841
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 165, 46};
10842
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_valid, __pyx_mstate->__pyx_n_u_p};
10848
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 165, 46};
10849
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_valid, __pyx_mstate->__pyx_n_u_p};
10843
10850
  __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_scan_over, __pyx_k_A_D_b_nD_F_3c_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
10844
10851
  }
10845
10852
  {
10846
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 171, 46};
10847
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stop_at, __pyx_mstate->__pyx_n_u_p};
10853
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 171, 46};
10854
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stop_at, __pyx_mstate->__pyx_n_u_p};
10848
10855
  __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_scan_until, __pyx_k_A_D_b_nD_F_3gQ_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
10849
10856
  }
10850
10857
  {
10851
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 177, 140};
10852
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_regexp, __pyx_mstate->__pyx_n_u_split};
10858
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 177, 140};
10859
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_regexp, __pyx_mstate->__pyx_n_u_split};
10853
10860
  __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_scan_anonymous_block, __pyx_k_A_4z_c_q_L_a_Kq_Q_4r_V1D_1_3awc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
10854
10861
  }
10855
10862
  {
10856
- __Pyx_PyCode_New_function_description descr = {2, 0, 1, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 207, 45};
10857
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_featurefile, __pyx_mstate->__pyx_n_u_includeDir};
10863
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 1, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 207, 45};
10864
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_featurefile, __pyx_mstate->__pyx_n_u_includeDir};
10858
10865
  __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Kq_L_t81Ba_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
10859
10866
  }
10860
10867
  {
10861
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 221, 7};
10862
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self};
10868
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 221, 7};
10869
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
10863
10870
  __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_iter, __pyx_k_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
10864
10871
  }
10865
10872
  {
10866
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 224, 11};
10867
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self};
10873
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 224, 11};
10874
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
10868
10875
  __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next_3, __pyx_k_A_t9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
10869
10876
  }
10870
10877
  {
10871
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 227, 283};
10872
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lexer, __pyx_mstate->__pyx_n_u_token_type, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_fname_type, __pyx_mstate->__pyx_n_u_fname_token, __pyx_mstate->__pyx_n_u_fname_location, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_curpath, __pyx_mstate->__pyx_n_u_err};
10878
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 227, 283};
10879
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lexer, __pyx_mstate->__pyx_n_u_token_type, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_location_2, __pyx_mstate->__pyx_n_u_fname_type, __pyx_mstate->__pyx_n_u_fname_token, __pyx_mstate->__pyx_n_u_fname_location, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_curpath, __pyx_mstate->__pyx_n_u_err};
10873
10880
  __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next, __pyx_k_A_d_D_G_d_1_HD_U_F_Q_M_uA_gU_2U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
10874
10881
  }
10875
10882
  {
10876
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266, 91};
10877
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_file_or_path, __pyx_mstate->__pyx_n_u_fileobj, __pyx_mstate->__pyx_n_u_closing, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_data};
10883
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266, 91};
10884
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_file_or_path, __pyx_mstate->__pyx_n_u_fileobj, __pyx_mstate->__pyx_n_u_closing, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_data};
10878
10885
  __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_make_lexer, __pyx_k_A_7_Z_Q_j_a_d_U_1_we1_7_9HA_1_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
10879
10886
  }
10880
10887
  {
10881
- __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279, 20};
10882
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag};
10888
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279, 20};
10889
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tag};
10883
10890
  __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_scan_anonymous_block, __pyx_k_A_t82R_4AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
10884
10891
  }
10885
10892
  {
10886
- __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286, 17};
10887
- PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self};
10893
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286, 17};
10894
+ PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
10888
10895
  __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_feaLib_lexer_py, __pyx_mstate->__pyx_n_u_next, __pyx_k_A_t1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
10889
10896
  }
10890
10897
  Py_DECREF(tuple_dedup_map);
@@ -11604,6 +11611,11 @@ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *
11604
11611
  Py_DECREF(selfless_args);
11605
11612
  return result;
11606
11613
  }
11614
+ #elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
11615
+ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
11616
+ return _PyObject_Vectorcall
11617
+ (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
11618
+ }
11607
11619
  #else
11608
11620
  static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
11609
11621
  return
@@ -11927,7 +11939,9 @@ static int __Pyx_ParseKeywordDict(
11927
11939
  PyObject** const *name;
11928
11940
  PyObject** const *first_kw_arg = argnames + num_pos_args;
11929
11941
  Py_ssize_t extracted = 0;
11942
+ #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
11930
11943
  if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
11944
+ #endif
11931
11945
  name = first_kw_arg;
11932
11946
  while (*name && num_kwargs > extracted) {
11933
11947
  PyObject * key = **name;
@@ -11975,7 +11989,9 @@ static int __Pyx_ParseKeywordDictToDict(
11975
11989
  PyObject** const *name;
11976
11990
  PyObject** const *first_kw_arg = argnames + num_pos_args;
11977
11991
  Py_ssize_t len;
11992
+ #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
11978
11993
  if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
11994
+ #endif
11979
11995
  if (PyDict_Update(kwds2, kwds) < 0) goto bad;
11980
11996
  name = first_kw_arg;
11981
11997
  while (*name) {
@@ -13618,7 +13634,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
13618
13634
  if (unlikely(!empty_dict))
13619
13635
  goto bad;
13620
13636
  if (level == -1) {
13621
- if (strchr(__Pyx_MODULE_NAME, '.') != (0)) {
13637
+ const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
13638
+ if (package_sep != (0)) {
13622
13639
  module = PyImport_ImportModuleLevelObject(
13623
13640
  name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
13624
13641
  if (unlikely(!module)) {
@@ -15664,7 +15681,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
15664
15681
  return PyLong_FromLong((long) value);
15665
15682
  } else if (sizeof(long) <= sizeof(unsigned long)) {
15666
15683
  return PyLong_FromUnsignedLong((unsigned long) value);
15667
- #ifdef HAVE_LONG_LONG
15684
+ #if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
15668
15685
  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
15669
15686
  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
15670
15687
  #endif
@@ -16498,9 +16515,9 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
16498
16515
  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
16499
16516
  #endif
16500
16517
  static PyObject* __Pyx_PyCode_New(
16501
- __Pyx_PyCode_New_function_description descr,
16502
- PyObject **varnames,
16503
- PyObject* filename,
16518
+ const __Pyx_PyCode_New_function_description descr,
16519
+ PyObject * const *varnames,
16520
+ PyObject *filename,
16504
16521
  PyObject *funcname,
16505
16522
  const char *line_table,
16506
16523
  PyObject *tuple_dedup_map
fontTools/merge/cmap.py CHANGED
@@ -54,6 +54,28 @@ def _glyphsAreSame(
54
54
  return True
55
55
 
56
56
 
57
+ def computeMegaUvs(merger, uvsTables):
58
+ """Returns merged UVS subtable (cmap format=14)."""
59
+ uvsDict = {}
60
+ cmap = merger.cmap
61
+ for table in uvsTables:
62
+ for variationSelector, uvsMapping in table.uvsDict.items():
63
+ if variationSelector not in uvsDict:
64
+ uvsDict[variationSelector] = {}
65
+ for unicodeValue, glyphName in uvsMapping:
66
+ if cmap.get(unicodeValue) == glyphName:
67
+ # this is a default variation
68
+ glyphName = None
69
+ # prefer previous glyph id if both fonts defined UVS
70
+ if unicodeValue not in uvsDict[variationSelector]:
71
+ uvsDict[variationSelector][unicodeValue] = glyphName
72
+
73
+ for variationSelector in uvsDict:
74
+ uvsDict[variationSelector] = [*uvsDict[variationSelector].items()]
75
+
76
+ return uvsDict
77
+
78
+
57
79
  # Valid (format, platformID, platEncID) triplets for cmap subtables containing
58
80
  # Unicode BMP-only and Unicode Full Repertoire semantics.
59
81
  # Cf. OpenType spec for "Platform specific encodings":
@@ -61,24 +83,29 @@ def _glyphsAreSame(
61
83
  class _CmapUnicodePlatEncodings:
62
84
  BMP = {(4, 3, 1), (4, 0, 3), (4, 0, 4), (4, 0, 6)}
63
85
  FullRepertoire = {(12, 3, 10), (12, 0, 4), (12, 0, 6)}
86
+ UVS = {(14, 0, 5)}
64
87
 
65
88
 
66
89
  def computeMegaCmap(merger, cmapTables):
67
- """Sets merger.cmap and merger.glyphOrder."""
90
+ """Sets merger.cmap and merger.uvsDict."""
68
91
 
69
92
  # TODO Handle format=14.
70
93
  # Only merge format 4 and 12 Unicode subtables, ignores all other subtables
71
94
  # If there is a format 12 table for a font, ignore the format 4 table of it
72
95
  chosenCmapTables = []
96
+ chosenUvsTables = []
73
97
  for fontIdx, table in enumerate(cmapTables):
74
98
  format4 = None
75
99
  format12 = None
100
+ format14 = None
76
101
  for subtable in table.tables:
77
102
  properties = (subtable.format, subtable.platformID, subtable.platEncID)
78
103
  if properties in _CmapUnicodePlatEncodings.BMP:
79
104
  format4 = subtable
80
105
  elif properties in _CmapUnicodePlatEncodings.FullRepertoire:
81
106
  format12 = subtable
107
+ elif properties in _CmapUnicodePlatEncodings.UVS:
108
+ format14 = subtable
82
109
  else:
83
110
  log.warning(
84
111
  "Dropped cmap subtable from font '%s':\t"
@@ -93,6 +120,9 @@ def computeMegaCmap(merger, cmapTables):
93
120
  elif format4 is not None:
94
121
  chosenCmapTables.append((format4, fontIdx))
95
122
 
123
+ if format14 is not None:
124
+ chosenUvsTables.append(format14)
125
+
96
126
  # Build the unicode mapping
97
127
  merger.cmap = cmap = {}
98
128
  fontIndexForGlyph = {}
@@ -127,6 +157,8 @@ def computeMegaCmap(merger, cmapTables):
127
157
  "Dropped mapping from codepoint %#06X to glyphId '%s'", uni, gid
128
158
  )
129
159
 
160
+ merger.uvsDict = computeMegaUvs(merger, chosenUvsTables)
161
+
130
162
 
131
163
  def renameCFFCharStrings(merger, glyphOrder, cffTable):
132
164
  """Rename topDictIndex charStrings based on glyphOrder."""
fontTools/merge/tables.py CHANGED
@@ -312,7 +312,6 @@ def merge(self, m, tables):
312
312
 
313
313
  @add_method(ttLib.getTableClass("cmap"))
314
314
  def merge(self, m, tables):
315
- # TODO Handle format=14.
316
315
  if not hasattr(m, "cmap"):
317
316
  computeMegaCmap(m, tables)
318
317
  cmap = m.cmap
@@ -336,6 +335,18 @@ def merge(self, m, tables):
336
335
  cmapTable.cmap = cmapBmpOnly
337
336
  # ordered by platform then encoding
338
337
  self.tables.insert(0, cmapTable)
338
+
339
+ uvsDict = m.uvsDict
340
+ if uvsDict:
341
+ # format-14
342
+ uvsTable = module.cmap_classes[14](14)
343
+ uvsTable.platformID = 0
344
+ uvsTable.platEncID = 5
345
+ uvsTable.language = 0
346
+ uvsTable.cmap = {}
347
+ uvsTable.uvsDict = uvsDict
348
+ # ordered by platform then encoding
349
+ self.tables.insert(0, uvsTable)
339
350
  self.tableVersion = 0
340
351
  self.numSubTables = len(self.tables)
341
352
  return self