Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect 'Propagate Anchors' custom parameter #1308

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

felipesanches
Copy link
Member

@felipesanches felipesanches commented Feb 28, 2025

I've tested this by running ttx_diff on notofonts/arabic/sources/NotoSansArabic.glyphspackage and got these improvements:

COMPARISON Before After
(mark / kern) 29.249% Identical
GDEF 56.062% Identical
GPOS 87.500% Identical
ligcaret 34.043% Identical

(issue #889)

@anthrotype
Copy link
Member

thanks. Could you also add a test?

you could create a minimal test font in Glyphs.app with two glyphs, a simple one with an anchor, and a composite glyph using the latter as component. You also add the Propagate Anchors custom param set to false. Pass it through the resources/scripts/tidy_glyphs.py python script before committing to get rid of unwated stuff (timestamps etc.).

then in your test you would simply Font::load the test file and assert that the composite glyph gets no propagated anchors

@felipesanches
Copy link
Member Author

@anthrotype, I have attempted to create the test, but I am still not getting good results. Can you help me understand what I'm doing wrong here?

@felipesanches
Copy link
Member Author

I'm getting this panic:

thread 'propagate_anchors::tests::dont_propagate_anchors' panicked at glyphs-reader/src/propagate_anchors.rs:1038:9:
assertion failed: glyph.layers.first().unwrap().anchors.is_empty()

My reasoning here is that:

  • I know that the glyph "Aacute" exists
  • I know that it has a single layer, so .layers.first().unwrap() should be fine
  • I expect it not to have anchors and since .anchors is a Vec<Anchor>, then it should be fine to use .is_empty()

But I must have missed something, because it panics... What do you think?

@cmyr
Copy link
Member

cmyr commented Feb 28, 2025

the panic is just saying that the test failed, and it failed because apparently anchors isn't empty, so something unexpected is going on..

@cmyr
Copy link
Member

cmyr commented Feb 28, 2025

okay the issue seems to be that the "Propagate Anchors" custom param is set on the master, not on the font?

@felipesanches
Copy link
Member Author

okay the issue seems to be that the "Propagate Anchors" custom param is set on the master, not on the font?

Yep! Thanks! Just moved it and the check now passes.

I've tested this by running ttx_diff on
notofonts/arabic/sources/NotoSansArabic.glyphspackage
and got these improvements:

|   COMPARISON  | Before  |   After   |
| ------------- | ------- | --------- |
| (mark / kern) | 29.249% | Identical |
|     GDEF      | 56.062% | Identical |
|     GPOS      | 87.500% | Identical |
|   ligcaret    | 34.043% | Identical |

(issue googlefonts#889)
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@cmyr cmyr added this pull request to the merge queue Feb 28, 2025
Merged via the queue into googlefonts:main with commit 04a0ccb Feb 28, 2025
12 checks passed
@felipesanches felipesanches deleted the issue_889 branch March 1, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants