fonttools 4.55.1__cp38-cp38-musllinux_1_2_x86_64.whl → 4.55.6__cp38-cp38-musllinux_1_2_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.

Files changed (100) hide show
  1. fontTools/__init__.py +1 -1
  2. fontTools/designspaceLib/__init__.py +1 -1
  3. fontTools/feaLib/ast.py +2 -2
  4. fontTools/feaLib/builder.py +45 -27
  5. fontTools/misc/bezierTools.c +3256 -2972
  6. fontTools/misc/bezierTools.cpython-38-x86_64-linux-gnu.so +0 -0
  7. fontTools/misc/bezierTools.py +8 -1
  8. fontTools/misc/transform.py +13 -15
  9. fontTools/otlLib/builder.py +17 -0
  10. fontTools/pens/statisticsPen.py +5 -0
  11. fontTools/ttLib/tables/B_A_S_E_.py +9 -0
  12. fontTools/ttLib/tables/C_B_D_T_.py +10 -0
  13. fontTools/ttLib/tables/C_B_L_C_.py +10 -0
  14. fontTools/ttLib/tables/C_F_F_.py +15 -0
  15. fontTools/ttLib/tables/C_F_F__2.py +13 -0
  16. fontTools/ttLib/tables/C_O_L_R_.py +9 -1
  17. fontTools/ttLib/tables/C_P_A_L_.py +9 -0
  18. fontTools/ttLib/tables/D_S_I_G_.py +7 -0
  19. fontTools/ttLib/tables/E_B_D_T_.py +8 -0
  20. fontTools/ttLib/tables/E_B_L_C_.py +8 -0
  21. fontTools/ttLib/tables/F_F_T_M_.py +10 -0
  22. fontTools/ttLib/tables/F__e_a_t.py +7 -2
  23. fontTools/ttLib/tables/G_D_E_F_.py +8 -0
  24. fontTools/ttLib/tables/G_M_A_P_.py +7 -0
  25. fontTools/ttLib/tables/G_P_K_G_.py +7 -0
  26. fontTools/ttLib/tables/G_P_O_S_.py +9 -0
  27. fontTools/ttLib/tables/G_S_U_B_.py +8 -0
  28. fontTools/ttLib/tables/G__l_a_t.py +3 -2
  29. fontTools/ttLib/tables/G__l_o_c.py +3 -2
  30. fontTools/ttLib/tables/H_V_A_R_.py +8 -0
  31. fontTools/ttLib/tables/J_S_T_F_.py +8 -0
  32. fontTools/ttLib/tables/L_T_S_H_.py +10 -0
  33. fontTools/ttLib/tables/M_A_T_H_.py +8 -0
  34. fontTools/ttLib/tables/M_E_T_A_.py +7 -0
  35. fontTools/ttLib/tables/M_V_A_R_.py +8 -0
  36. fontTools/ttLib/tables/O_S_2f_2.py +8 -1
  37. fontTools/ttLib/tables/S_I_N_G_.py +7 -0
  38. fontTools/ttLib/tables/S_T_A_T_.py +10 -0
  39. fontTools/ttLib/tables/S_V_G_.py +8 -0
  40. fontTools/ttLib/tables/S__i_l_f.py +4 -1
  41. fontTools/ttLib/tables/S__i_l_l.py +5 -0
  42. fontTools/ttLib/tables/T_S_I_B_.py +8 -0
  43. fontTools/ttLib/tables/T_S_I_C_.py +9 -0
  44. fontTools/ttLib/tables/T_S_I_D_.py +8 -0
  45. fontTools/ttLib/tables/T_S_I_J_.py +8 -0
  46. fontTools/ttLib/tables/T_S_I_P_.py +8 -0
  47. fontTools/ttLib/tables/T_S_I_S_.py +8 -0
  48. fontTools/ttLib/tables/T_S_I_V_.py +6 -0
  49. fontTools/ttLib/tables/T_S_I__0.py +2 -0
  50. fontTools/ttLib/tables/T_S_I__1.py +2 -0
  51. fontTools/ttLib/tables/T_S_I__2.py +2 -0
  52. fontTools/ttLib/tables/T_S_I__3.py +2 -0
  53. fontTools/ttLib/tables/T_S_I__5.py +2 -0
  54. fontTools/ttLib/tables/T_T_F_A_.py +9 -0
  55. fontTools/ttLib/tables/V_A_R_C_.py +7 -0
  56. fontTools/ttLib/tables/V_D_M_X_.py +8 -0
  57. fontTools/ttLib/tables/V_O_R_G_.py +8 -1
  58. fontTools/ttLib/tables/V_V_A_R_.py +8 -0
  59. fontTools/ttLib/tables/_a_n_k_r.py +3 -2
  60. fontTools/ttLib/tables/_a_v_a_r.py +3 -1
  61. fontTools/ttLib/tables/_b_s_l_n.py +9 -0
  62. fontTools/ttLib/tables/_c_i_d_g.py +7 -2
  63. fontTools/ttLib/tables/_c_m_a_p.py +2 -0
  64. fontTools/ttLib/tables/_c_v_a_r.py +8 -0
  65. fontTools/ttLib/tables/_c_v_t.py +8 -0
  66. fontTools/ttLib/tables/_f_e_a_t.py +7 -4
  67. fontTools/ttLib/tables/_f_p_g_m.py +11 -0
  68. fontTools/ttLib/tables/_f_v_a_r.py +8 -0
  69. fontTools/ttLib/tables/_g_a_s_p.py +8 -0
  70. fontTools/ttLib/tables/_g_c_i_d.py +7 -0
  71. fontTools/ttLib/tables/_g_l_y_f.py +31 -7
  72. fontTools/ttLib/tables/_g_v_a_r.py +11 -3
  73. fontTools/ttLib/tables/_h_d_m_x.py +8 -0
  74. fontTools/ttLib/tables/_h_e_a_d.py +7 -0
  75. fontTools/ttLib/tables/_h_h_e_a.py +12 -0
  76. fontTools/ttLib/tables/_h_m_t_x.py +9 -0
  77. fontTools/ttLib/tables/_k_e_r_n.py +11 -0
  78. fontTools/ttLib/tables/_l_c_a_r.py +8 -0
  79. fontTools/ttLib/tables/_l_o_c_a.py +8 -0
  80. fontTools/ttLib/tables/_l_t_a_g.py +8 -0
  81. fontTools/ttLib/tables/_m_a_x_p.py +8 -0
  82. fontTools/ttLib/tables/_m_e_t_a.py +8 -0
  83. fontTools/ttLib/tables/_m_o_r_t.py +8 -0
  84. fontTools/ttLib/tables/_m_o_r_x.py +9 -0
  85. fontTools/ttLib/tables/_n_a_m_e.py +15 -13
  86. fontTools/ttLib/tables/_o_p_b_d.py +8 -0
  87. fontTools/ttLib/tables/_p_o_s_t.py +9 -0
  88. fontTools/ttLib/tables/_p_r_e_p.py +9 -0
  89. fontTools/ttLib/tables/_p_r_o_p.py +6 -0
  90. fontTools/ttLib/tables/_s_b_i_x.py +10 -0
  91. fontTools/ttLib/tables/_t_r_a_k.py +7 -0
  92. fontTools/ttLib/tables/_v_h_e_a.py +12 -0
  93. fontTools/ttLib/tables/_v_m_t_x.py +9 -0
  94. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/METADATA +32 -2
  95. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/RECORD +288 -288
  96. {fonttools-4.55.1.data → fonttools-4.55.6.data}/data/share/man/man1/ttx.1 +0 -0
  97. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/LICENSE +0 -0
  98. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/WHEEL +0 -0
  99. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/entry_points.txt +0 -0
  100. {fonttools-4.55.1.dist-info → fonttools-4.55.6.dist-info}/top_level.txt +0 -0
