• feat(fonts): add variable font instancing for PDF embedding Phase_1 - #278
Open
NicTanghe wants to merge 1 commit into
Open
• feat(fonts): add variable font instancing for PDF embedding Phase_1#278NicTanghe wants to merge 1 commit into
NicTanghe wants to merge 1 commit into
Conversation
Add APIs for inspecting variation axes and creating static font instances from arbitrary axis coordinates before shaping and embedding. Support TrueType glyf/gvar and CFF2 fonts, reject unresolved variation tables during serialization, and allow multiple instances of one source font in a document. Re-enable font subsetting with correct glyph ID remapping, add CFF2-to-CFF1 conversion, and cover full and subset embedding with OFL test fixtures. Automatic HTML/CSS variation selection remains outside this change because it requires integration with Azul's font selection and shaping pipeline.
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 APIs for inspecting variation axes and creating static font
instances from arbitrary axis coordinates before shaping and embedding.
Support TrueType glyf/gvar and CFF2 fonts, reject unresolved variation
tables during serialization, and allow multiple instances of one source
font in a document.
Re-enable font subsetting with correct glyph ID remapping, add CFF2-to-CFF1
conversion, and cover full and subset embedding with OFL test fixtures.
Automatic HTML/CSS variation selection remains outside this change because
it requires integration with Azul's font selection and shaping pipeline.
HTML/Azul limitation
printpdf’s HTML renderer uses azul_layout for CSS font selection, shaping, and
layout. The current Azul interface does not pass computed variable-font coordinates
into font loading/shaping. Consequently, CSS such as font-weight: 800 or font-
variation-settings: "wght" 800 does not yet select a corresponding instance from a
single variable-font file.
This PR implements explicit variable-font instancing through the Rust API. Supporting
automatic HTML/CSS axis selection requires a follow-up change at the Azul font-
manager boundary. Normal CSS font-weight selection between separate static font files
remains unaffected.