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

[fea-rs] Tweak sort order of aalt rules #1228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[fea-rs] Tweak sort order of aalt rules #1228

wants to merge 1 commit into from

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Jan 31, 2025

The aalt feature has special behaviour where rules are supposed to be added to aalt from other features, in the order that those features are listed in the aalt block.

Unfortunately, since a given feature can exist for multiple languagesystems and contain different lookups for each, there is still ambiguity to the order in which rules are to be added.

Previously (and without much intention) we were adding rules in the order that the features would end up in the feature list; that is, within a feature we were adding rules based on the sorting order of the language systems.

This didn't match fonttools, where rules are added in the order that they are declared in the target feature.

With this patch, we match fonttools by re-sorting the lookups for a given feature based on the lookup id, which is an effective proxy for "when was this rule declared".

The aalt feature has special behaviour where rules are supposed to be
added to aalt from other features, in the order that those features are
listed in the aalt block.

Unfortunately, since a given feature can exist for multiple
languagesystems and contain different lookups for each, there is still
ambiguity to the order in which rules are to be added.

Previously (and without much intention) we were adding rules in the
order that the features would end up in the feature list; that is,
within a feature we were adding rules based on the sorting order of the
language systems.

This didn't match fonttools, where rules are added in the order that
they are declared in the target feature.

With this patch, we match fonttools by re-sorting the lookups for a
given feature based on the lookup id, which is an effective proxy
for "when was this rule declared".
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.

1 participant