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

glyph.export is not used when writing ufos #320

Open
schriftgestalt opened this issue Mar 19, 2018 · 13 comments
Open

glyph.export is not used when writing ufos #320

schriftgestalt opened this issue Mar 19, 2018 · 13 comments

Comments

@schriftgestalt
Copy link
Collaborator

schriftgestalt commented Mar 19, 2018

When glyph.export is False, the glyph should not be written to the final font file.

And, if a component points to it, it this component needs to be decomposed.

I tried to add that functionality but it became a mess very quickly so I’m not doing it right.

@belluzj
Copy link
Collaborator

belluzj commented Mar 19, 2018

I think the current strategy here in glyphsLib is to write all glyphs to UFO and write as well their "export" flag. The export flag is then used by fontmake to filter the glyphs in the built font:

https://github.com/googlei18n/fontmake/blob/master/Lib/fontmake/font_project.py#L301

Are you proposing that glyphsLib should directly remove the glyphs from the UFOs?

@schriftgestalt
Copy link
Collaborator Author

I don’t really care who is doing it. Right now, nobody is taking care of it. And I have implemented in glyphsLib almost.

@schriftgestalt
Copy link
Collaborator Author

I was using fontmake to generate a variable font from a .glyphs file. It failed because there are some glyphs that have incompatible outlines. Those are set to not export.

After only putting the right glyphs in the ufo, it still complains about the kerning classes as I have not yet fixed that. It is much easier to deal with the kerning classes in glyphsLib instead of cleaning it up in fontmake.

@schriftgestalt
Copy link
Collaborator Author

As a side note, I’m trying to run the builder directly in Glyphs. And is works quite well (after fixing a tone of tiny things here and there, both in glyphsLib and in Glyphs itself).

@moyogo
Copy link
Collaborator

moyogo commented Mar 19, 2018

Aren't the glyphs that are not exported also muted in the designspace?

@belluzj
Copy link
Collaborator

belluzj commented Mar 20, 2018

I’m trying to run the builder directly in Glyphs

Cool! Did you run the one from the master branch or the one from the real-ufo-roundtrip pull request?

@schriftgestalt
Copy link
Collaborator Author

I stuffed all my changes in this repo. I’ll make nice commits when I’m done. https://github.com/schriftgestalt/glyphsLib/tree/some-adjustments

@schriftgestalt
Copy link
Collaborator Author

I see that is a load_to_ufos function. How would a load_to_glyphs look like that takes an path to a designspace file as argument?

@belluzj
Copy link
Collaborator

belluzj commented Mar 20, 2018

It's in this PR: #244

Have a look at the README from my branch which has examples of how to go from designspace to Glyphs: https://github.com/belluzj/glyphsLib/blob/real-ufo-roundtrip/README.rst#go-back-and-forth-between-ufos-and-glyphs

@anthrotype
Copy link
Member

the current strategy here in glyphsLib is to write all glyphs to UFO and write as well their "export" flag. The export flag is then used by fontmake to filter the glyphs in the built font

Right. And fontmake is using the fonttools subsetter only after ufo2ft has generated the full TTFs that also include the non-export glyphs. I know it sounds convoluted, but it allows us to rely on the subsetter to decompose the components whose base glyph was dropped, and subset the GSUB/GPOS table (without having to do that on the features.fea ourselves).

The conversion to quadratic is done in cu2qu and the latter doesn't know about these export flags, simply tries to convert glyphs with same name. Maybe it should be made aware of them, and skip.

@belluzj
Copy link
Collaborator

belluzj commented Mar 20, 2018

@schriftgestalt I have introduced three functions that I use extensively in tests (so you can see examples):

to_designspace(GSFont) -> DesignspaceDocument
to_ufos(GSFont) -> List<defcon.Font>
to_glyphs(DesignspaceDocument | List<defcon.Font>) -> GSFont

@anthrotype
Copy link
Member

As I'm gradually moving more and more of the functionalities from fontmake (the compiler CLI) to ufo2ft (the compiler library), I think this subsetting-by-export-flag step should also move to ufo2ft.postProcessor

@schriftgestalt
Copy link
Collaborator Author

I think this subsetting-by-export-flag step should also move to ufo2ft.postProcessor

as long as someone takes care of it..

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

No branches or pull requests

4 participants