Fix interpreter issues and prevent multple kerning operations #489
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.
Prerequisites
Description
This pull request introduces several important improvements and bug fixes to the font rendering engine, focusing on glyph positioning, kerning, and TrueType hinting. The changes enhance correctness, efficiency, and maintainability, particularly in the handling of glyph state and the implementation of the TrueType interpreter. Additionally, some code modernizations and new test reference images are included.
Glyph Positioning and Kerning Improvements
IsPositioned) and kerning (IsKerned) states inGlyphShapingData, preventing redundant processing and ensuring accurate state propagation during glyph shaping and kerning. The kerning logic now checks and setsIsKernedto avoid double application.TextLayoutby avoiding redundant updates for consecutiveTextRuns using the same font.TrueType Interpreter Bug Fixes and Enhancements
TrueTypeInterpreter, including:OnCurveflag for the correct point index.iupXCalledflag in the IUP instruction.Roundfunction to precisely match FreeType v40's rounding semantics, ensuring correct and consistent rendering across all rounding modes.Documentation and Code Modernization
TrueTypeInterpreter, detailing the reference model and behavioral expectations for modern and legacy fonts.Testing