Serialized font metrics for SVG measurement, with font engine cleanup - #2496
Open
swmal wants to merge 4 commits into
Open
Serialized font metrics for SVG measurement, with font engine cleanup#2496swmal wants to merge 4 commits into
swmal wants to merge 4 commits into
Conversation
…nericFontTextShaper
…nts class and all references.
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.
Adds a metrics-based text measurement path so SVG export can measure and line-break text even when the requested font isn't available as a font file.
OpenTypeFontEngine.GetMeasurementShaperreturns anITextShaperthat may be backed by serialized .fmtr metrics instead of a parsed font, andLayoutSystemnow uses it.PDF export is unaffected by design.
PdfTextShaperconstructsTextShaperdirectly from a provider and never goes through the engine's shaper resolution, so it cannot receive a metrics-only shaper. The split is enforced by return type:GetTextShaperstill returnsTextShaperwith glyph ids,GetMeasurementShaperreturns the narrower interface.The fallback engages only after the user-configured and built-in fallback chains are exhausted, since a real metric-compatible substitute beats quantized metrics.
Configuration
Also in this PR
FontStoreandShaperCacheextracted fromOpenTypeFontEngine,FontDiscoveryandFontSubFamilyConvertersplit out, and theOpenTypeFontsstatic facade removed along withGetFromBytesandGetFontSubFamily.Breaking
Those three public removals, and the new
WhenFontMissingdefault changes measured widths on machines lacking the requested font.