googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

Improve "no default source" error #677

Closed simoncozens closed 1 year ago

simoncozens commented 2 years ago

Currently when I have designspace or axis mapping issues, fontmake dies like this:

fontmake: Error: In 'sources/sources-glyphs/Literata-Upright.glyphs' -> 'master_ufo/Literata.designspace':
Generating fonts from Designspace failed: No default source

This is normally followed by swearing and grovelling through .designspace XML files, which is not a pleasant experience. With this PR, fontmake dies like this:

fontmake: Error: In 'sources/sources-glyphs/Literata-Upright.glyphs' -> 'master_ufo/Literata.designspace':
Generating fonts from Designspace failed: No default source; expected default master at Weight=631.111,
Optical size=10. Found master locations:
Literata 12 pt Regular at Weight=400, Optical size=10
Literata 7pt Regular at Weight=400, Optical size=6
Literata 72pt Regular at Weight=400, Optical size=144
Literata M3 at Weight=200, Optical size=10
Literata M4 at Weight=900, Optical size=10
Literata 72pt ExtraLight at Weight=200, Optical size=144
Literata 72pt Black at Weight=900, Optical size=144
Literata M7 at Weight=900, Optical size=6

Which at least tells me immediately that there's something gone wrong with the weight axis map, and saves me looking up all the source locations.

anthrotype commented 1 year ago

can you fix the merge conflicts?

simoncozens commented 1 year ago

I know a test would be nice but this really is just improving a warning so I'm going to merge it.