Preserve explicit anchors during smart component instantiation#1892
Merged
anthrotype merged 2 commits intomainfrom Feb 16, 2026
Merged
Preserve explicit anchors during smart component instantiation#1892anthrotype merged 2 commits intomainfrom
anthrotype merged 2 commits intomainfrom
Conversation
When a glyph uses smart components and also has its own explicit anchors with the same name, the smart component's interpolated anchors should not replace the glyph's explicit ones. This test currently fails.
e1b0866 to
e4c5cb2
Compare
Smart component anchor interpolation was unconditionally replacing the parent glyph's explicit anchors with interpolated values from the smart component parts. Now the glyph's own anchors take precedence, and smart component anchors are only added when no explicit anchor with that name exists. Fixes #1892
Member
Author
|
test fails as expected https://github.com/googlefonts/fontc/actions/runs/22074119486/job/63785379035?pr=1892#step:6:344 Diff < left / right > :
Some(
(
< 250.0,
< 600.0,
> 300.0,
> 700.0,
),
) |
rsheeter
approved these changes
Feb 16, 2026
Contributor
rsheeter
left a comment
There was a problem hiding this comment.
Appreciate the test comments!
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.
When a glyph uses smart components and also has its own explicit anchors, the smart component's interpolated anchors should not override them. The glyph's explicit anchors represent the designer's intent and take precedence over anchors propagated from smart component parts. This is consistent with similar logic in propagate_anchors.rs.
This PR fixes anchor position regressions in fonts like NotoSansNandinagari where Indic conjuncts (e.g.
KaCa.Nnagari) had hand-placed anchors that were incorrectly being replaced by interpolated smart component values.I first push a failing regression test
smart_component_preserves_explicit_anchorswith dedicated test fixture, then follow up with the actual fix.Verified against NotoSansNandinagari: mark/kern goes from 99.240% to identical with fontmake (glyphsLib 6.12.7)