Repository navigation
Fix #811: unnamed glyphs of an installed font stay in their type - #939
Merged
Merged
Conversation
In a PDF (or the PDF part of an .ai file), a glyph of a subset font that no ToUnicode map, CID table or character map of the font program names was drawn as outlines, so one text object came in split: "RADA" as the type "ADA" plus the R's outline. Such a glyph is now looked for in the installed face of the font's name: the first character (of those single-byte fonts encode: ASCII, Latin-1, Latin Extended-A, punctuation, the euro and trade mark signs, fi and fl) whose glyph draws the same outline, point for point within 2/1000 em, names it. A subset carries the font's own outlines, so an installed copy of the same font finds every glyph. Other versions of the font, empty glyphs and glyphs that are no character still keep their outlines, with the warning as before. Results are cached per glyph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #811.
In a PDF, or the PDF part of an
.aifile, a subset-font glyph that nothing names (no ToUnicode entry, no CID table, no character map in the embedded font program) was drawn as outlines. One text object then came in split: "RADA" became the type "ADA" plus the R's outline.Now, when the font is installed, such a glyph is looked up there by its outline (
identify_glyphincrates/pdf/src/import.rs):.aifiles with editing data don't need this: their type comes from the text document (#637). It covers plain PDFs and the PDF part.Tested:
cargo xtask ci(all 7 steps); all 218vectorcraft-pdftests.glyphs_are_named_only_by_an_exact_outline: R, a, 7, & and é are found by their outlines; the same outline moved by a tenth of an em, and an empty outline, are not.🤖 Generated with Claude Code