Repository navigation
Accept fonts without an OS/2 table in add_font() - #2191
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
andersonhc
approved these changes
Nov 13, 2026
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_font()fails on theCourier.ttcandLastResort.otfof macOS:The
OS/2table is required on Windows but optional in Apple fonts (TrueType Reference Manual), and these two fonts don't have one.TTFFontread four things from it: the cap height, which already falls back tohhea.ascent, the weight class, and the strikeout position and size.Without an
OS/2table, the weight now comes from the bold bit ofhead.macStyle(700 or 400), the cap height falls back tohhea.ascentas before, and strikethrough uses the same position and size as the core fonts (250 and 50). Fonts with anOS/2table are read as before.test_add_font_without_os2_tableremoves theOS/2table of DejaVuSans and DejaVuSans-Bold at run time, so no font file is added. It draws struck-out text and checks the strikeout metrics and the FORCE_BOLD flag; both cases fail on master. Changelog entry under 2.9.1 / Fixed.