Skip to content

Support deferred source generation in glyphs2ds op - #1223

Draft
madig wants to merge 2 commits into
googlefonts:mainfrom
daltonmaag:glyphs2ds-deferred-source-generation
Draft

Support deferred source generation in glyphs2ds op#1223
madig wants to merge 2 commits into
googlefonts:mainfrom
daltonmaag:glyphs2ds-deferred-source-generation

Conversation

@madig

@madig madig commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

When switching sources, glyphs2ds currently requires the new sources to already exist, which doesn't work when the previous step produced them. Solve this by adding an optional field to the source recipe step where you can fill in the missing info.

Todo:

  • Convert more ops?
  • Test
  • Docs

def source_step_to_object(self, step):
source: str = step["source"]
return self._ensure_named_file(source, type="source")
target_base_name: str | None = step.get("target_base_name")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the example you showed me, you're doing

source: foo/MyFont.glyphs
target_base_name: MyFont

Why not just use pathlib to get the stem? Path(step["source"]).stem

The top-level source stem(s) are already used as a source of truth when constructing the final compiled font file name when using the default googlefonts recipe builder, so it's an established precedent that source names should be sensible. Saves specifying the redundant information with a confusing (imo) attribute name

@madig madig Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm, that might be even easier, provided glyphs2ds ensures that the glyphs2ufo op spits out a Designspace file with that stem, need to double check. This would replace the while family name lookup?

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