[fonttools/fonttools] d57f6e: [otlLib] buildCoverage: return empty Coverage inst...

0 views
Skip to first unread message

Cosimo Lupo

unread,
Dec 12, 2025, 7:04:06 AM (4 days ago) Dec 12
to fontto...@googlegroups.com
Branch: refs/heads/mark-glyph-sets-non-null-empty-coverage
Home: https://github.com/fonttools/fonttools
Commit: d57f6e6fdf52a3f395b3b554a7cc44d5c7cd0ccd
https://github.com/fonttools/fonttools/commit/d57f6e6fdf52a3f395b3b554a7cc44d5c7cd0ccd
Author: Cosimo Lupo <cl...@google.com>
Date: 2025-12-12 (Fri, 12 Dec 2025)

Changed paths:
M Lib/fontTools/otlLib/builder.py
M Tests/otlLib/builder_test.py

Log Message:
-----------
[otlLib] buildCoverage: return empty Coverage instead of None

Per the OpenType spec, coverage offsets that are not explicitly
documented as nullable must not be NULL. Changed buildCoverage()
to always return a Coverage object (with empty glyphs list if no
glyphs supplied) instead of returning None.

This fixes null offsets being written in GDEF MarkGlyphSetsDef
coverage arrays, and other coverage offset arrays like
BacktrackCoverage, InputCoverage, and LookAheadCoverage.

Fixes #4003



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

Cosimo Lupo

unread,
Dec 12, 2025, 7:56:44 AM (4 days ago) Dec 12
to fontto...@googlegroups.com
Branch: refs/heads/main
Home: https://github.com/fonttools/fonttools
Commit: d57f6e6fdf52a3f395b3b554a7cc44d5c7cd0ccd
https://github.com/fonttools/fonttools/commit/d57f6e6fdf52a3f395b3b554a7cc44d5c7cd0ccd
Author: Cosimo Lupo <cl...@google.com>
Date: 2025-12-12 (Fri, 12 Dec 2025)

Changed paths:
M Lib/fontTools/otlLib/builder.py
M Tests/otlLib/builder_test.py

Log Message:
-----------
[otlLib] buildCoverage: return empty Coverage instead of None

Per the OpenType spec, coverage offsets that are not explicitly
documented as nullable must not be NULL. Changed buildCoverage()
to always return a Coverage object (with empty glyphs list if no
glyphs supplied) instead of returning None.

This fixes null offsets being written in GDEF MarkGlyphSetsDef
coverage arrays, and other coverage offset arrays like
BacktrackCoverage, InputCoverage, and LookAheadCoverage.

Fixes #4003


Commit: 0ca5b379815dd199c6271533f0eb94f98bf5c562
https://github.com/fonttools/fonttools/commit/0ca5b379815dd199c6271533f0eb94f98bf5c562
Author: Cosimo Lupo <cl...@google.com>
Date: 2025-12-12 (Fri, 12 Dec 2025)

Changed paths:
M Tests/feaLib/data/empty_filter_sets_and_mark_classes.ttx

Log Message:
-----------
update expected feaLib test empty_filter_sets_and_mark_classes.ttx


Commit: aa405c9bd7e0621b7f479a669620344768c1543e
https://github.com/fonttools/fonttools/commit/aa405c9bd7e0621b7f479a669620344768c1543e
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2025-12-12 (Fri, 12 Dec 2025)

Changed paths:
M Lib/fontTools/otlLib/builder.py
M Tests/feaLib/data/empty_filter_sets_and_mark_classes.ttx
M Tests/otlLib/builder_test.py

Log Message:
-----------
Merge pull request #4004 from fonttools/mark-glyph-sets-non-null-empty-coverage

[otlLib] buildCoverage: return empty Coverage instead of None


Compare: https://github.com/fonttools/fonttools/compare/e988f85cdeee...aa405c9bd7e0
Reply all
Reply to author
Forward
0 new messages