Repository navigation
fix(font): bound SFNT output and encode names correctly - #1057
Merged
Merged
Conversation
andiwand
force-pushed
the
review/38-sfnt-cmap-bounds
branch
from
October 5, 2026 11:03
e1ebcf7 to
f470f38
Compare
A std::string_view converts to std::string only explicitly, so the copy initialization from table_data did not compile, and main did not build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
A CFF name may hold any bytes, and the UTF-16 conversion of the name table threw on them, so the font could not be written. Invalid sequences now become U+FFFD. The pua_cmap comment again says why an entry past numGlyphs is dropped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
andiwand
force-pushed
the
review/39-sfnt-serialization
branch
from
October 5, 2026 11:31
8bb6c57 to
53fde49
Compare
andiwand
added a commit
that referenced
this pull request
Oct 5, 2026
The embedded fonts of the PDF outputs changed with #1057. Only the font data URIs differ. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
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.
🤖 Generated with Claude Code
Large BMP character maps could wrap format 4's 16-bit length; U+FFFF mappings collided with its terminator. Use format 12 in both cases and reject code points outside Unicode.
Encode synthesized font names as UTF-16BE, limit PostScript names to valid characters and 63 bytes, and share repeated name strings. Validate name lengths, table tags/counts and output offsets before narrowing. Shorten the writer's API comments.
Validation: 63 targeted font/PDF-font tests and three PDF corpus cases pass. Three focused regressions exercise the format-size boundary, Unicode/name limits and invalid directories. Name constraints follow the OpenType name specification.