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

Fix glyph swap #1043

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Fix glyph swap #1043

wants to merge 9 commits into from

Conversation

yanone
Copy link
Contributor

@yanone yanone commented Sep 26, 2023

Fixing duplication of rule-based glyph swaps

Closes #1042

@yanone
Copy link
Contributor Author

yanone commented Sep 26, 2023

About the build fail:

Please help me make sense of this: in test_rules_are_applied_deterministically() it appears that rules should be applied several times, as the test checks to compare against outlines of "Q.ss01.alt".

I added a warning to the main code that prints:
WARNING root:instantiator.py:174 Duplicate rule for ('Q', 'Q.ss01') in location {'Weight': 900.0, 'Style': 0.5}: ('Q', 'Q.alt'), meaning that ('Q', 'Q.alt') was already applied (= in the list), and now ('Q', 'Q.ss01') will be rejected for duplication.

If we're on the correct trajectory here, I think I should indeed check for the whole tuple (oldName, newName) to already exist, not just for oldName.

@anthrotype
Copy link
Member

@belluzj added that test in #689 when he fixed some bug about processing rules, maybe he could also take a quick look?

@yanone
Copy link
Contributor Author

yanone commented Sep 26, 2023

Well, the test makes sense as far as the UFO test data goes. (The .ss01 swap is a bit unfortunate of an example because a stylistic set is typically implemented as a GSUB substitution, but okay, the UFO is clear on this.)

The commit I just posted (checks for whole tuple like in the beginning) fixes the test. But I think we want to go over this one more time and see whether this is truly the correct approach and maybe why the duplicate swap exists there in the first place.

Adding Simon as a reviewer.

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.

Variation alternates not processed for statics
2 participants