Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skrifa] detect "tricky" fonts by family name #1305

Merged
merged 4 commits into from
Jan 8, 2025
Merged

[skrifa] detect "tricky" fonts by family name #1305

merged 4 commits into from
Jan 8, 2025

Conversation

dfrg
Copy link
Member

@dfrg dfrg commented Jan 7, 2025

Implements the family name part of FreeType's "tricky" font detection. This is sufficient to address the problematic font in #1303.

Adds an OutlineGlyphCollection::require_interpreter() method that can be used to determine if hinting (with the interpreter engine) is required to correctly render glyphs from the font.

FreeType has some additional checks on length/checksums of various tables. I'll do that in a follow up.

dfrg added 2 commits January 7, 2025 15:48
Implements the family name part of FreeType's "tricky" font detection. This is sufficient to address the problematic font in #1303.

Adds an `OutlineGlyphCollection::require_interpreter()` method that can be used to determine if hinting (with the interpreter engine) is required to correctly render glyphs from the font.

FreeType has some additional checks on length/checksums of various tables. I'll do that in a follow up.
dfrg added a commit that referenced this pull request Jan 7, 2025
Adds support for detecting trickiness based on checksum/length of the cvt, fpgm and prep tables. Note: I'm not able to actually find any of these fonts to test with.

Also, to avoid redundancy, moves some checksum computation code out of write-fonts into read-fonts and makes it public.

Based on #1305 which should land first.
@dfrg dfrg mentioned this pull request Jan 7, 2025
Copy link
Contributor

@drott drott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additions, LGTM with some naming suggestions.

skrifa/src/outline/tricky.rs Outdated Show resolved Hide resolved
skrifa/src/outline/tricky.rs Outdated Show resolved Hide resolved
skrifa/src/outline/tricky.rs Outdated Show resolved Hide resolved
skrifa/src/outline/mod.rs Show resolved Hide resolved
skrifa/src/outline/tricky.rs Outdated Show resolved Hide resolved
dfrg added 2 commits January 8, 2025 10:20
Generally avoid using the "tricky" FreeType-ism in names and comments
@dfrg dfrg merged commit ffbb038 into main Jan 8, 2025
10 checks passed
@dfrg dfrg deleted the tricky-names branch January 8, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants