Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Use stable ConditionSet sort order #164

Merged
merged 1 commit into from
Jun 26, 2023
Merged

Use stable ConditionSet sort order #164

merged 1 commit into from
Jun 26, 2023

Conversation

cmyr
Copy link
Owner

@cmyr cmyr commented Jun 23, 2023

I don't believe this is mentioned anywhere in the spec, but it is an important detail: the sort order of conditionsets in the FeatureVariations table has meaningful impact on whether a variation is applied, since we apply the first set of variations that is encountered.

With this patch, we match the order used by fonttools, which is (as far as I can deduce) based on the order in which a given conditionset is first referenced by a lookup.

There is some behaviour in fonttools I still do not fully understand, so I will open a discussion issue there.

I don't believe this is mentioned anywhere in the spec, but it is an
important detail: the sort order of conditionsets in the
FeatureVariations table has meaningful impact on whether a variation is
applied, since we apply the first set of variations that is encountered.

With this patch, we match the order used by fonttools, which is (as far
as I can deduce) based on the order in which a given conditionset is
first referenced by a lookup.
Copy link
Collaborator

@dfrg dfrg left a comment

Choose a reason for hiding this comment

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

Cosimo can better address the sort order question but the code LGTM.

@cmyr cmyr merged commit 28d8685 into main Jun 26, 2023
3 checks passed
@cmyr cmyr deleted the condset-sort-order branch June 26, 2023 19:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants