[fonttools/fonttools] d3cc5d: [subset] bug fix

1 view
Skip to first unread message

Cosimo Lupo

unread,
Jun 15, 2026, 7:27:12 AM (10 days ago) Jun 15
to fontto...@googlegroups.com
Branch: refs/heads/fix_math
Home: https://github.com/fonttools/fonttools
Commit: d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
https://github.com/fonttools/fonttools/commit/d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
Author: Qunxin Liu <qx...@google.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)

Changed paths:
M Lib/fontTools/subset/__init__.py

Log Message:
-----------
[subset] bug fix

No need to keep constructions for glyphs that are only added
during math closure.
See also: https://github.com/harfbuzz/harfbuzz/issues/5998


Commit: cad385b594dad8d29774d5139fe569dee9c69878
https://github.com/fonttools/fonttools/commit/cad385b594dad8d29774d5139fe569dee9c69878
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-15 (Mon, 15 Jun 2026)

Changed paths:
A Tests/subset/data/test_math_closure.ttx
M Tests/subset/subset_test.py

Log Message:
-----------
[subset] add regression test for MATH closure construction fix

A glyph pulled into the subset only by MATH variant closure must not
keep its own MathGlyphConstruction. Closure is a single pass, so the
variants such a construction references are not themselves closed over,
and keeping it leaves dangling references to glyphs absent from the
subset. The existing MATH test fonts never place a size variant in its
own coverage, so they cannot exercise this; this test builds a font
that does.


Compare: https://github.com/fonttools/fonttools/compare/d3cc5d0a3e8f%5E...cad385b594da

To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications

Cosimo Lupo

unread,
Jun 15, 2026, 7:27:38 AM (10 days ago) Jun 15
to fontto...@googlegroups.com
Branch: refs/heads/main
Home: https://github.com/fonttools/fonttools
Commit: d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
https://github.com/fonttools/fonttools/commit/d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
Author: Qunxin Liu <qx...@google.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)

Changed paths:
M Lib/fontTools/subset/__init__.py

Log Message:
-----------
[subset] bug fix

No need to keep constructions for glyphs that are only added
during math closure.
See also: https://github.com/harfbuzz/harfbuzz/issues/5998


Commit: cd3a16cbec652b32549c851cb7bcb3d659005b01
https://github.com/fonttools/fonttools/commit/cd3a16cbec652b32549c851cb7bcb3d659005b01
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-15 (Mon, 15 Jun 2026)

Changed paths:
M Lib/fontTools/subset/__init__.py

Log Message:
-----------
Merge pull request #4096 from qxliu76/fix_math

[subset] bug fix for MATH table


Compare: https://github.com/fonttools/fonttools/compare/c5d5359f7ab9...cd3a16cbec65

Behdad Esfahbod

unread,
Jun 18, 2026, 1:46:10 PM (7 days ago) Jun 18
to fontto...@googlegroups.com
Branch: refs/heads/beyond-64k
Home: https://github.com/fonttools/fonttools
Commit: d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
https://github.com/fonttools/fonttools/commit/d3cc5d0a3e8f272c0f23fc5243e2bd533f3d6180
Author: Qunxin Liu <qx...@google.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)

Changed paths:
M Lib/fontTools/subset/__init__.py

Log Message:
-----------
[subset] bug fix

No need to keep constructions for glyphs that are only added
during math closure.
See also: https://github.com/harfbuzz/harfbuzz/issues/5998


Commit: cd3a16cbec652b32549c851cb7bcb3d659005b01
https://github.com/fonttools/fonttools/commit/cd3a16cbec652b32549c851cb7bcb3d659005b01
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-15 (Mon, 15 Jun 2026)

Changed paths:
M Lib/fontTools/subset/__init__.py

Log Message:
-----------
Merge pull request #4096 from qxliu76/fix_math

[subset] bug fix for MATH table


Commit: 0dbc9eab01ccc6f285350c82e2e35a4f2e52919b
https://github.com/fonttools/fonttools/commit/0dbc9eab01ccc6f285350c82e2e35a4f2e52919b
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-15 (Mon, 15 Jun 2026)

Changed paths:
A Tests/subset/data/test_math_closure.ttx
M Tests/subset/subset_test.py

Log Message:
-----------
[subset] add regression test for MATH closure construction fix

A glyph pulled into the subset only by MATH variant closure must not
keep its own MathGlyphConstruction. Closure is a single pass, so the
variants such a construction references are not themselves closed over,
and keeping it leaves dangling references to glyphs absent from the
subset. The existing MATH test fonts never place a size variant in its
own coverage, so they cannot exercise this; this test builds a font
that does.


Commit: 275cda908415f40d4fb09826e54a053fc2b01d56
https://github.com/fonttools/fonttools/commit/275cda908415f40d4fb09826e54a053fc2b01d56
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Make glyph-to-group construction accessible outside of lookup function

This improves ergonomics for constructing glyph-to-group mappings prior
to repeated kern lookups: you get the convenience of fonttools
constructing the mappings, but avoid the repeated cost on each call.


