Skip to content

More robust glyph drawing - #5159

Merged
laurmaedje merged 3 commits into
mainfrom
outline-vs-frame-glyphs
Oct 10, 2024
Merged

laurmaedje merged 3 commits into
mainfrom
outline-vs-frame-glyphs

Conversation

@laurmaedje

@laurmaedje laurmaedje commented Oct 8, 2024 •

Copy link
Copy Markdown
Member

This

  • Changes the logic which selects whether we export normal PDF text or use a Type 3 font to encode a glyph. In particular, this introduces a new is_outlinable function which returns true if:

    • The font has a glyf or CFF table
    • And the font doesn't contain a PNG (and thus color) bitmap, COLR, or SVG glyph for the glyph in question

    As a result, only glyphs that are actually outlinable should ever reach the subsetter, fixing Failed subsetting for bitmap fonts #4572.

  • The glyph_frame function does not panic anymore. Instead it will generate a fallback tofu if there was a conversion problem (and fail PDF/A export if enabled with "the glyph for {} could not be exported" including a hint for CFF2 fonts). This would trigger, for instance, for bitmap fonts that don't have a glyf or CFF table.

Fixes #4572

Alternative to #4929

@laurmaedje
laurmaedje force-pushed the outline-vs-frame-glyphs branch from 55c9b77 to ee0abcb Compare October 8, 2024 12:19
@laurmaedje
laurmaedje force-pushed the outline-vs-frame-glyphs branch from ee0abcb to 3902a60 Compare October 8, 2024 12:23
Comment thread crates/typst-render/src/text.rs Resolved
@laurmaedje
laurmaedje added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit 6257e4d Oct 10, 2024
@laurmaedje
laurmaedje deleted the outline-vs-frame-glyphs branch October 10, 2024 12:12
laurmaedje added a commit that referenced this pull request Oct 15, 2024
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
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.

Failed subsetting for bitmap fonts

2 participants