Mark positioning, script-aware GPOS/GSUB feature lookup, and ligature feature-tag support (#2503) - #2507
Merged
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
Renders mark-to-base positioning, makes GPOS/GSUB feature lookup
script-aware, and exposes ligature feature selection through
PdfPageSettings. Closes #2503.Changes
MarkToBaseProvidernow computes pen-relative,additive offsets (HarfBuzz convention);
PdfContentStreamreadsXOffset/YOffsetviaTsand pairedTJadjustments.ScriptFeatureResolverfiltersFeatureListentries byScriptList/LangSysinstead of tag alone.Fixes a real defect where an
arab-onlykernrecord leaked intoLatin text. Applied across all six GPOS/GSUB processors (kerning,
single adjustment, mark-to-base, ligatures, chaining contextual,
single substitution).
LigatureProcessornow reads tags fromGsubFeaturesinstead of a hardcoded"liga", and unwrapsextension-wrapped (Type 7) ligature lookups, which GSUB does not
flatten the way GPOS does.
GsubFeature/GposFeatureflag enums andPdfPageSettings.GsubFeatures/GposFeatures, wired throughPdfTextShaper.Verification
Confirmed in exported PDFs:
Ánow aligns with its precomposedcontrol glyph, a previously leaking
periodno longer receives aTsoffset, and EBGaramond'sdligmerges "Th" into a single,measurably narrower ligature glyph when requested. Extensive unit
test coverage, including synthetic-table regression tests for the
script-leak defect.
Known gaps
(same fix, same pattern as the tested ones).