Commit: 687a952196821cd0578f8d512eec52f29818c3d8
https://github.com/fonttools/fonttools/commit/687a952196821cd0578f8d512eec52f29818c3d8
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Fix documentation typo


Commit: 151a34cda30daa5d6b48de4435fba2e48f3afb67
https://github.com/fonttools/fonttools/commit/151a34cda30daa5d6b48de4435fba2e48f3afb67
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Fix type typo in groups argument docs

Co-authored-by: Cosimo Lupo <cos...@anthrotype.com>


Commit: 04e45da730fca80aa84f33f8ccf02643ce656a54
https://github.com/fonttools/fonttools/commit/04e45da730fca80aa84f33f8ccf02643ce656a54
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Document accelerated example


Commit: 02e6c1837245dc07086552e77d0b54d5a312e04c
https://github.com/fonttools/fonttools/commit/02e6c1837245dc07086552e77d0b54d5a312e04c
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Clarify groups argument docs further, in both functions


Commit: ac8bca59919d4075e07f090d98cc5905dbe24319
https://github.com/fonttools/fonttools/commit/ac8bca59919d4075e07f090d98cc5905dbe24319
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Document that groups are expected to be pre-validated


Commit: 431ca5771611e98cfe06876802fa8ee11485ca28
https://github.com/fonttools/fonttools/commit/431ca5771611e98cfe06876802fa8ee11485ca28
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_g_l_y_f.py
M Tests/ttLib/tables/_g_l_y_f_test.py

Log Message:
-----------
[glyf] Use reverse glyph map for O(1) __setitem__ membership

table__g_l_y_f.__setitem__ tested `glyphName not in self.glyphOrder`, a linear
scan of the glyphOrder list on every assignment, so repeatedly assigning glyphs
over a pre-populated glyphOrder was O(n^2) in the glyph count -- several seconds
of pure scanning for a 60k-glyph font.

Use the reverse glyph map (_reverseGlyphOrder) for O(1) membership instead,
rebuilding it when it is missing or its length no longer matches glyphOrder, and
invalidating it on __delitem__. Reordering goes through setGlyphOrder, which
already clears the map; editing glyphOrder directly behind the table's back is
unsupported.

Related to #2605, a separate correctness issue (the TTFont-level
_reverseGlyphOrderDict going stale, see #3582), not changed here.


Commit: 3b44a54ae741a257ecbb31305dc59800ebe9ebd0
https://github.com/fonttools/fonttools/commit/3b44a54ae741a257ecbb31305dc59800ebe9ebd0
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ufoLib/kerning.py

Log Message:
-----------
Merge pull request #4102 from daltonmaag/kerning-groups-helper

[ufoLib] Make glyph-to-group construction accessible outside of lookup function


Commit: 77d5fa9f80ae708224c0ae29dd71c877c34dd97c
https://github.com/fonttools/fonttools/commit/77d5fa9f80ae708224c0ae29dd71c877c34dd97c
Author: Harry Dalton <harry....@daltonmaag.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Doc/source/index.rst

Log Message:
-----------
Update minimum version in docs


Commit: 541c1d52019e5a974cbf64f52833729fcd3b4c4f
https://github.com/fonttools/fonttools/commit/541c1d52019e5a974cbf64f52833729fcd3b4c4f
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-17 (Wed, 17 Jun 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_g_l_y_f.py
M Tests/ttLib/tables/_g_l_y_f_test.py

Log Message:
-----------
Merge pull request #4103 from fonttools/glyf-setitem-perf

[glyf] Use reverse glyph map for O(1) __setitem__ membership


Commit: c5c6b5c8a00edfad60cffe96cadb8d993dd49ac1
https://github.com/fonttools/fonttools/commit/c5c6b5c8a00edfad60cffe96cadb8d993dd49ac1
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-06-18 (Thu, 18 Jun 2026)

Changed paths:
M Doc/source/index.rst

Log Message:
-----------
Merge pull request #4104 from daltonmaag/min-version-in-docs

Update minimum version in docs


Commit: 92931fd8d61ef842200f23496f143b22f7c51e0c
https://github.com/fonttools/fonttools/commit/92931fd8d61ef842200f23496f143b22f7c51e0c
Author: Behdad Esfahbod <beh...@behdad.org>
Date: 2026-06-18 (Thu, 18 Jun 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/otTables.py
M Tests/ttLib/tables/otTables_test.py

Log Message:
-----------
Avoid false success resolving lookup overflows


Commit: fc858f5809f36431f6dca34e73cf423401d38740
https://github.com/fonttools/fonttools/commit/fc858f5809f36431f6dca34e73cf423401d38740
Author: Behdad Esfahbod <beh...@behdad.org>
Date: 2026-06-18 (Thu, 18 Jun 2026)

Changed paths:

Log Message:
-----------
Merge branch 'main' into beyond-64k


Compare: https://github.com/fonttools/fonttools/compare/65fa9bfd09b0...fc858f5809f3
Reply all
Reply to author
Forward
0 new messages