#2509 - Consult cmap format 14 (UVS) in shaping and subsetting - #2510
Open
swmal wants to merge 1 commit into
Open
#2509 - Consult cmap format 14 (UVS) in shaping and subsetting#2510swmal wants to merge 1 commit into
swmal wants to merge 1 commit 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.
Summary
cmap format 14 (Unicode Variation Sequences) was parsed into
CmapSubtable14but never consulted during shaping, so a base character followed by a variation selector always rendered the default glyph instead of the registered variant (common in CJK).Changes
CmapTable: newTryGetGlyphId(base, selector)lookup against format 14.TextShaper.MapToGlyphs: lookahead that consumes a registered pair into one glyph.CmapSubsetProcessor: preserves variation-sequence data used by subsetted text, so the embedded PDF font matches the full font.CmapTableserialization: stopped dropping format 14 subtables; fixed a subtable-dedup bug this uncovered.CmapTableLoader/CmapSubtable14Deserializer: wired in and fixed existing-but-unused format 14 parsing (position wasn't restored between selector records).Testing
Unit tests for the lookup, shaping lookahead (BMP and surrogate-pair selectors), and a subsetting round-trip parity test. Full
EPPlus.Fonts.OpenTypesuite (410 tests) green. Manually verified via PDF export (BIZ UDGothic, U+585A + VS01) - distinct glyph IDs, confirmed visually.