Repository navigation
Reconstruct transformed WOFF2 glyphs when subsetting - #412
Open
snowyukitty wants to merge 4 commits into
Open
snowyukitty wants to merge 4 commits into
snowyukitty wants to merge 4 commits into
Conversation
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 #201.
Subsetting a transformed WOFF2 TrueType font currently copies transformed
glyfbytes as ordinary TrueType records. The regression cases demonstrate incorrect outlines and buffer bounds errors.Reconstruct glyph records from decoded points, contour ends, instructions and component records, remapping component IDs and writing long
locaoffsets. Preserve point indices used by hint programs, composite transforms and overlap flags. Native regressions cover repeated encoding, empty glyphs and variation metrics with a reproducible, original test font. A generated contourless composite also checks that stored nonzero bounds and its bearing survive the upstream empty-path box change.The latest merge preserves upstream #426's ordinary TrueType variation handling (including composite flattening and varied bearings), #427's HVAR rounding and #415's layout fixes. Transformed WOFF2 uses its separate reconstruction path, retaining component records and hint point indices.
Transformed
hmtxremains unsupported and produces an explicit error. Non-default variation subsets can differ from a reference instancer in coordinates, bounding boxes, advance/bearing metrics and component offsets;cvaradjustments are not instantiated. This does not add a general variable-font instancer.Validation on Linux after merging master
2dee1a31b6673847d1cc8fd702e98ba2cbd51f81:npm run prepublish,npm run format:checkandnpm test: 718 passing, 7 pending on Node 22.23.1, 24.18.0 and 26.12.1.npm run mocha -- test/subset.jsgives 12 intended failures, 16 passing controls and 1 pending test. The upstream ordinary-TrueType variation regressions pass in this comparison and on the merged candidate.Both sets of changelog entries are preserved. No dependencies change.