googlefonts / ufo2ft

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

add ftConfig parameter to set fontTools' TTFont.cfg options #607

Closed anthrotype closed 8 months ago

anthrotype commented 2 years ago

This adds a new ftConfig parameter to all compile methods that allows to set fonttools configuration options as defined in (e.g. to turn on/off the serialization of GPOS/GSUB with the harfbuzz repacker):

https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/config/__init__.py

since these config options are set on the TTFont instance itself (in its cfg attribute) but ufo2ft creates a new TTFont instance from scratch, this new parameter will allow a client (e.g. fontmake) to specify these options and have ufo2ft configure the newly created TTFont object with them.

anthrotype commented 1 year ago

at the risk of bikeshedding.. do we all like the name ftConfig for this "fonttools config" parameter to ufo2ft's compile methods? If it isn't clear enough, we can spell it out as "fontToolsConfig" or even "ttFontConfig" to avoid any confusions.