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

Reorder class definitions in feature writers #725

Merged
merged 5 commits into from Mar 8, 2023

Conversation

simoncozens
Copy link
Contributor

This fixes one of the issues in #506 - that is, when the mark feature writer is run more than once (for example, for abvm and then for mark), the mark class definitions that it emits can end up after the lookups which use those definitions, causing the font to fail to compile. Instead of trying to carefully work out where to place the definitions, we simply put them at the top of the feature file.

This also rewrites the feature writer test class to detect new statements wherever they occur in the feature file, not simply statements which have been appended.

Copy link
Member

@anthrotype anthrotype left a comment

Choose a reason for hiding this comment

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

LGTM (pending test fixups)

(i wish feaLib didn't care about mark class definition appearing before mark lookups)

@khaledhosny
Copy link
Collaborator

(i wish feaLib didn't care about mark class definition appearing before mark lookups)

What is that?

@anthrotype
Copy link
Member

i was referring to the fact that mark class definitions appearing after the lookups which use those definitions cause the font to fail to compile, as Simon pointed out

@khaledhosny
Copy link
Collaborator

i was referring to the fact that mark class definitions appearing after the lookups which use those definitions cause the font to fail to compile, as Simon pointed out

I see. It is probably some makeotf limitation feaLib copied, if we can relax this then we should (probably it can be relaxed since the lookups are built after the parsing). Please open a FontTools issue if you think this should happen.

@simoncozens simoncozens merged commit 00a9627 into main Mar 8, 2023
@khaledhosny khaledhosny deleted the reorder-class-writers branch March 8, 2023 21:59
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.

None yet

3 participants