fontTools/__init__.py CHANGED
@@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger
3
3
 
4
4
  log = logging.getLogger(__name__)
5
5
 
6
- version = __version__ = "4.55.1"
6
+ version = __version__ = "4.55.6"
7
7
 
8
8
  __all__ = ["version", "log", "configLogger"]
@@ -1596,7 +1596,7 @@ class BaseDocWriter(object):
1596
1596
  mapElement.attrib["input"] = self.intOrFloat(inputValue)
1597
1597
  mapElement.attrib["output"] = self.intOrFloat(outputValue)
1598
1598
  axisElement.append(mapElement)
1599
- if axisObject.axisOrdering or axisObject.axisLabels:
1599
+ if axisObject.axisOrdering is not None or axisObject.axisLabels:
1600
1600
  labelsElement = ET.Element("labels")
1601
1601
  if axisObject.axisOrdering is not None:
1602
1602
  labelsElement.attrib["ordering"] = str(axisObject.axisOrdering)
fontTools/feaLib/ast.py CHANGED
@@ -595,8 +595,8 @@ class MarkClassDefinition(Statement):
595
595
  class AlternateSubstStatement(Statement):
596
596
  """A ``sub ... from ...`` statement.
597
597
 
598
- ``prefix``, ``glyph``, ``suffix`` and ``replacement`` should be lists of
599
- `glyph-containing objects`_. ``glyph`` should be a `one element list`."""
598
+ ``glyph`` and ``replacement`` should be `glyph-containing objects`_.
599
+ ``prefix`` and ``suffix`` should be lists of `glyph-containing objects`_."""
600
600
 
601
601
  def __init__(self, prefix, glyph, suffix, replacement, location=None):
602
602
  Statement.__init__(self, location)
@@ -1106,7 +1106,13 @@ class Builder(object):
1106
1106
  if (language == "dflt" or include_default) and lookups:
1107
1107
  self.features_[key] = lookups[:]
1108
1108
  else:
1109
- self.features_[key] = []
1109
+ # if we aren't including default we need to manually remove the
1110
+ # default lookups, which were added to all declared langsystems
1111
+ # as they were encountered (we don't remove all lookups because
1112
+ # we want to allow duplicate script/lang statements;
1113
+ # see https://github.com/fonttools/fonttools/issues/3748
1114
+ cur_lookups = self.features_.get(key, [])
1115
+ self.features_[key] = [x for x in cur_lookups if x not in lookups]
1110
1116
  self.language_systems = frozenset([(self.script_, language)])
1111
1117
 
1112
1118
  if required:
@@ -1328,9 +1334,10 @@ class Builder(object):
1328
1334
  self, location, prefix, glyphs, suffix, replacement, forceChain
1329
1335
  ):
1330
1336
  if prefix or suffix or forceChain:
1331
- chain = self.get_lookup_(location, ChainContextSubstBuilder)
1332
- lookup = self.get_chained_lookup_(location, LigatureSubstBuilder)
1333
- chain.rules.append(ChainContextualRule(prefix, glyphs, suffix, [lookup]))
1337
+ self.add_ligature_subst_chained_(
1338
+ location, prefix, glyphs, suffix, replacement
1339
+ )
1340
+ return
1334
1341
  else:
1335
1342
  lookup = self.get_lookup_(location, LigatureSubstBuilder)
1336
1343
 
@@ -1387,6 +1394,24 @@ class Builder(object):
1387
1394
  sub.mapping[glyph] = replacements
1388
1395
  chain.rules.append(ChainContextualRule(prefix, [{glyph}], suffix, [sub]))
1389
1396
 
1397
+ def add_ligature_subst_chained_(
1398
+ self, location, prefix, glyphs, suffix, replacement
1399
+ ):
1400
+ # https://github.com/fonttools/fonttools/issues/3701
1401
+ if not all(prefix) or not all(suffix):
1402
+ raise FeatureLibError(
1403
+ "Empty glyph class in contextual substitution", location
1404
+ )
1405
+ chain = self.get_lookup_(location, ChainContextSubstBuilder)
1406
+ sub = chain.find_chainable_ligature_subst(glyphs, replacement)
1407
+ if sub is None:
1408
+ sub = self.get_chained_lookup_(location, LigatureSubstBuilder)
1409
+
1410
+ for g in itertools.product(*glyphs):
1411
+ sub.ligatures[g] = replacement
1412
+
1413
+ chain.rules.append(ChainContextualRule(prefix, glyphs, suffix, [sub]))
1414
+
1390
1415
  # GSUB 8
1391
1416
  def add_reverse_chain_single_subst(self, location, old_prefix, old_suffix, mapping):
1392
1417
  if not mapping:
@@ -1658,38 +1683,31 @@ class Builder(object):
1658
1683
 
1659
1684
  return default, device
1660
1685
 
1686
+ def makeAnchorPos(self, varscalar, deviceTable, location):
1687
+ device = None
1688
+ if not isinstance(varscalar, VariableScalar):
1689
+ if deviceTable is not None:
1690
+ device = otl.buildDevice(dict(deviceTable))
1691
+ return varscalar, device
1692
+ default, device = self.makeVariablePos(location, varscalar)
1693
+ if device is not None and deviceTable is not None:
1694
+ raise FeatureLibError(
1695
+ "Can't define a device coordinate and variable scalar", location
1696
+ )
1697
+ return default, device
1698
+
1661
1699
  def makeOpenTypeAnchor(self, location, anchor):
1662
1700
  """ast.Anchor --> otTables.Anchor"""
1663
1701
  if anchor is None:
1664
1702
  return None
1665
- variable = False
1666
1703
  deviceX, deviceY = None, None
1667
1704
  if anchor.xDeviceTable is not None:
1668
1705
  deviceX = otl.buildDevice(dict(anchor.xDeviceTable))
1669
1706
  if anchor.yDeviceTable is not None:
1670
1707
  deviceY = otl.buildDevice(dict(anchor.yDeviceTable))
1671
- for dim in ("x", "y"):
1672
- varscalar = getattr(anchor, dim)
1673
- if not isinstance(varscalar, VariableScalar):
1674
- continue
1675
- if getattr(anchor, dim + "DeviceTable") is not None:
1676
- raise FeatureLibError(
1677
- "Can't define a device coordinate and variable scalar", location
1678
- )
1679
- default, device = self.makeVariablePos(location, varscalar)
1680
- setattr(anchor, dim, default)
1681
- if device is not None:
1682
- if dim == "x":
1683
- deviceX = device
1684
- else:
1685
- deviceY = device
1686
- variable = True
1687
-
1688
- otlanchor = otl.buildAnchor(
1689
- anchor.x, anchor.y, anchor.contourpoint, deviceX, deviceY
1690
- )
1691
- if variable:
1692
- otlanchor.Format = 3
1708
+ x, deviceX = self.makeAnchorPos(anchor.x, anchor.xDeviceTable, location)
1709
+ y, deviceY = self.makeAnchorPos(anchor.y, anchor.yDeviceTable, location)
1710
+ otlanchor = otl.buildAnchor(x, y, anchor.contourpoint, deviceX, deviceY)
1693
1711
  return otlanchor
1694
1712
 
1695
1713
  _VALUEREC_ATTRS = {