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

Support public.skipExportGlyphs lib key for storing export flags #519

Merged
merged 10 commits into from
Apr 10, 2019
Merged

Support public.skipExportGlyphs lib key for storing export flags #519

merged 10 commits into from
Apr 10, 2019

Conversation

madig
Copy link
Collaborator

@madig madig commented Apr 2, 2019

#515.

Handling this well in a oh-please-not-more-technical-debt kind of way is tricky.

There are three ways to signal that a glyph should not be exported:

  1. The old com.schriftgestaltung.Glyphs.Export glyph lib key
  2. The new UFO-level public.skipExportGlyphs lib key
  3. The new Designspace-level public.skipExportGlyphs lib key

ufo2ft will look into the Designspace lib key when using the compile*FromDS functions and into the UFO-level lib keys with the other compile* functions. Writing only to the Designspace-level lib key may complicate e.g. fontmake, which uses glyphsLib.to_designspace to convert a .glyphs file into DS + UFOs, but uses compile* or compile*FromDS depending on what the user specifies on the CLI.

Proposed behavior:

  • ufo2glyphs (to_glyphs):
    • When reading a Designspace file, honor only the old glyph lib key and the Designspace-level lib key
    • When reading loose UFOs, construct a Designspace and read the UFO-level public.skipExportGlyphs lib key, but error out when the lists don't match or some have one and others don't
  • glyphs2ufo (to_ufos, to_designspace)
    • Write UFO and Designspace-level public.skipExportGlyphs lib keys.

Also simplify note to glyph assignment to keep flake8's complexity test happy.
@madig madig marked this pull request as ready for review April 4, 2019 10:14
@anthrotype
Copy link
Member

sgtm

@madig
Copy link
Collaborator Author

madig commented Apr 9, 2019

Must check interaction with the "Keep Glyphs", "Export Glyphs" and "Remove Glyphs" (and others?) parameters...

@madig
Copy link
Collaborator Author

madig commented Apr 10, 2019

We only support "Keep Glyphs" currently and it turns out it causes feature subsetting on export from Glyphs.app. public.skipExportGlyphs does not, currently, and as such can't be used to adapt "Keep Glyphs".

@madig madig merged commit 198c4bb into googlefonts:master Apr 10, 2019
@madig madig deleted the support-public.skipExportGlyphs branch April 10, 2019 11:46
anthrotype added a commit that referenced this pull request May 9, 2019
…ags (#519)"

This reverts commit 198c4bb.

We need to release a bugfix v3.3.1 release after reverting #451, but
this is a major new feature that changes the way fontmake --subset option
behaves. Better done if a separate release. I will re-revert it back to
master after releasing v3.3.1.
@anthrotype
Copy link
Member

I also had to revert this, because fontmake --subset option relies on the individual glyph Export flags and works slightly differently than then new skipExportGlyphs feature as implemented in ufo2ft. Specifically, the latter decomposes component glyphs that are marked as non-export, whereas fontmake (which uses fonttools subsetter to subset after compilation, not on the source files) keeps the components that are marked as non-export without decomposing the composite glyphs that reference them.
We need to keep supporting the old behavior and make the new one opt-in behind some flag.

madig added a commit that referenced this pull request May 11, 2019
@madig
Copy link
Collaborator Author

madig commented May 11, 2019

new one opt-in behind some flag

In fontmake or glyphsLib?

@aaronbell
Copy link

Hi. Did this ever get implemented in another way? Or did it sort of fall by the wayside?

@aaronbell
Copy link

(I should mention that I am able to work around it by manually updating the designspace file as part of the export process, but it'd be nice not to have to do that :) )

@madig
Copy link
Collaborator Author

madig commented Dec 21, 2020

glyphs2ufo --write-public-skip-export-glyphs ...

@aaronbell
Copy link

Aha! Wish I'd spotted that sooner 😅

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