fonttools 4.55.2__py3-none-any.whl → 4.55.3__py3-none-any.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 (93) hide show
  1. fontTools/__init__.py +1 -1
  2. fontTools/feaLib/builder.py +22 -3
  3. fontTools/otlLib/builder.py +17 -0
  4. fontTools/ttLib/tables/B_A_S_E_.py +9 -0
  5. fontTools/ttLib/tables/C_B_D_T_.py +10 -0
  6. fontTools/ttLib/tables/C_B_L_C_.py +10 -0
  7. fontTools/ttLib/tables/C_F_F_.py +15 -0
  8. fontTools/ttLib/tables/C_F_F__2.py +13 -0
  9. fontTools/ttLib/tables/C_O_L_R_.py +9 -1
  10. fontTools/ttLib/tables/C_P_A_L_.py +9 -0
  11. fontTools/ttLib/tables/D_S_I_G_.py +7 -0
  12. fontTools/ttLib/tables/E_B_D_T_.py +8 -0
  13. fontTools/ttLib/tables/E_B_L_C_.py +8 -0
  14. fontTools/ttLib/tables/F_F_T_M_.py +10 -0
  15. fontTools/ttLib/tables/F__e_a_t.py +7 -2
  16. fontTools/ttLib/tables/G_D_E_F_.py +8 -0
  17. fontTools/ttLib/tables/G_M_A_P_.py +7 -0
  18. fontTools/ttLib/tables/G_P_K_G_.py +7 -0
  19. fontTools/ttLib/tables/G_P_O_S_.py +9 -0
  20. fontTools/ttLib/tables/G_S_U_B_.py +8 -0
  21. fontTools/ttLib/tables/G__l_a_t.py +3 -2
  22. fontTools/ttLib/tables/G__l_o_c.py +3 -2
  23. fontTools/ttLib/tables/H_V_A_R_.py +8 -0
  24. fontTools/ttLib/tables/J_S_T_F_.py +8 -0
  25. fontTools/ttLib/tables/L_T_S_H_.py +10 -0
  26. fontTools/ttLib/tables/M_A_T_H_.py +8 -0
  27. fontTools/ttLib/tables/M_E_T_A_.py +7 -0
  28. fontTools/ttLib/tables/M_V_A_R_.py +8 -0
  29. fontTools/ttLib/tables/O_S_2f_2.py +8 -1
  30. fontTools/ttLib/tables/S_I_N_G_.py +7 -0
  31. fontTools/ttLib/tables/S_T_A_T_.py +10 -0
  32. fontTools/ttLib/tables/S_V_G_.py +8 -0
  33. fontTools/ttLib/tables/S__i_l_f.py +4 -1
  34. fontTools/ttLib/tables/S__i_l_l.py +5 -0
  35. fontTools/ttLib/tables/T_S_I_B_.py +8 -0
  36. fontTools/ttLib/tables/T_S_I_C_.py +9 -0
  37. fontTools/ttLib/tables/T_S_I_D_.py +8 -0
  38. fontTools/ttLib/tables/T_S_I_J_.py +8 -0
  39. fontTools/ttLib/tables/T_S_I_P_.py +8 -0
  40. fontTools/ttLib/tables/T_S_I_S_.py +8 -0
  41. fontTools/ttLib/tables/T_S_I_V_.py +6 -0
  42. fontTools/ttLib/tables/T_S_I__0.py +2 -0
  43. fontTools/ttLib/tables/T_S_I__1.py +2 -0
  44. fontTools/ttLib/tables/T_S_I__2.py +2 -0
  45. fontTools/ttLib/tables/T_S_I__3.py +2 -0
  46. fontTools/ttLib/tables/T_S_I__5.py +2 -0
  47. fontTools/ttLib/tables/T_T_F_A_.py +9 -0
  48. fontTools/ttLib/tables/V_A_R_C_.py +7 -0
  49. fontTools/ttLib/tables/V_D_M_X_.py +8 -0
  50. fontTools/ttLib/tables/V_O_R_G_.py +8 -1
  51. fontTools/ttLib/tables/V_V_A_R_.py +8 -0
  52. fontTools/ttLib/tables/_a_n_k_r.py +3 -2
  53. fontTools/ttLib/tables/_a_v_a_r.py +3 -1
  54. fontTools/ttLib/tables/_b_s_l_n.py +9 -0
  55. fontTools/ttLib/tables/_c_i_d_g.py +7 -2
  56. fontTools/ttLib/tables/_c_m_a_p.py +2 -0
  57. fontTools/ttLib/tables/_c_v_a_r.py +8 -0
  58. fontTools/ttLib/tables/_c_v_t.py +8 -0
  59. fontTools/ttLib/tables/_f_e_a_t.py +7 -4
  60. fontTools/ttLib/tables/_f_p_g_m.py +11 -0
  61. fontTools/ttLib/tables/_f_v_a_r.py +8 -0
  62. fontTools/ttLib/tables/_g_a_s_p.py +8 -0
  63. fontTools/ttLib/tables/_g_c_i_d.py +7 -0
  64. fontTools/ttLib/tables/_g_l_y_f.py +1 -1
  65. fontTools/ttLib/tables/_g_v_a_r.py +11 -3
  66. fontTools/ttLib/tables/_h_d_m_x.py +8 -0
  67. fontTools/ttLib/tables/_h_e_a_d.py +7 -0
  68. fontTools/ttLib/tables/_h_h_e_a.py +12 -0
  69. fontTools/ttLib/tables/_h_m_t_x.py +9 -0
  70. fontTools/ttLib/tables/_k_e_r_n.py +11 -0
  71. fontTools/ttLib/tables/_l_c_a_r.py +8 -0
  72. fontTools/ttLib/tables/_l_o_c_a.py +8 -0
  73. fontTools/ttLib/tables/_l_t_a_g.py +8 -0
  74. fontTools/ttLib/tables/_m_a_x_p.py +8 -0
  75. fontTools/ttLib/tables/_m_e_t_a.py +8 -0
  76. fontTools/ttLib/tables/_m_o_r_t.py +8 -0
  77. fontTools/ttLib/tables/_m_o_r_x.py +9 -0
  78. fontTools/ttLib/tables/_n_a_m_e.py +10 -0
  79. fontTools/ttLib/tables/_o_p_b_d.py +8 -0
  80. fontTools/ttLib/tables/_p_o_s_t.py +9 -0
  81. fontTools/ttLib/tables/_p_r_e_p.py +9 -0
  82. fontTools/ttLib/tables/_p_r_o_p.py +6 -0
  83. fontTools/ttLib/tables/_s_b_i_x.py +10 -0
  84. fontTools/ttLib/tables/_t_r_a_k.py +7 -0
  85. fontTools/ttLib/tables/_v_h_e_a.py +12 -0
  86. fontTools/ttLib/tables/_v_m_t_x.py +9 -0
  87. {fonttools-4.55.2.dist-info → fonttools-4.55.3.dist-info}/METADATA +8 -1
  88. {fonttools-4.55.2.dist-info → fonttools-4.55.3.dist-info}/RECORD +93 -93
  89. {fonttools-4.55.2.data → fonttools-4.55.3.data}/data/share/man/man1/ttx.1 +0 -0
  90. {fonttools-4.55.2.dist-info → fonttools-4.55.3.dist-info}/LICENSE +0 -0
  91. {fonttools-4.55.2.dist-info → fonttools-4.55.3.dist-info}/WHEEL +0 -0
  92. {fonttools-4.55.2.dist-info → fonttools-4.55.3.dist-info}/entry_points.txt +0 -0
  93. {fonttools-4.55.2.dist-info → fonttools-4.55.3.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.2"
6
+ version = __version__ = "4.55.3"
7
7
 
8
8
  __all__ = ["version", "log", "configLogger"]
@@ -1328,9 +1328,10 @@ class Builder(object):
1328
1328
  self, location, prefix, glyphs, suffix, replacement, forceChain
1329
1329
  ):
1330
1330
  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]))
1331
+ self.add_ligature_subst_chained_(
1332
+ location, prefix, glyphs, suffix, replacement
1333
+ )
1334
+ return
1334
1335
  else:
1335
1336
  lookup = self.get_lookup_(location, LigatureSubstBuilder)
1336
1337
 
@@ -1387,6 +1388,24 @@ class Builder(object):
1387
1388
  sub.mapping[glyph] = replacements
1388
1389
  chain.rules.append(ChainContextualRule(prefix, [{glyph}], suffix, [sub]))
1389
1390
 
1391
+ def add_ligature_subst_chained_(
1392
+ self, location, prefix, glyphs, suffix, replacement
1393
+ ):
1394
+ # https://github.com/fonttools/fonttools/issues/3701
1395
+ if not all(prefix) or not all(suffix):
1396
+ raise FeatureLibError(
1397
+ "Empty glyph class in contextual substitution", location
1398
+ )
1399
+ chain = self.get_lookup_(location, ChainContextSubstBuilder)
1400
+ sub = chain.find_chainable_ligature_subst(glyphs, replacement)
1401
+ if sub is None:
1402
+ sub = self.get_chained_lookup_(location, LigatureSubstBuilder)
1403
+
1404
+ for g in itertools.product(*glyphs):
1405
+ sub.ligatures[g] = replacement
1406
+
1407
+ chain.rules.append(ChainContextualRule(prefix, glyphs, suffix, [sub]))
1408
+
1390
1409
  # GSUB 8
