Glyphs with ufo filters#1700
Merged
Merged
Conversation
cmyr
commented
Oct 17, 2025
Member
- closes .glyphs sources converted from DS+UFO with glyphsLib may contain ufo2ft-specific filters in userData #1665
- gets much of the rubik family matching (+20?)
And more specifically the ufo2ft filters key, which fontmake reads and uses to set some compilation options.
2b7f3a6 to
b75f95a
Compare
rsheeter
reviewed
Oct 17, 2025
| } | ||
|
|
||
| if context.flags.contains(Flags::FLATTEN_COMPONENTS) { | ||
| if context.flags.contains(Flags::FLATTEN_COMPONENTS) || source_args.flatten_components { |
Contributor
There was a problem hiding this comment.
Having multiple places to store the same flag is a pattern I've been burned by, and seen others be burned by, many times. How might we avoid this? Can we perhaps, maybe in a follow-on, get rid of context.flags and only have fields on static metadata?
Member
Author
There was a problem hiding this comment.
yea I think unifying this somehow would make a lot of sense.
rsheeter
reviewed
Oct 17, 2025
| /// Miscellaneous font-wide data that didn't seem worthy of top billing | ||
| pub misc: MiscMetadata, | ||
| /// Additional compilation arguments derived from the source | ||
| pub args: SourceArgs, |
Contributor
There was a problem hiding this comment.
I don't think we're benefitting very much from an extra struct over direct fields?
I also don't think "source args" is informative, better to describe whats here, which is basically instructions on how to process components?
anthrotype
added a commit
that referenced
this pull request
Oct 20, 2025
Fixes #1701 After #1700, compilation flags were stored in two places: 1. Context.flags (from CLI) 2. StaticMetadata.args (from source file) This dual-check pattern was error-prone and violated the single source of truth principle. It also polluted the StaticMetadata IR with compilation settings that don't belong in serialized font data. The merge semantics is a simple bitwise OR, i.e. flags are enabled if either CLI or source enables them. Which also means CLI flags must stay false by default for the source to be able to enable them, and CLI flags can't force-disable something that source has enabled. That's ok I think. This commit implements the core infrastructure and Glyphs source support for the flattenComponents filter. UFO/DesignSpace support and other filters will follow.
anthrotype
added a commit
that referenced
this pull request
Oct 20, 2025
Fixes #1701 After #1700, compilation flags were stored in two places: 1. Context.flags (from CLI) 2. StaticMetadata.args (from source file) This dual-check pattern was error-prone and violated the single source of truth principle. It also polluted the StaticMetadata IR with compilation settings that don't belong in serialized font data. The merge semantics is a simple bitwise OR, i.e. flags are enabled if either CLI or source enables them. Which also means CLI flags must stay false by default for the source to be able to enable them, and CLI flags can't force-disable something that source has enabled. That's ok I think. This commit implements the core infrastructure and Glyphs source support for the flattenComponents filter. UFO/DesignSpace support and other filters will follow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.