googlefonts / googlefonts/fontmake

UFO builds from lib.plist vs. contents.plist glyph lists

Open
#348 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
888
Forks
97
Avg merge
4d 52m
Merged PRs (30d)
1

Description

#### Build platforms/application versions:
fontmake v1.3.0 from PyPI
OS: OS X 10.12 + Ubuntu Trusty (Travis builds for both platforms)
UFO source spec v2 files

#### Request

- Consider UFO to ttf builds (and probably otf too...) from glyph lists in contents.plist rather than lib.plist

#### Issue

During a lib.plist cleanup, I removed the public.glyphOrder key/values in our source files and this caused our UFO to ttf fontmake build to fail with the following exception (Linux build shown):

```
INFO:fontmake.font_project:Saving TTF for Hack-Regular
Traceback (most recent call last):
File "/opt/python/2.7.13/bin/fontmake", line 11, in
sys.exit(main())
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontmake/__main__.py", line 195, in main
ufo_paths, is_instance=args.pop('masters_as_instances'), **args)
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontmake/font_project.py", line 481, in run_from_ufos
**kwargs)
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontmake/font_project.py", line 193, in build_ttfs
self.save_otfs(ufos, ttf=True, **kwargs)
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontmake/font_project.py", line 315, in save_otfs
self.subset_otf_from_ufo(otf_path, ufo)
File "/opt/python/2.7.13/lib/python2.7/site-packages/fontmake/font_project.py", line 329, in subset_otf_from_ufo
for glyph_name in ufo.lib[PUBLIC_PREFIX + 'glyphOrder']
KeyError: u'public.glyphOrder'
Unable to build the Hack-Regular variant set. Build canceled.
make: *** [build-with-dependencies] Error 1
```

My understanding is that lib.plist is an optional file in the UFO spec, though it appears to be mandatory for fontmake builds from UFO source files. I wanted to see if you might consider converting to contents.plist (mandatory file in UFO spec) for the glyph lists necessary for builds from UFO source.

The rationale for this request on our end is that we are struggling with how to manage the editor dependent lib.plist data that is unnecessary in the remote git repository (we are trying to support any UFO source editing tool). Ideally (for our purposes), everyone keeps their editor dependent data locally where they need it and builds occur from data in mandatory files that do not rely on the editor in use by/preferences of the developer who commits. If we can add lib.plist to our .gitignore file, it eliminates the need for review of thousands of lines of source when an author modifies something like the glyph list order based upon downstream developer / editor preferences or defaults.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.