1391
1410
  def add_reverse_chain_single_subst(self, location, old_prefix, old_suffix, mapping):
1392
1411
  if not mapping:
@@ -1,4 +1,5 @@
1
1
  from collections import namedtuple, OrderedDict
2
+ import itertools
2
3
  import os
3
4
  from fontTools.misc.fixedTools import fixedToFloat
4
5
  from fontTools.misc.roundTools import otRound
@@ -798,6 +799,22 @@ class ChainContextSubstBuilder(ChainContextualBuilder):
798
799
  res = sub
799
800
  return res
800
801
 
802
+ def find_chainable_ligature_subst(self, glyphs, replacement):
803
+ """Helper for add_ligature_subst_chained_()"""
804
+ res = None
805
+ for rule in self.rules[::-1]:
806
+ if rule.is_subtable_break:
807
+ return res
808
+ for sub in rule.lookups:
809
+ if not isinstance(sub, LigatureSubstBuilder):
810
+ continue
811
+ if all(
812
+ sub.ligatures.get(seq, replacement) == replacement
813
+ for seq in itertools.product(*glyphs)
814
+ ):
815
+ res = sub
816
+ return res
817
+
801
818
 
802
819
  class LigatureSubstBuilder(LookupBuilder):
803
820
  """Builds a Ligature Substitution (GSUB4) lookup.
@@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_B_A_S_E_(BaseTTXConverter):
5
+ """Baseline table
6
+
7
+ The ``BASE`` table contains information needed to align glyphs in
8
+ different scripts, from different fonts, or at different sizes
9
+ within the same line of text.
10
+
11
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/base
12
+ """
13
+
5
14
  pass
@@ -21,6 +21,16 @@ import struct
21
21
 
22
22
 
23
23
  class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_):
24
+ """Color Bitmap Data table
25
+
26
+ The ``CBDT`` table contains color bitmap data for glyphs. It must
27
+ be used in concert with the ``CBLC`` table.
28
+
29
+ It is backwards-compatible with the monochrome/grayscale ``EBDT`` table.
30
+
31
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt
32
+ """
33
+
24
34
  # Change the data locator table being referenced.
25
35
  locatorName = "CBLC"
26
36
 
@@ -6,4 +6,14 @@ from . import E_B_L_C_
6
6
 
7
7
 
8
8
  class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_):
9
+ """Color Bitmap Location table
10
+
11
+ The ``CBLC`` table contains the locations of color bitmaps for glyphs. It must
12
+ be used in concert with the ``CBDT`` table.
13
+
14
+ It is backwards-compatible with the monochrome/grayscale ``EBLC`` table.
15
+
16
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/cblc
17
+ """
18
+
9
19
  dependencies = ["CBDT"]
@@ -4,6 +4,21 @@ from . import DefaultTable
4
4
 
5
5
 
6
6
  class table_C_F_F_(DefaultTable.DefaultTable):
7
+ """Compact Font Format table (version 1)
8
+
9
+ The ``CFF`` table embeds a CFF-formatted font. The CFF font format
10
+ predates OpenType and could be used as a standalone font file, but the
11
+ ``CFF`` table is also used to package CFF fonts into an OpenType
12
+ container.
13
+
14
+ .. note::
15
+ ``CFF`` has been succeeded by ``CFF2``, which eliminates much of
16
+ the redundancy incurred by embedding CFF version 1 in an OpenType
17
+ font.
18
+
19
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff
20
+ """
21
+
7
22
  def __init__(self, tag=None):
8
23
  DefaultTable.DefaultTable.__init__(self, tag)
9
24
  self.cff = cffLib.CFFFontSet()
@@ -3,6 +3,19 @@ from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_
3
3
 
4
4
 
5
5
  class table_C_F_F__2(table_C_F_F_):
6
+ """Compact Font Format version 2 table
7
+
8
+ The ``CFF2`` table contains glyph data for a CFF2-flavored OpenType
9
+ font.
10
+
11
+ .. note::
12
+ ``CFF2`` is the successor to ``CFF``, and eliminates much of
13
+ the redundancy incurred by embedding CFF version 1 in an OpenType
14
+ font.
15
+
16
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff2
17
+ """
18
+
6
19
  def decompile(self, data, otFont):
7
20
  self.cff.decompile(BytesIO(data), otFont, isCFF2=True)
8
21
  assert len(self.cff) == 1, "can't deal with multi-font CFF tables."
@@ -7,11 +7,19 @@ from . import DefaultTable
7
7
 
8
8
 
9
9
  class table_C_O_L_R_(DefaultTable.DefaultTable):
10
- """This table is structured so that you can treat it like a dictionary keyed by glyph name.
10
+ """Color table
11
+
12
+ The ``COLR`` table defines color presentation of outline glyphs. It must
13
+ be used in concert with the ``CPAL`` table, which contains the color
14
+ descriptors used.
15
+
16
+ This table is structured so that you can treat it like a dictionary keyed by glyph name.
11
17
 
12
18
  ``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph.
13
19
 
14
20
  ``ttFont['COLR'][<glyphName>] = <value>`` will set the color layers for any glyph.
21
+
22
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/colr
15
23
  """
16
24
 
17
25
  @staticmethod
@@ -11,6 +11,15 @@ import sys
11
11
 
12
12
 
13
13
  class table_C_P_A_L_(DefaultTable.DefaultTable):
14
+ """Color Palette table
15
+
16
+ The ``CPAL`` table contains a set of one or more color palettes. The color
17
+ records in each palette can be referenced by the ``COLR`` table to specify
18
+ the colors used in a color glyph.
19
+
20
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/cpal
21
+ """
22
+
14
23
  NO_NAME_ID = 0xFFFF
15
24
  DEFAULT_PALETTE_TYPE = 0
16
25
 
@@ -39,6 +39,13 @@ DSIG_SignatureBlockFormat = """
39
39
 
40
40
 
41
41
  class table_D_S_I_G_(DefaultTable.DefaultTable):
42
+ """Digital Signature table
43
+
44
+ The ``DSIG`` table contains cryptographic signatures for the font.
45
+
46
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/dsig
47
+ """
48
+
42
49
  def decompile(self, data, ttFont):
43
50
  dummy, newData = sstruct.unpack2(DSIG_HeaderFormat, data, self)
44
51
  assert self.ulVersion == 1, "DSIG ulVersion must be 1"
@@ -38,6 +38,14 @@ ebdtComponentFormat = """
38
38
 
39
39
 
40
40
  class table_E_B_D_T_(DefaultTable.DefaultTable):
