Skip to content

Tell ufo2ft mark feature writer to use mark prefix for mark classes#1121

Closed
khaledhosny wants to merge 1 commit intomainfrom
mark-writer-class-prefix
Closed

Tell ufo2ft mark feature writer to use mark prefix for mark classes#1121
khaledhosny wants to merge 1 commit intomainfrom
mark-writer-class-prefix

Conversation

@khaledhosny
Copy link
Copy Markdown
Collaborator

ufo2ft default to MC prefix for mark classes, but Glyphs uses mark, since feature code can reference auto generated code, we want to match Glyphs here.

Depends on googlefonts/ufo2ft#965

ufo2ft default to `MC` prefix for mark classes, but Glyphs uses `mark`,
since feature code can reference auto generated code, we want to match
Glyphs here.

Depends on googlefonts/ufo2ft#965
@khaledhosny
Copy link
Copy Markdown
Collaborator Author

khaledhosny commented Dec 22, 2025

The regression test failures are just the new key being written to UFOs. It will fix itself once this PR is merged.

@khaledhosny khaledhosny requested a review from anthrotype January 3, 2026 09:55
@anthrotype
Copy link
Copy Markdown
Member

anthrotype commented Jan 13, 2026

FYI I'm not ignoring this, the reason I haven't merged this (and the companion ufo2ft PR) is that I need to think about how this particular change would play out in fontc (which is supposed to track fontmake)

@khaledhosny
Copy link
Copy Markdown
Collaborator Author

FYI I'm not ignoring this, the reason I haven't merged this (and the companion ufo2ft PR) is that I need to think about how this particular change would play out in fontc (which is supposed to track fontmake)

No problem. IIUC, fontc does not generate feature code that way ufo2ft or Glyphs app do, it instead compiles to binary lookups directly. So I don’t think something like this is going to work with current fontc architecture as there are no generated mark class names to reference. Referencing generated code It is a niche Glyphs trick, so I think it is OK if fontc does not support it for now (it will already fail to build any font that references the generated code, e.g. the generated kerning classes) with or without this change.

@khaledhosny
Copy link
Copy Markdown
Collaborator Author

FYI I'm not ignoring this, the reason I haven't merged this (and the companion ufo2ft PR) is that I need to think about how this particular change would play out in fontc (which is supposed to track fontmake)

No problem. IIUC, fontc does not generate feature code that way ufo2ft or Glyphs app do, it instead compiles to binary lookups directly. So I don’t think something like this is going to work with current fontc architecture as there are no generated mark class names to reference. Referencing generated code It is a niche Glyphs trick, so I think it is OK if fontc does not support it for now (it will already fail to build any font that references the generated code, e.g. the generated kerning classes) with or without this change.

I have a font that already references @MC_* classes, and it does not work with fontc (for other reasons as well). It also does not work in Glyphs app, and the change here and in ufo2ft is to make it possible to have the font working in both Glyphs app and fontmake.

@khaledhosny
Copy link
Copy Markdown
Collaborator Author

Not needed now that ufo2ft will change the default prefix (googlefonts/ufo2ft#974).

@khaledhosny khaledhosny closed this Mar 9, 2026
@khaledhosny khaledhosny deleted the mark-writer-class-prefix branch March 9, 2026 17:10
@schriftgestalt
Copy link
Copy Markdown
Collaborator

So I don’t think something like this is going to work with current fontc architecture as there are no generated mark class names to reference.

The compiler could add the classes to the internal state to allow make them accessible to fea code.

@khaledhosny
Copy link
Copy Markdown
Collaborator Author

So I don’t think something like this is going to work with current fontc architecture as there are no generated mark class names to reference.

The compiler could add the classes to the internal state to allow make them accessible to fea code.

I have an idea that I’ll try later (extending fea-rs FeatureProvider to allow querying the caller for missing class names, then other parts of fontc that call fea-rs would provide the class definition on the fly).

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.

3 participants