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

[features] Share more code, do less work #1289

Merged
merged 2 commits into from
Feb 21, 2025
Merged

[features] Share more code, do less work #1289

merged 2 commits into from
Feb 21, 2025

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Feb 20, 2025

In order to compile both marks & kern we need to have already compiled the GSUB table. To avoid doing this repeatedly, we now compile it immediately after parsing the AST, and then make it available to the mark & kern feature writers.

We also similarly store the explicit GDEF classes, if they were in the FEA, and try to share more code between mark & kern generation in general.

This also includes a commit that makes us convert glyph names to glyph ids earlier in the marks compilation process, which similarly helps us share more code with kerning.

(all of this is motivated by work on abvm and blwm)

In order to compile both marks & kern we need to have already compiled
the GSUB table. To avoid doing this repeatedly, we now compile it
immediately after parsing the AST, and then make it available to the
mark & kern feature writers.

We also similarly store the explicit GDEF classes, if they were in the
FEA, and try to share more code between mark & kern generation in
general.
@cmyr cmyr force-pushed the share-compiled-gsub branch from ce127af to cfbcbd8 Compare February 21, 2025 18:00
This is more efficient, and better matches what we're doing in kern
which will let us more easily share code.
@cmyr cmyr force-pushed the share-compiled-gsub branch from cfbcbd8 to df05d78 Compare February 21, 2025 18:05
Copy link
Member

@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.

I'm not very familiar with the details of fea compilation but the changes here make sense to me and the code looks good.

@cmyr cmyr added this pull request to the merge queue Feb 21, 2025
Merged via the queue into main with commit 5d85bcb Feb 21, 2025
12 checks passed
@cmyr cmyr deleted the share-compiled-gsub branch February 21, 2025 20:40
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.

2 participants