41
+ """Embedded Bitmap Data table
42
+
43
+ The ``EBDT`` table contains monochrome or grayscale bitmap data for
44
+ glyphs. It must be used in concert with the ``EBLC`` table.
45
+
46
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/ebdt
47
+ """
48
+
41
49
  # Keep a reference to the name of the data locator table.
42
50
  locatorName = "EBLC"
43
51
 
@@ -66,6 +66,14 @@ codeOffsetPairSize = struct.calcsize(codeOffsetPairFormat)
66
66
 
67
67
 
68
68
  class table_E_B_L_C_(DefaultTable.DefaultTable):
69
+ """Embedded Bitmap Location table
70
+
71
+ The ``EBLC`` table contains the locations of monochrome or grayscale
72
+ bitmaps for glyphs. It must be used in concert with the ``EBDT`` table.
73
+
74
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/eblc
75
+ """
76
+
69
77
  dependencies = ["EBDT"]
70
78
 
71
79
  # This method can be overridden in subclasses to support new formats
@@ -13,6 +13,16 @@ FFTMFormat = """
13
13
 
14
14
 
15
15
  class table_F_F_T_M_(DefaultTable.DefaultTable):
16
+ """FontForge Time Stamp table
17
+
18
+ The ``FFTM`` table is used by the free-software font editor
19
+ FontForge to record timestamps for the creation and modification
20
+ of font source (.sfd) files and a timestamp for FontForge's
21
+ own source code.
22
+
23
+ See also https://fontforge.org/docs/techref/non-standard.html
24
+ """
25
+
16
26
  def decompile(self, data, ttFont):
17
27
  dummy, rest = sstruct.unpack2(FFTMFormat, data, self)
18
28
 
@@ -12,12 +12,17 @@ Feat_hdr_format = """
12
12
 
13
13
 
14
14
  class table_F__e_a_t(DefaultTable.DefaultTable):
15
- """The ``Feat`` table is used exclusively by the Graphite shaping engine
15
+ """Feature table
16
+
17
+ The ``Feat`` table is used exclusively by the Graphite shaping engine
16
18
  to store features and possible settings specified in GDL. Graphite features
17
19
  determine what rules are applied to transform a glyph stream.
18
20
 
19
21
  Not to be confused with ``feat``, or the OpenType Layout tables
20
- ``GSUB``/``GPOS``."""
22
+ ``GSUB``/``GPOS``.
23
+
24
+ See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
25
+ """
21
26
 
22
27
  def __init__(self, tag=None):
23
28
  DefaultTable.DefaultTable.__init__(self, tag)
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_G_D_E_F_(BaseTTXConverter):
5
+ """Glyph Definition table
6
+
7
+ The ``GDEF`` table stores various glyph properties that are used
8
+ by OpenType Layout.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/gdef
11
+ """
12
+
5
13
  pass
@@ -81,6 +81,13 @@ class GMAPRecord(object):
81
81
 
82
82
 
83
83
  class table_G_M_A_P_(DefaultTable.DefaultTable):
84
+ """Glyphlets GMAP table
85
+
86
+ The ``GMAP`` table is used by Adobe's SING Glyphlets.
87
+
88
+ See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
89
+ """
90
+
84
91
  dependencies = []
85
92
 
86
93
  def decompile(self, data, ttFont):
@@ -16,6 +16,13 @@ GPKGFormat = """
16
16
 
17
17
 
18
18
  class table_G_P_K_G_(DefaultTable.DefaultTable):
19
+ """Glyphlets GPKG table
20
+
21
+ The ``GPKG`` table is used by Adobe's SING Glyphlets.
22
+
23
+ See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
24
+ """
25
+
19
26
  def decompile(self, data, ttFont):
20
27
  dummy, newData = sstruct.unpack2(GPKGFormat, data, self)
21
28
 
@@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_G_P_O_S_(BaseTTXConverter):
5
+ """Glyph Positioning table
6
+
7
+ The ``GPOS`` table stores advanced glyph-positioning data
8
+ used in OpenType Layout features, such as mark attachment,
9
+ cursive attachment, kerning, and other position adjustments.
10
+
11
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/gpos
12
+ """
13
+
5
14
  pass
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_G_S_U_B_(BaseTTXConverter):
5
+ """Glyph Substitution table
6
+
7
+ The ``GSUB`` table contains glyph-substitution rules used in
8
+ OpenType Layout.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/gsub
11
+ """
12
+
5
13
  pass
@@ -62,8 +62,9 @@ class _Dict(dict):
62
62
 
63
63
 
64
64
  class table_G__l_a_t(DefaultTable.DefaultTable):
65
- """
66
- Support Graphite Glat tables
65
+ """Graphite Glyph Attributes table
66
+
67
+ See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
67
68
  """
68
69
 
69
70
  def __init__(self, tag=None):
@@ -15,8 +15,9 @@ Gloc_header = """
15
15
 
16
16
 
17
17
  class table_G__l_o_c(DefaultTable.DefaultTable):
18
- """
19
- Support Graphite Gloc tables
18
+ """Graphite Index to Glyph Atttributes table
19
+
20
+ See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
20
21
  """
21
22
 
22
23
  dependencies = ["Glat"]
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_H_V_A_R_(BaseTTXConverter):
5
+ """Horizontal Metrics Variations table
6
+
7
+ The ``HVAR`` table contains variations in horizontal glyph metrics
8
+ in variable fonts.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/hvar
11
+ """
12
+
5
13
  pass
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_J_S_T_F_(BaseTTXConverter):
5
+ """Justification table
6
+
7
+ The ``JSTF`` table contains glyph substitution and positioning
8
+ data used to perform text justification.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/jstf
11
+ """
12
+
5
13
  pass
@@ -9,6 +9,16 @@ import array
9
9
 
10
10
 
11
11
  class table_L_T_S_H_(DefaultTable.DefaultTable):
12
+ """Linear Threshold table
13
+
14
+ The ``LTSH`` table contains per-glyph settings indicating the ppem sizes
15
+ at which the advance width metric should be scaled linearly, despite the
16
+ effects of any TrueType instructions that might otherwise alter the
17
+ advance width.
18
+
19
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/ltsh
20
+ """
21
+
12
22
  def decompile(self, data, ttFont):
13
23
  version, numGlyphs = struct.unpack(">HH", data[:4])
14
24
  data = data[4:]
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_M_A_T_H_(BaseTTXConverter):
5
+ """Mathematical Typesetting table
6
+
7
+ The ``MATH`` table contains a variety of information needed to
8
+ typeset glyphs in mathematical formulas and expressions.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/math
11
+ """
12
+
5
13
  pass
@@ -68,6 +68,13 @@ def getLabelString(labelID):
68
68
 
69
69
 
70
70
  class table_M_E_T_A_(DefaultTable.DefaultTable):
71
+ """Glyphlets META table
72
+
73
+ The ``META`` table is used by Adobe's SING Glyphlets.
74
+
75
+ See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
76
+ """
77
+
71
78
  dependencies = []
72
79
 
73
80
  def decompile(self, data, ttFont):
@@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_M_V_A_R_(BaseTTXConverter):
5
+ """Metrics Variations table
6
+
7
+ The ``MVAR`` table contains variation information for font-wide
8
+ metrics in a variable font.
9
+
10
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/mvar
11
+ """
12
+
5
13
  pass
@@ -113,7 +113,14 @@ OS2_format_5_addition = bigendian + OS2_format_5_addition
113
113
 
114
114
 
115
115
  class table_O_S_2f_2(DefaultTable.DefaultTable):
116
- """the OS/2 table"""
116
+ """OS/2 and Windows Metrics table
117
+
118
+ The ``OS/2`` table contains a variety of font-wide metrics and
119
+ parameters that may be useful to an operating system or other
120
+ software for system-integration purposes.
121
+
122
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/os2
123
+ """
117
124
 
118
125
  dependencies = ["head"]
119
126
 
