Skip to content

• feat(fonts): add variable font instancing for PDF embedding Phase_1 - #278

Open
NicTanghe wants to merge 1 commit into
fschutt:masterfrom
NicTanghe:master
Open

• feat(fonts): add variable font instancing for PDF embedding Phase_1#278
NicTanghe wants to merge 1 commit into
fschutt:masterfrom
NicTanghe:master

Conversation

@NicTanghe

Copy link
Copy Markdown

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.

  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.
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.

1 participant