generate_glyphdata¶
Generate FontBakery’s desired_glyph_data.json file.
The desired_glyph_data.json file contains the ‘recommended’ countour count for encoded glyphs. The contour counts are derived from fonts which were chosen for their quality and unique design decisions for particular glyphs.
Why make this? Visually QAing thousands of glyphs by hand is tiring. Most glyphs can only be constructured in a handful of ways. This means a glyph’s contour count will only differ slightly amongst different fonts, e.g a ‘g’ could either be 2 or 3 contours, depending on whether its double story or single story. However, a quotedbl should have 2 contours, unless the font belongs to a display family.
In the future, additional glyph data can be included. A good addition would be the ‘recommended’ anchor counts for each glyph.
-
class
fontbakery.commands.generate_glyphdata.
JsonSetEncoder
(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source][source]¶ Serialise Set objects for json module.
-
default
(obj)[source][source]¶ Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
-