googlefonts / googlefonts/fontmake

fontmake [ufo2ft] fails to build from Glyphs file when contextual kern references MMK classes

Open
#506 4 comments 0 reactions 1 assignee Claimed by @anthrotype View on GitHub
Dominant language
Python
Stars
888
Forks
97
Avg merge
4d 52m
Merged PRs (30d)
1

Description

I have a Glyphs file with contextual kerning added like

![customkern](https://user-images.githubusercontent.com/11257204/51652197-a4394f80-1f43-11e9-9ebe-9f1bee4255df.png)

and it references kern classes that are only built by Glyphs on export. So something like this
![glyphs_kern_class](https://user-images.githubusercontent.com/11257204/51652128-64726800-1f43-11e9-8ee1-b9457fc19f16.png)
becomes `@MMK_L_myclass`

Exporting from Glyphs is fine because it builds the GPOS automatically and then appends this custom kern to that before compiling. Unfortunately, with fontmake and ufo2ft these are processed in the reverse order and also no MMK classes get created. So during `ufo2ft.featureCompiler.parseLayoutFeatures` it fails to parse this lookup because there is no class `@MMK_L_myclass`, first because that class no longer exists at all and second because it tries to parse the existing features before running KernFeatureWriter.

Here is a simplified test file to show the behaviour, but the real file is a much bigger Noto source with many references to MMK_L and MMK_R classes.
[TestMe.glyphs.zip](https://github.com/googlei18n/fontmake/files/2790070/TestMe.glyphs.zip)

It's easy enough to hack my ufo2ft to make it keep this info in order, but that also means I have to replace `kern1.` with `MMK_L_` and `kern2.` with `MMK_R_` which is absolutely not the way we want to do this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.