diff options
| author | robot-piglet <[email protected]> | 2024-12-25 09:32:21 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-12-25 09:46:53 +0300 |
| commit | 2f83984f3c96794039f6d577c2dc3eea220dbca0 (patch) | |
| tree | 958ca6af85dd936face825e7fba750a5144d4eaf /contrib/python/fonttools | |
| parent | f8fcb8a9bf119d91c13270ce72f2bbe35bafe0d3 (diff) | |
Intermediate changes
commit_hash:c52dc7996a60242b5397523a3f8dada166c4c7c5
Diffstat (limited to 'contrib/python/fonttools')
88 files changed, 682 insertions, 29 deletions
diff --git a/contrib/python/fonttools/.dist-info/METADATA b/contrib/python/fonttools/.dist-info/METADATA index 5a177ba30c9..ca6f7ccb089 100644 --- a/contrib/python/fonttools/.dist-info/METADATA +++ b/contrib/python/fonttools/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: fonttools -Version: 4.55.2 +Version: 4.55.3 Summary: Tools to manipulate font files Home-page: http://github.com/fonttools/fonttools Author: Just van Rossum @@ -377,6 +377,13 @@ Have fun! Changelog ~~~~~~~~~ +4.55.3 (released 2024-12-10) +---------------------------- + + +- [Docs] fill out ttLib table section [#3716] +- [feaLib] More efficient inline format 4 lookups [#3726] + 4.55.2 (released 2024-12-05) ---------------------------- diff --git a/contrib/python/fonttools/fontTools/__init__.py b/contrib/python/fonttools/fontTools/__init__.py index 2fe3602d325..0af1b7a5eca 100644 --- a/contrib/python/fonttools/fontTools/__init__.py +++ b/contrib/python/fonttools/fontTools/__init__.py @@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger log = logging.getLogger(__name__) -version = __version__ = "4.55.2" +version = __version__ = "4.55.3" __all__ = ["version", "log", "configLogger"] diff --git a/contrib/python/fonttools/fontTools/feaLib/builder.py b/contrib/python/fonttools/fontTools/feaLib/builder.py index 81aa8c2e263..1cfe1c3a137 100644 --- a/contrib/python/fonttools/fontTools/feaLib/builder.py +++ b/contrib/python/fonttools/fontTools/feaLib/builder.py @@ -1328,9 +1328,10 @@ class Builder(object): self, location, prefix, glyphs, suffix, replacement, forceChain ): if prefix or suffix or forceChain: - chain = self.get_lookup_(location, ChainContextSubstBuilder) - lookup = self.get_chained_lookup_(location, LigatureSubstBuilder) - chain.rules.append(ChainContextualRule(prefix, glyphs, suffix, [lookup])) + self.add_ligature_subst_chained_( + location, prefix, glyphs, suffix, replacement + ) + return else: lookup = self.get_lookup_(location, LigatureSubstBuilder) @@ -1387,6 +1388,24 @@ class Builder(object): sub.mapping[glyph] = replacements chain.rules.append(ChainContextualRule(prefix, [{glyph}], suffix, [sub])) + def add_ligature_subst_chained_( + self, location, prefix, glyphs, suffix, replacement + ): + # https://github.com/fonttools/fonttools/issues/3701 + if not all(prefix) or not all(suffix): + raise FeatureLibError( + "Empty glyph class in contextual substitution", location + ) + chain = self.get_lookup_(location, ChainContextSubstBuilder) + sub = chain.find_chainable_ligature_subst(glyphs, replacement) + if sub is None: + sub = self.get_chained_lookup_(location, LigatureSubstBuilder) + + for g in itertools.product(*glyphs): + sub.ligatures[g] = replacement + + chain.rules.append(ChainContextualRule(prefix, glyphs, suffix, [sub])) + # GSUB 8 def add_reverse_chain_single_subst(self, location, old_prefix, old_suffix, mapping): if not mapping: diff --git a/contrib/python/fonttools/fontTools/otlLib/builder.py b/contrib/python/fonttools/fontTools/otlLib/builder.py index 8fc685683ae..b944ea8c261 100644 --- a/contrib/python/fonttools/fontTools/otlLib/builder.py +++ b/contrib/python/fonttools/fontTools/otlLib/builder.py @@ -1,4 +1,5 @@ from collections import namedtuple, OrderedDict +import itertools import os from fontTools.misc.fixedTools import fixedToFloat from fontTools.misc.roundTools import otRound @@ -798,6 +799,22 @@ class ChainContextSubstBuilder(ChainContextualBuilder): res = sub return res + def find_chainable_ligature_subst(self, glyphs, replacement): + """Helper for add_ligature_subst_chained_()""" + res = None + for rule in self.rules[::-1]: + if rule.is_subtable_break: + return res + for sub in rule.lookups: + if not isinstance(sub, LigatureSubstBuilder): + continue + if all( + sub.ligatures.get(seq, replacement) == replacement + for seq in itertools.product(*glyphs) + ): + res = sub + return res + class LigatureSubstBuilder(LookupBuilder): """Builds a Ligature Substitution (GSUB4) lookup. diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/B_A_S_E_.py b/contrib/python/fonttools/fontTools/ttLib/tables/B_A_S_E_.py index f468a963a1e..0f4b1c3c5a7 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/B_A_S_E_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/B_A_S_E_.py @@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter class table_B_A_S_E_(BaseTTXConverter): + """Baseline table + + The ``BASE`` table contains information needed to align glyphs in + different scripts, from different fonts, or at different sizes + within the same line of text. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/base + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_B_D_T_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_B_D_T_.py index 2b87ac86284..0f9924745eb 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_B_D_T_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_B_D_T_.py @@ -21,6 +21,16 @@ import struct class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_): + """Color Bitmap Data table + + The ``CBDT`` table contains color bitmap data for glyphs. It must + be used in concert with the ``CBLC`` table. + + It is backwards-compatible with the monochrome/grayscale ``EBDT`` table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt + """ + # Change the data locator table being referenced. locatorName = "CBLC" diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_B_L_C_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_B_L_C_.py index fc3974ece04..0673fb7ed22 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_B_L_C_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_B_L_C_.py @@ -6,4 +6,14 @@ from . import E_B_L_C_ class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_): + """Color Bitmap Location table + + The ``CBLC`` table contains the locations of color bitmaps for glyphs. It must + be used in concert with the ``CBDT`` table. + + It is backwards-compatible with the monochrome/grayscale ``EBLC`` table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cblc + """ + dependencies = ["CBDT"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F_.py index c231599e37b..3d974ced88e 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F_.py @@ -4,6 +4,21 @@ from . import DefaultTable class table_C_F_F_(DefaultTable.DefaultTable): + """Compact Font Format table (version 1) + + The ``CFF`` table embeds a CFF-formatted font. The CFF font format + predates OpenType and could be used as a standalone font file, but the + ``CFF`` table is also used to package CFF fonts into an OpenType + container. + + .. note:: + ``CFF`` has been succeeded by ``CFF2``, which eliminates much of + the redundancy incurred by embedding CFF version 1 in an OpenType + font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff + """ + def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) self.cff = cffLib.CFFFontSet() diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F__2.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F__2.py index edbb0b92f77..ff07682d24f 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F__2.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_F_F__2.py @@ -3,6 +3,19 @@ from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_ class table_C_F_F__2(table_C_F_F_): + """Compact Font Format version 2 table + + The ``CFF2`` table contains glyph data for a CFF2-flavored OpenType + font. + + .. note:: + ``CFF2`` is the successor to ``CFF``, and eliminates much of + the redundancy incurred by embedding CFF version 1 in an OpenType + font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff2 + """ + def decompile(self, data, otFont): self.cff.decompile(BytesIO(data), otFont, isCFF2=True) assert len(self.cff) == 1, "can't deal with multi-font CFF tables." diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py index df857842cc3..266a11c41df 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_O_L_R_.py @@ -7,11 +7,19 @@ from . import DefaultTable class table_C_O_L_R_(DefaultTable.DefaultTable): - """This table is structured so that you can treat it like a dictionary keyed by glyph name. + """Color table + + The ``COLR`` table defines color presentation of outline glyphs. It must + be used in concert with the ``CPAL`` table, which contains the color + descriptors used. + + This table is structured so that you can treat it like a dictionary keyed by glyph name. ``ttFont['COLR'][<glyphName>]`` will return the color layers for any glyph. ``ttFont['COLR'][<glyphName>] = <value>`` will set the color layers for any glyph. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/colr """ @staticmethod diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/C_P_A_L_.py b/contrib/python/fonttools/fontTools/ttLib/tables/C_P_A_L_.py index 9fb2074afce..5ec8c843c51 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/C_P_A_L_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/C_P_A_L_.py @@ -11,6 +11,15 @@ import sys class table_C_P_A_L_(DefaultTable.DefaultTable): + """Color Palette table + + The ``CPAL`` table contains a set of one or more color palettes. The color + records in each palette can be referenced by the ``COLR`` table to specify + the colors used in a color glyph. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cpal + """ + NO_NAME_ID = 0xFFFF DEFAULT_PALETTE_TYPE = 0 diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/D_S_I_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/D_S_I_G_.py index d902a29080a..f89cc29e49f 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/D_S_I_G_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/D_S_I_G_.py @@ -39,6 +39,13 @@ DSIG_SignatureBlockFormat = """ class table_D_S_I_G_(DefaultTable.DefaultTable): + """Digital Signature table + + The ``DSIG`` table contains cryptographic signatures for the font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/dsig + """ + def decompile(self, data, ttFont): dummy, newData = sstruct.unpack2(DSIG_HeaderFormat, data, self) assert self.ulVersion == 1, "DSIG ulVersion must be 1" diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/E_B_D_T_.py b/contrib/python/fonttools/fontTools/ttLib/tables/E_B_D_T_.py index 9f7f82efd55..ea23e30f83d 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/E_B_D_T_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/E_B_D_T_.py @@ -38,6 +38,14 @@ ebdtComponentFormat = """ class table_E_B_D_T_(DefaultTable.DefaultTable): + """Embedded Bitmap Data table + + The ``EBDT`` table contains monochrome or grayscale bitmap data for + glyphs. It must be used in concert with the ``EBLC`` table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/ebdt + """ + # Keep a reference to the name of the data locator table. locatorName = "EBLC" diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/E_B_L_C_.py b/contrib/python/fonttools/fontTools/ttLib/tables/E_B_L_C_.py index 23d57964f6f..ff93aa8cf67 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/E_B_L_C_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/E_B_L_C_.py @@ -66,6 +66,14 @@ codeOffsetPairSize = struct.calcsize(codeOffsetPairFormat) class table_E_B_L_C_(DefaultTable.DefaultTable): + """Embedded Bitmap Location table + + The ``EBLC`` table contains the locations of monochrome or grayscale + bitmaps for glyphs. It must be used in concert with the ``EBDT`` table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/eblc + """ + dependencies = ["EBDT"] # This method can be overridden in subclasses to support new formats diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/F_F_T_M_.py b/contrib/python/fonttools/fontTools/ttLib/tables/F_F_T_M_.py index 823ced1bafe..20b72346611 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/F_F_T_M_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/F_F_T_M_.py @@ -13,6 +13,16 @@ FFTMFormat = """ class table_F_F_T_M_(DefaultTable.DefaultTable): + """FontForge Time Stamp table + + The ``FFTM`` table is used by the free-software font editor + FontForge to record timestamps for the creation and modification + of font source (.sfd) files and a timestamp for FontForge's + own source code. + + See also https://fontforge.org/docs/techref/non-standard.html + """ + def decompile(self, data, ttFont): dummy, rest = sstruct.unpack2(FFTMFormat, data, self) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/F__e_a_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/F__e_a_t.py index fbcd6ca6e7b..579eb27bdd7 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/F__e_a_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/F__e_a_t.py @@ -12,12 +12,17 @@ Feat_hdr_format = """ class table_F__e_a_t(DefaultTable.DefaultTable): - """The ``Feat`` table is used exclusively by the Graphite shaping engine + """Feature table + + The ``Feat`` table is used exclusively by the Graphite shaping engine to store features and possible settings specified in GDL. Graphite features determine what rules are applied to transform a glyph stream. Not to be confused with ``feat``, or the OpenType Layout tables - ``GSUB``/``GPOS``.""" + ``GSUB``/``GPOS``. + + See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables + """ def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G_D_E_F_.py b/contrib/python/fonttools/fontTools/ttLib/tables/G_D_E_F_.py index d8ae8b23bb6..922a9cb2063 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G_D_E_F_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G_D_E_F_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_G_D_E_F_(BaseTTXConverter): + """Glyph Definition table + + The ``GDEF`` table stores various glyph properties that are used + by OpenType Layout. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/gdef + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G_M_A_P_.py b/contrib/python/fonttools/fontTools/ttLib/tables/G_M_A_P_.py index 949ef842ef7..070c61919e1 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G_M_A_P_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G_M_A_P_.py @@ -81,6 +81,13 @@ class GMAPRecord(object): class table_G_M_A_P_(DefaultTable.DefaultTable): + """Glyphlets GMAP table + + The ``GMAP`` table is used by Adobe's SING Glyphlets. + + See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html + """ + dependencies = [] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G_P_K_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/G_P_K_G_.py index eed34d92105..0da99fcda40 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G_P_K_G_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G_P_K_G_.py @@ -16,6 +16,13 @@ GPKGFormat = """ class table_G_P_K_G_(DefaultTable.DefaultTable): + """Glyphlets GPKG table + + The ``GPKG`` table is used by Adobe's SING Glyphlets. + + See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html + """ + def decompile(self, data, ttFont): dummy, newData = sstruct.unpack2(GPKGFormat, data, self) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G_P_O_S_.py b/contrib/python/fonttools/fontTools/ttLib/tables/G_P_O_S_.py index ca8290bab44..03bdc612ead 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G_P_O_S_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G_P_O_S_.py @@ -2,4 +2,13 @@ from .otBase import BaseTTXConverter class table_G_P_O_S_(BaseTTXConverter): + """Glyph Positioning table + + The ``GPOS`` table stores advanced glyph-positioning data + used in OpenType Layout features, such as mark attachment, + cursive attachment, kerning, and other position adjustments. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/gpos + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G_S_U_B_.py b/contrib/python/fonttools/fontTools/ttLib/tables/G_S_U_B_.py index bb8375a5f83..ca1aff8b068 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G_S_U_B_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G_S_U_B_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_G_S_U_B_(BaseTTXConverter): + """Glyph Substitution table + + The ``GSUB`` table contains glyph-substitution rules used in + OpenType Layout. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/gsub + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G__l_a_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/G__l_a_t.py index f1dfdaa031e..fe1e0534fb7 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G__l_a_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G__l_a_t.py @@ -62,8 +62,9 @@ class _Dict(dict): class table_G__l_a_t(DefaultTable.DefaultTable): - """ - Support Graphite Glat tables + """Graphite Glyph Attributes table + + See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables """ def __init__(self, tag=None): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/G__l_o_c.py b/contrib/python/fonttools/fontTools/ttLib/tables/G__l_o_c.py index 7973b9be911..4c3d78ab2e4 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/G__l_o_c.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/G__l_o_c.py @@ -15,8 +15,9 @@ Gloc_header = """ class table_G__l_o_c(DefaultTable.DefaultTable): - """ - Support Graphite Gloc tables + """Graphite Index to Glyph Atttributes table + + See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables """ dependencies = ["Glat"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/H_V_A_R_.py b/contrib/python/fonttools/fontTools/ttLib/tables/H_V_A_R_.py index 094aedaea5e..48e7fd67cf0 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/H_V_A_R_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/H_V_A_R_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_H_V_A_R_(BaseTTXConverter): + """Horizontal Metrics Variations table + + The ``HVAR`` table contains variations in horizontal glyph metrics + in variable fonts. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/hvar + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/J_S_T_F_.py b/contrib/python/fonttools/fontTools/ttLib/tables/J_S_T_F_.py index 111c700710e..b185f30f3a9 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/J_S_T_F_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/J_S_T_F_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_J_S_T_F_(BaseTTXConverter): + """Justification table + + The ``JSTF`` table contains glyph substitution and positioning + data used to perform text justification. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/jstf + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/L_T_S_H_.py b/contrib/python/fonttools/fontTools/ttLib/tables/L_T_S_H_.py index e0ab0d021c4..e691c06e9bf 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/L_T_S_H_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/L_T_S_H_.py @@ -9,6 +9,16 @@ import array class table_L_T_S_H_(DefaultTable.DefaultTable): + """Linear Threshold table + + The ``LTSH`` table contains per-glyph settings indicating the ppem sizes + at which the advance width metric should be scaled linearly, despite the + effects of any TrueType instructions that might otherwise alter the + advance width. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/ltsh + """ + def decompile(self, data, ttFont): version, numGlyphs = struct.unpack(">HH", data[:4]) data = data[4:] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/M_A_T_H_.py b/contrib/python/fonttools/fontTools/ttLib/tables/M_A_T_H_.py index 011426b52a1..35d29e9b13e 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/M_A_T_H_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/M_A_T_H_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_M_A_T_H_(BaseTTXConverter): + """Mathematical Typesetting table + + The ``MATH`` table contains a variety of information needed to + typeset glyphs in mathematical formulas and expressions. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/math + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/M_E_T_A_.py b/contrib/python/fonttools/fontTools/ttLib/tables/M_E_T_A_.py index 445aeb4dea3..6a6f8bbf840 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/M_E_T_A_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/M_E_T_A_.py @@ -68,6 +68,13 @@ def getLabelString(labelID): class table_M_E_T_A_(DefaultTable.DefaultTable): + """Glyphlets META table + + The ``META`` table is used by Adobe's SING Glyphlets. + + See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html + """ + dependencies = [] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/M_V_A_R_.py b/contrib/python/fonttools/fontTools/ttLib/tables/M_V_A_R_.py index 8371795eb2f..c7e7e90fb49 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/M_V_A_R_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/M_V_A_R_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_M_V_A_R_(BaseTTXConverter): + """Metrics Variations table + + The ``MVAR`` table contains variation information for font-wide + metrics in a variable font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/mvar + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py b/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py index 0c739bcc444..9a7e5f70bb9 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/O_S_2f_2.py @@ -113,7 +113,14 @@ OS2_format_5_addition = bigendian + OS2_format_5_addition class table_O_S_2f_2(DefaultTable.DefaultTable): - """the OS/2 table""" + """OS/2 and Windows Metrics table + + The ``OS/2`` table contains a variety of font-wide metrics and + parameters that may be useful to an operating system or other + software for system-integration purposes. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/os2 + """ dependencies = ["head"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/S_I_N_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/S_I_N_G_.py index 4522c06c6bd..1a367a92f2f 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/S_I_N_G_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/S_I_N_G_.py @@ -20,6 +20,13 @@ SINGFormat = """ class table_S_I_N_G_(DefaultTable.DefaultTable): + """Glyphlets SING table + + The ``SING`` table is used by Adobe's SING Glyphlets. + + See also https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html + """ + dependencies = [] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/S_T_A_T_.py b/contrib/python/fonttools/fontTools/ttLib/tables/S_T_A_T_.py index 1769de91b5f..86e1271a981 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/S_T_A_T_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/S_T_A_T_.py @@ -2,4 +2,14 @@ from .otBase import BaseTTXConverter class table_S_T_A_T_(BaseTTXConverter): + """Style Attributes table + + The ``STAT`` table records stylistic or typeface-design attributes that + differentiate the individual fonts within a font family from one another. + Those attributes can be used to assist users when navigating the style + variations of a variable font or a family of static fonts. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/S_V_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/S_V_G_.py index ebc2befdfe8..76e860c5f62 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/S_V_G_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/S_V_G_.py @@ -51,6 +51,14 @@ doc_index_entry_format_0Size = sstruct.calcsize(doc_index_entry_format_0) class table_S_V_G_(DefaultTable.DefaultTable): + """Scalable Vector Graphics table + + The ``SVG`` table contains representations for glyphs in the SVG + image format. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/stat + """ + def decompile(self, data, ttFont): self.docList = [] # Version 0 is the standardized version of the table; and current. diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_f.py b/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_f.py index 324ffd01651..876fef3cbaa 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_f.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_f.py @@ -343,7 +343,10 @@ class _Object: class table_S__i_l_f(DefaultTable.DefaultTable): - """Silf table support""" + """Graphite Rules table + + See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables + """ def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_l.py b/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_l.py index 12b0b8f6cc5..61106ea5284 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_l.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/S__i_l_l.py @@ -12,6 +12,11 @@ Sill_hdr = """ class table_S__i_l_l(DefaultTable.DefaultTable): + """Graphite Languages table + + See also https://graphite.sil.org/graphite_techAbout#graphite-font-tables + """ + def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) self.langs = {} diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_B_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_B_.py index 8a6c14c4445..ea19fcee856 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_B_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_B_.py @@ -1,3 +1,11 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSIB contains the source text for the ``BASE`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .T_S_I_V_ import table_T_S_I_V_ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_C_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_C_.py index 573b3f9c397..14e353cde58 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_C_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_C_.py @@ -1,3 +1,12 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSIC contains the source text for the Variation CVT window and data for +the ``cvar`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .otBase import BaseTTXConverter diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_D_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_D_.py index 536ff2f98a0..2bb9455efae 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_D_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_D_.py @@ -1,3 +1,11 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSID contains the source text for the ``GDEF`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .T_S_I_V_ import table_T_S_I_V_ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_J_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_J_.py index bc8fe92aac9..379b949c6cd 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_J_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_J_.py @@ -1,3 +1,11 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSIJ contains the source text for the ``JSTF`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .T_S_I_V_ import table_T_S_I_V_ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_P_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_P_.py index 1abc02590c2..8b178697048 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_P_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_P_.py @@ -1,3 +1,11 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSIP contains the source text for the ``GPOS`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .T_S_I_V_ import table_T_S_I_V_ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_S_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_S_.py index 667eb0e5347..91f36e7c019 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_S_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_S_.py @@ -1,3 +1,11 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +TSIS contains the source text for the ``GSUB`` table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from .T_S_I_V_ import table_T_S_I_V_ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_V_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_V_.py index d7aec4589c5..32af783f26b 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_V_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_V_.py @@ -1,3 +1,9 @@ +""" TSI{B,C,D,J,P,S,V} are private tables used by Microsoft Visual TrueType (VTT) +tool to store its table source data. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables +""" + from fontTools.misc.textTools import strjoin, tobytes, tostr from . import asciiTable diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py index 77905822a8a..0d0e61a1cd3 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__0.py @@ -4,6 +4,8 @@ tool to store its hinting source data. TSI0 is the index table containing the lengths and offsets for the glyph programs and 'extra' programs ('fpgm', 'prep', and 'cvt') that are contained in the TSI1 table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables """ from . import DefaultTable diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py index a9d04a09b02..b0b851cc788 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py @@ -3,6 +3,8 @@ tool to store its hinting source data. TSI1 contains the text of the glyph programs in the form of low-level assembly code, as well as the 'extra' programs 'fpgm', 'ppgm' (i.e. 'prep'), and 'cvt'. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables """ from . import DefaultTable diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py index 163ef45226d..63608c60414 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__2.py @@ -4,6 +4,8 @@ tool to store its hinting source data. TSI2 is the index table containing the lengths and offsets for the glyph programs that are contained in the TSI3 table. It uses the same format as the TSI0 table. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables """ from fontTools import ttLib diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py index 604a7f0bebb..e866826db48 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__3.py @@ -2,6 +2,8 @@ tool to store its hinting source data. TSI3 contains the text of the glyph programs in the form of 'VTTTalk' code. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables """ from fontTools import ttLib diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py index d86798695ca..24078b22561 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__5.py @@ -2,6 +2,8 @@ tool to store its hinting source data. TSI5 contains the VTT character groups. + +See also https://learn.microsoft.com/en-us/typography/tools/vtt/tsi-tables """ from fontTools.misc.textTools import safeEval diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/T_T_F_A_.py b/contrib/python/fonttools/fontTools/ttLib/tables/T_T_F_A_.py index e3cf2db2d74..4b6b06871a9 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/T_T_F_A_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/T_T_F_A_.py @@ -2,4 +2,13 @@ from . import asciiTable class table_T_T_F_A_(asciiTable.asciiTable): + """ttfautohint parameters table + + The ``TTFA`` table is used by the free-software `ttfautohint` program + to record the parameters that `ttfautohint` was called with when it + was used to auto-hint the font. + + See also http://freetype.org/ttfautohint/doc/ttfautohint.html#miscellaneous-1 + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/V_A_R_C_.py b/contrib/python/fonttools/fontTools/ttLib/tables/V_A_R_C_.py index 5a00887160c..afc1497d14f 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/V_A_R_C_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/V_A_R_C_.py @@ -2,4 +2,11 @@ from .otBase import BaseTTXConverter class table_V_A_R_C_(BaseTTXConverter): + """Variable Components table + + The ``VARC`` table contains variation information for composite glyphs. + + See also https://github.com/harfbuzz/boring-expansion-spec/blob/main/VARC.md + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/V_D_M_X_.py b/contrib/python/fonttools/fontTools/ttLib/tables/V_D_M_X_.py index 0632173cd90..6f8abc46de9 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/V_D_M_X_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/V_D_M_X_.py @@ -37,6 +37,14 @@ VDMX_vTableFmt = """ class table_V_D_M_X_(DefaultTable.DefaultTable): + """Vertical Device Metrics table + + The ``VDMX`` table records changes to the vertical glyph minima + and maxima that result from Truetype instructions. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/vdmx + """ + def decompile(self, data, ttFont): pos = 0 # track current position from to start of VDMX table dummy, data = sstruct.unpack2(VDMX_HeaderFmt, data, self) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py b/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py index b08737b224b..2c53acba431 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/V_O_R_G_.py @@ -4,11 +4,18 @@ import struct class table_V_O_R_G_(DefaultTable.DefaultTable): - """This table is structured so that you can treat it like a dictionary keyed by glyph name. + """Vertical Origin table + + The ``VORG`` table contains the vertical origin of each glyph + in a `CFF` or `CFF2` font. + + This table is structured so that you can treat it like a dictionary keyed by glyph name. ``ttFont['VORG'][<glyphName>]`` will return the vertical origin for any glyph. ``ttFont['VORG'][<glyphName>] = <value>`` will set the vertical origin for any glyph. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/vorg """ def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/V_V_A_R_.py b/contrib/python/fonttools/fontTools/ttLib/tables/V_V_A_R_.py index a3665fea5ec..c0c94e348b2 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/V_V_A_R_.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/V_V_A_R_.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table_V_V_A_R_(BaseTTXConverter): + """Vertical Metrics Variations table + + The ``VVAR`` table contains variation data for per-glyph vertical metrics + in a variable font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/vvar + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_a_n_k_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_a_n_k_r.py index d1062ecc7bf..5466d42d411 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_a_n_k_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_a_n_k_r.py @@ -2,11 +2,12 @@ from .otBase import BaseTTXConverter class table__a_n_k_r(BaseTTXConverter): - """ + """Anchor Point table + The anchor point table provides a way to define anchor points. These are points within the coordinate space of a given glyph, independent of the control points used to render the glyph. - Anchor points are used in conjunction with the 'kerx' table. + Anchor points are used in conjunction with the ``kerx`` table. See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ankr.html """ diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_a_v_a_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_a_v_a_r.py index 19f4f2cda4a..8b96bcef386 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_a_v_a_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_a_v_a_r.py @@ -22,7 +22,7 @@ from .otBase import BaseTTXConverter class table__a_v_a_r(BaseTTXConverter): - """Axis Variations Table + """Axis Variations table This class represents the ``avar`` table of a variable font. The object has one substantive attribute, ``segments``, which maps axis tags to a segments dictionary:: @@ -43,6 +43,8 @@ class table__a_v_a_r(BaseTTXConverter): ``avar`` segment mapping must contain the entries ``-1.0: -1.0, 0.0: 0.0, 1.0: 1.0``. fontTools does not enforce this, so it is your responsibility to ensure that mappings are valid. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/avar """ dependencies = ["fvar"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_b_s_l_n.py b/contrib/python/fonttools/fontTools/ttLib/tables/_b_s_l_n.py index 8e266fa54d0..85796b0a047 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_b_s_l_n.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_b_s_l_n.py @@ -3,4 +3,13 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bsln.html class table__b_s_l_n(BaseTTXConverter): + """Baseline table + + The AAT ``bsln`` table is similar in purpose to the OpenType ``BASE`` + table; it stores per-script baselines to support automatic alignment + of lines of text. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bsln.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_c_i_d_g.py b/contrib/python/fonttools/fontTools/ttLib/tables/_c_i_d_g.py index f11901baebf..c283e5a4dd1 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_c_i_d_g.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_c_i_d_g.py @@ -3,7 +3,9 @@ from .otBase import BaseTTXConverter class table__c_i_d_g(BaseTTXConverter): - """The AAT ``cidg`` table has almost the same structure as ``gidc``, + """CID to Glyph ID table + + The AAT ``cidg`` table has almost the same structure as ``gidc``, just mapping CIDs to GlyphIDs instead of the reverse direction. It is useful for fonts that may be used by a PDF renderer in lieu of @@ -14,6 +16,9 @@ class table__c_i_d_g(BaseTTXConverter): obsoleted by ``cidg``. For example, the first font in ``/System/Library/Fonts/PingFang.ttc`` - (which Apple ships pre-installed on MacOS 10.12.6) has a ``cidg`` table.""" + (which Apple ships pre-installed on MacOS 10.12.6) has a ``cidg`` table. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gcid.html + """ pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_c_m_a_p.py b/contrib/python/fonttools/fontTools/ttLib/tables/_c_m_a_p.py index 484c331cb77..04be2848509 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_c_m_a_p.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_c_m_a_p.py @@ -54,6 +54,8 @@ class table__c_m_a_p(DefaultTable.DefaultTable): cmap = newTable("cmap") cmap.tableVersion = 0 cmap.tables = [cmap4_0_3] + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cmap """ def getcmap(self, platformID, platEncID): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_a_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_a_r.py index 6ea44dbab3b..872710c8f0c 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_a_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_a_r.py @@ -24,6 +24,14 @@ CVAR_HEADER_SIZE = sstruct.calcsize(CVAR_HEADER_FORMAT) class table__c_v_a_r(DefaultTable.DefaultTable): + """Control Value Table (CVT) variations table + + The ``cvar`` table contains variations for the values in a ``cvt`` + table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cvar + """ + dependencies = ["cvt ", "fvar"] def __init__(self, tag=None): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_t.py index 7f94677522e..92c50a1b8d6 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_c_v_t.py @@ -5,6 +5,14 @@ import array class table__c_v_t(DefaultTable.DefaultTable): + """Control Value Table + + The Control Value Table holds a list of values that can be referenced + by TrueType font instructions. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/cvt + """ + def decompile(self, data, ttFont): values = array.array("h") values.frombytes(data) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_f_e_a_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/_f_e_a_t.py index c9a48eff06c..8e279db0059 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_f_e_a_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_f_e_a_t.py @@ -2,11 +2,14 @@ from .otBase import BaseTTXConverter class table__f_e_a_t(BaseTTXConverter): - """The feature name table is an AAT (Apple Advanced Typography) table for + """Feature name table + + The feature name table is an AAT (Apple Advanced Typography) table for storing font features, settings, and their human-readable names. It should not be confused with the ``Feat`` table or the OpenType Layout ``GSUB``/``GPOS`` - tables. See `Feature Name Table <https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6feat.html>`_ - in the TrueType Reference Manual for more information on the structure and - purpose of this table.""" + tables. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6feat.html + """ pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_f_p_g_m.py b/contrib/python/fonttools/fontTools/ttLib/tables/_f_p_g_m.py index df23041d656..ba8e0488deb 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_f_p_g_m.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_f_p_g_m.py @@ -3,6 +3,17 @@ from . import ttProgram class table__f_p_g_m(DefaultTable.DefaultTable): + """Font Program table + + The ``fpgm`` table typically contains function defintions that are + used by font instructions. This Font Program is similar to the Control + Value Program that is stored in the ``prep`` table, but + the ``fpgm`` table is only executed one time, when the font is first + used. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/fpgm + """ + def decompile(self, data, ttFont): program = ttProgram.Program() program.fromBytecode(data) diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_f_v_a_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_f_v_a_r.py index a3bdacd4cc8..f2536cb288a 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_f_v_a_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_f_v_a_r.py @@ -43,6 +43,14 @@ FVAR_INSTANCE_FORMAT = """ class table__f_v_a_r(DefaultTable.DefaultTable): + """FonT Variations table + + The ``fvar`` table contains records of the variation axes and of the + named instances in a variable font. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fvar.html + """ + dependencies = ["name"] def __init__(self, tag=None): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_g_a_s_p.py b/contrib/python/fonttools/fontTools/ttLib/tables/_g_a_s_p.py index 10c32a87f4b..1f605771e9b 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_g_a_s_p.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_g_a_s_p.py @@ -10,6 +10,14 @@ GASP_GRIDFIT = 0x0001 class table__g_a_s_p(DefaultTable.DefaultTable): + """Grid-fitting and Scan-conversion Procedure table + + The ``gasp`` table defines the preferred rasterization settings for + the font when rendered on monochrome and greyscale output devices. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/gasp + """ + def decompile(self, data, ttFont): self.version, numRanges = struct.unpack(">HH", data[:4]) assert 0 <= self.version <= 1, "unknown 'gasp' format: %s" % self.version diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_g_c_i_d.py b/contrib/python/fonttools/fontTools/ttLib/tables/_g_c_i_d.py index 2e746c846fa..9d6d6ae4253 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_g_c_i_d.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_g_c_i_d.py @@ -3,4 +3,11 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gcid.html class table__g_c_i_d(BaseTTXConverter): + """Glyph ID to CID table + + The AAT ``gcid`` table stores glyphID-to-CID mappings. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gcid.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_g_l_y_f.py b/contrib/python/fonttools/fontTools/ttLib/tables/_g_l_y_f.py index bc7d4bf1e45..92b69e70b1f 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_g_l_y_f.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_g_l_y_f.py @@ -54,7 +54,7 @@ SCALE_COMPONENT_OFFSET_DEFAULT = 0 # 0 == MS, 1 == Apple class table__g_l_y_f(DefaultTable.DefaultTable): - """Glyph Data Table + """Glyph Data table This class represents the `glyf <https://docs.microsoft.com/en-us/typography/opentype/spec/glyf>`_ table, which contains outlines for glyphs in TrueType format. In many cases, diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_g_v_a_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_g_v_a_r.py index cdc9ef8e76a..39c1707a9d0 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_g_v_a_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_g_v_a_r.py @@ -3,6 +3,7 @@ from functools import partial from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval from fontTools.misc.lazyTools import LazyDict +from fontTools.ttLib.tables.TupleVariation import TupleVariation from . import DefaultTable import array import itertools @@ -11,10 +12,7 @@ import struct import sys import fontTools.ttLib.tables.TupleVariation as tv - log = logging.getLogger(__name__) -TupleVariation = tv.TupleVariation - # https://www.microsoft.com/typography/otspec/gvar.htm # https://www.microsoft.com/typography/otspec/otvarcommonformats.htm @@ -41,6 +39,16 @@ GVAR_HEADER_SIZE = sstruct.calcsize(GVAR_HEADER_FORMAT) class table__g_v_a_r(DefaultTable.DefaultTable): + """Glyph Variations table + + The ``gvar`` table provides the per-glyph variation data that + describe how glyph outlines in the ``glyf`` table change across + the variation space that is defined for the font in the ``fvar`` + table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/gvar + """ + dependencies = ["fvar", "glyf"] def __init__(self, tag=None): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_h_d_m_x.py b/contrib/python/fonttools/fontTools/ttLib/tables/_h_d_m_x.py index b6d56a7e708..1ec913de152 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_h_d_m_x.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_h_d_m_x.py @@ -31,6 +31,14 @@ class _GlyphnamedList(Mapping): class table__h_d_m_x(DefaultTable.DefaultTable): + """Horizontal Device Metrics table + + The ``hdmx`` table is an optional table that stores advance widths for + glyph outlines at specified pixel sizes. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/hdmx + """ + def decompile(self, data, ttFont): numGlyphs = ttFont["maxp"].numGlyphs glyphOrder = ttFont.getGlyphOrder() diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_h_e_a_d.py b/contrib/python/fonttools/fontTools/ttLib/tables/_h_e_a_d.py index fe29c8fc4ff..dcadf68a275 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_h_e_a_d.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_h_e_a_d.py @@ -37,6 +37,13 @@ headFormat = """ class table__h_e_a_d(DefaultTable.DefaultTable): + """Font Header table + + The ``head`` table contains a variety of font-wide information. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/head + """ + dependencies = ["maxp", "loca", "CFF ", "CFF2"] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_h_h_e_a.py b/contrib/python/fonttools/fontTools/ttLib/tables/_h_h_e_a.py index 43e464f74ff..1f051e499ce 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_h_h_e_a.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_h_h_e_a.py @@ -31,6 +31,18 @@ hheaFormat = """ class table__h_h_e_a(DefaultTable.DefaultTable): + """Horizontal Header table + + The ``hhea`` table contains information needed during horizontal + text layout. + + .. note:: + This converter class is kept in sync with the :class:`._v_h_e_a.table__v_h_e_a` + table constructor. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/hhea + """ + # Note: Keep in sync with table__v_h_e_a dependencies = ["hmtx", "glyf", "CFF ", "CFF2"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_h_m_t_x.py b/contrib/python/fonttools/fontTools/ttLib/tables/_h_m_t_x.py index 2dbdd7f9850..43d49b09256 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_h_m_t_x.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_h_m_t_x.py @@ -12,6 +12,15 @@ log = logging.getLogger(__name__) class table__h_m_t_x(DefaultTable.DefaultTable): + """Horizontal Metrics table + + The ``hmtx`` table contains per-glyph metrics for the glyphs in a + ``glyf``, ``CFF ``, or ``CFF2`` table, as needed for horizontal text + layout. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/hmtx + """ + headerTag = "hhea" advanceName = "width" sideBearingName = "lsb" diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py b/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py index 270b3b7e445..cdbaebedc63 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_k_e_r_n.py @@ -12,6 +12,17 @@ log = logging.getLogger(__name__) class table__k_e_r_n(DefaultTable.DefaultTable): + """Kerning table + + The ``kern`` table contains values that contextually adjust the inter-glyph + spacing for the glyphs in a ``glyf`` table. + + Note that similar contextual spacing adjustments can also be stored + in the "kern" feature of a ``GPOS`` table. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/kern + """ + def getkern(self, format): for subtable in self.kernTables: if subtable.format == format: diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_l_c_a_r.py b/contrib/python/fonttools/fontTools/ttLib/tables/_l_c_a_r.py index 1323b670d0c..bbb32d23d9d 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_l_c_a_r.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_l_c_a_r.py @@ -2,4 +2,12 @@ from .otBase import BaseTTXConverter class table__l_c_a_r(BaseTTXConverter): + """Ligature Caret table + + The AAT ``lcar`` table stores division points within ligatures, which applications + can use to position carets properly between the logical parts of the ligature. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6lcar.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_l_o_c_a.py b/contrib/python/fonttools/fontTools/ttLib/tables/_l_o_c_a.py index 39c0c9e39ba..713a6eaffc2 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_l_o_c_a.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_l_o_c_a.py @@ -8,6 +8,14 @@ log = logging.getLogger(__name__) class table__l_o_c_a(DefaultTable.DefaultTable): + """Index to Location table + + The ``loca`` table stores the offsets in the ``glyf`` table that correspond + to the descriptions of each glyph. The glyphs are references by Glyph ID. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/loca + """ + dependencies = ["glyf"] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_l_t_a_g.py b/contrib/python/fonttools/fontTools/ttLib/tables/_l_t_a_g.py index 24f5e131f0c..fc47cd648bc 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_l_t_a_g.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_l_t_a_g.py @@ -6,6 +6,14 @@ import struct class table__l_t_a_g(DefaultTable.DefaultTable): + """Language Tag table + + The AAT ``ltag`` table contains mappings between the numeric codes used + in the language field of the ``name`` table and IETF language tags. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ltag.html + """ + def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) self.version, self.flags = 1, 0 diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_m_a_x_p.py b/contrib/python/fonttools/fontTools/ttLib/tables/_m_a_x_p.py index 95b6ab93359..c1576a578f2 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_m_a_x_p.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_m_a_x_p.py @@ -27,6 +27,14 @@ maxpFormat_1_0_add = """ class table__m_a_x_p(DefaultTable.DefaultTable): + """Maximum Profile table + + The ``maxp`` table contains the memory requirements for the data in + the font. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/maxp + """ + dependencies = ["glyf"] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_m_e_t_a.py b/contrib/python/fonttools/fontTools/ttLib/tables/_m_e_t_a.py index 3af9e543049..c5cea1b993e 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_m_e_t_a.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_m_e_t_a.py @@ -24,6 +24,14 @@ DATA_MAP_FORMAT = """ class table__m_e_t_a(DefaultTable.DefaultTable): + """Metadata table + + The ``meta`` table contains various metadata values for the font. Each + category of metadata in the table is identified by a four-character tag. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/meta + """ + def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) self.data = {} diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_t.py index 261e593e27f..5e5fa77ce73 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_t.py @@ -3,4 +3,12 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6mort.html class table__m_o_r_t(BaseTTXConverter): + """The AAT ``mort`` table contains glyph transformations used for script shaping and + for various other optional smart features. + + Note: ``mort`` has been deprecated in favor of the newer ``morx`` table. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6mort.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_x.py b/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_x.py index da299c6d858..dfb3abcc5e3 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_x.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_m_o_r_x.py @@ -3,4 +3,13 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html class table__m_o_r_x(BaseTTXConverter): + """The AAT ``morx`` table contains glyph transformations used for script shaping and + for various other optional smart features, akin to ``GSUB`` and ``GPOS`` features + in OpenType Layout. + + Note: ``morx`` is a replacement for the now deprecated ``mort`` table. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_n_a_m_e.py b/contrib/python/fonttools/fontTools/ttLib/tables/_n_a_m_e.py index e30086adb35..3fd1cdb4834 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_n_a_m_e.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_n_a_m_e.py @@ -36,6 +36,16 @@ nameRecordSize = sstruct.calcsize(nameRecordFormat) class table__n_a_m_e(DefaultTable.DefaultTable): + """Naming table + + The ``name`` table is used to store a variety of strings that can be + associated with user-facing font information. Records in the ``name`` + table can be tagged with language tags to support multilingual naming + and can support platform-specific character-encoding variants. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/name + """ + dependencies = ["ltag"] def decompile(self, data, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_o_p_b_d.py b/contrib/python/fonttools/fontTools/ttLib/tables/_o_p_b_d.py index b22af216bb2..b4c5f568290 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_o_p_b_d.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_o_p_b_d.py @@ -3,4 +3,12 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6opbd.html class table__o_p_b_d(BaseTTXConverter): + """Optical Bounds table + + The AAT ``opbd`` table contains optical boundary points for glyphs, which + applications can use for the visual alignment of lines of text. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6opbd.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_p_o_s_t.py b/contrib/python/fonttools/fontTools/ttLib/tables/_p_o_s_t.py index dba637117a0..fca0812f984 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_p_o_s_t.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_p_o_s_t.py @@ -27,6 +27,15 @@ postFormatSize = sstruct.calcsize(postFormat) class table__p_o_s_t(DefaultTable.DefaultTable): + """PostScript table + + The ``post`` table contains information needed to use the font on + PostScript printers, including the PostScript names of glyphs and + data that was stored in the ``FontInfo`` dictionary for Type 1 fonts. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/post + """ + def decompile(self, data, ttFont): sstruct.unpack(postFormat, data[:postFormatSize], self) data = data[postFormatSize:] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_e_p.py b/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_e_p.py index b4b92f3e924..cf4a5dd24f2 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_e_p.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_e_p.py @@ -4,4 +4,13 @@ superclass = ttLib.getTableClass("fpgm") class table__p_r_e_p(superclass): + """Control Value Program table + + The ``prep`` table contains TrueType instructions that can makee font-wide + alterations to the Control Value Table. It may potentially be executed + before any glyph is processed. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/prep + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_o_p.py b/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_o_p.py index aead9d72062..1d7de8098de 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_o_p.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_p_r_o_p.py @@ -3,4 +3,10 @@ from .otBase import BaseTTXConverter # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6prop.html class table__p_r_o_p(BaseTTXConverter): + """The AAT ``prop`` table can store a variety of per-glyph properties, such as + Unicode directionality or whether glyphs are non-spacing marks. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6prop.html + """ + pass diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_s_b_i_x.py b/contrib/python/fonttools/fontTools/ttLib/tables/_s_b_i_x.py index 29b82c3e43e..a282ea9a60d 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_s_b_i_x.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_s_b_i_x.py @@ -28,6 +28,16 @@ sbixStrikeOffsetFormatSize = sstruct.calcsize(sbixStrikeOffsetFormat) class table__s_b_i_x(DefaultTable.DefaultTable): + """Standard Bitmap Graphics table + + The ``sbix`` table stores bitmap image data in standard graphics formats + like JPEG, PNG, or TIFF. The glyphs for which the ``sbix`` table provides + data are indexed by Glyph ID. For each such glyph, the ``sbix`` table can + hold different data for different sizes, called "strikes." + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/sbix + """ + def __init__(self, tag=None): DefaultTable.DefaultTable.__init__(self, tag) self.version = 1 diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_t_r_a_k.py b/contrib/python/fonttools/fontTools/ttLib/tables/_t_r_a_k.py index 0d1b313eaef..b0e8e19e08a 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_t_r_a_k.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_t_r_a_k.py @@ -58,6 +58,13 @@ PER_SIZE_VALUE_FORMAT_SIZE = struct.calcsize(PER_SIZE_VALUE_FORMAT) class table__t_r_a_k(DefaultTable.DefaultTable): + """The AAT ``trak`` table can store per-size adjustments to each glyph's + sidebearings to make when tracking is enabled, which applications can + use to provide more visually balanced line spacing. + + See also https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html + """ + dependencies = ["name"] def compile(self, ttFont): diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_v_h_e_a.py b/contrib/python/fonttools/fontTools/ttLib/tables/_v_h_e_a.py index de7ce245ad6..9c6fa3aefe2 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_v_h_e_a.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_v_h_e_a.py @@ -31,6 +31,18 @@ vheaFormat = """ class table__v_h_e_a(DefaultTable.DefaultTable): + """Vertical Header table + + The ``vhea`` table contains information needed during vertical + text layout. + + .. note:: + This converter class is kept in sync with the :class:`._h_h_e_a.table__h_h_e_a` + table constructor. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/vhea + """ + # Note: Keep in sync with table__h_h_e_a dependencies = ["vmtx", "glyf", "CFF ", "CFF2"] diff --git a/contrib/python/fonttools/fontTools/ttLib/tables/_v_m_t_x.py b/contrib/python/fonttools/fontTools/ttLib/tables/_v_m_t_x.py index a13304c321f..32662fc6a25 100644 --- a/contrib/python/fonttools/fontTools/ttLib/tables/_v_m_t_x.py +++ b/contrib/python/fonttools/fontTools/ttLib/tables/_v_m_t_x.py @@ -4,6 +4,15 @@ superclass = ttLib.getTableClass("hmtx") class table__v_m_t_x(superclass): + """Vertical Metrics table + + The ``vmtx`` table contains per-glyph metrics for the glyphs in a + ``glyf``, ``CFF ``, or ``CFF2`` table, as needed for vertical text + layout. + + See also https://learn.microsoft.com/en-us/typography/opentype/spec/vmtx + """ + headerTag = "vhea" advanceName = "height" sideBearingName = "tsb" diff --git a/contrib/python/fonttools/ya.make b/contrib/python/fonttools/ya.make index d01a0e414f3..a5f677fa7df 100644 --- a/contrib/python/fonttools/ya.make +++ b/contrib/python/fonttools/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(4.55.2) +VERSION(4.55.3) LICENSE(MIT) |