@@ -20,6 +20,13 @@ SINGFormat = """
20
20
 
21
21
 
22
22
  class table_S_I_N_G_(DefaultTable.DefaultTable):
23
+ """Glyphlets SING table
24
+
25
+ The ``SING`` table is used by Adobe's SING Glyphlets.
26
+
27
+ See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html
28
+ """
29
+
23
30
  dependencies = []
24
31
 
25
32
  def decompile(self, data, ttFont):
@@ -2,4 +2,14 @@ from .otBase import BaseTTXConverter
2
2
 
3
3
 
4
4
  class table_S_T_A_T_(BaseTTXConverter):
5
+ """Style Attributes table
6
+
7
+ The ``STAT`` table records stylistic or typeface-design attributes that
8
+ differentiate the individual fonts within a font family from one another.
9
+ Those attributes can be used to assist users when navigating the style
10
+ variations of a variable font or a family of static fonts.
11
+
12
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat
13
+ """
14
+
5
15
  pass
@@ -51,6 +51,14 @@ doc_index_entry_format_0Size = sstruct.calcsize(doc_index_entry_format_0)
51
51
 
52
52
 
53
53
  class table_S_V_G_(DefaultTable.DefaultTable):
54
+ """Scalable Vector Graphics table
55
+
56
+ The ``SVG`` table contains representations for glyphs in the SVG
57
+ image format.
58
+
59
+ See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat
60
+ """
61
+
54
62
  def decompile(self, data, ttFont):
55
63
  self.docList = []
56
64
  # Version 0 is the standardized version of the table; and current.
@@ -343,7 +343,10 @@ class _Object:
343
343
 
344
344
 
345
345
  class table_S__i_l_f(DefaultTable.DefaultTable):
346
- """Silf table support"""
346
+ """Graphite Rules table
347
+
348
+ See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
349
+ """
347
350
 
348
351
  def __init__(self, tag=None):
349
352
  DefaultTable.DefaultTable.__init__(self, tag)
@@ -12,6 +12,11 @@ Sill_hdr = """
12
12
 
13
13
 
14
14
  class table_S__i_l_l(DefaultTable.DefaultTable):
15
+ """Graphite Languages table
16
+
17
+ See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables
18
+ """
19
+
15
20
  def __init__(self, tag=None):
16
21
  DefaultTable.DefaultTable.__init__(self, tag)
17
22
  self.langs = {}
@@ -1,3 +1,11 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSIB contains the source text for the ``BASE`` table.
5
+
6
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
7
+ """
8
+
1
9
  from .T_S_I_V_ import table_T_S_I_V_
2
10
 
3
11
 
@@ -1,3 +1,12 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSIC contains the source text for the Variation CVT window and data for
5
+ the ``cvar`` table.
6
+
7
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
8
+ """
9
+
1
10
  from .otBase import BaseTTXConverter
2
11
 
3
12
 
@@ -1,3 +1,11 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSID contains the source text for the ``GDEF`` table.
5
+
6
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
7
+ """
8
+
1
9
  from .T_S_I_V_ import table_T_S_I_V_
2
10
 
3
11
 
@@ -1,3 +1,11 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSIJ contains the source text for the ``JSTF`` table.
5
+
6
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
7
+ """
8
+
1
9
  from .T_S_I_V_ import table_T_S_I_V_
2
10
 
3
11
 
@@ -1,3 +1,11 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSIP contains the source text for the ``GPOS`` table.
5
+
6
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
7
+ """
8
+
1
9
  from .T_S_I_V_ import table_T_S_I_V_
2
10
 
3
11
 
@@ -1,3 +1,11 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ TSIS contains the source text for the ``GSUB`` table.
5
+
6
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
7
+ """
8
+
1
9
  from .T_S_I_V_ import table_T_S_I_V_
2
10
 
3
11
 
@@ -1,3 +1,9 @@
1
+ """ TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT)
2
+ tool to store its table source data.
3
+
4
+ See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables
5
+ """
6
+
1
7
  from fontTools.misc.textTools import strjoin, tobytes, tostr
2
8
  from . import asciiTable
3
9