googlefonts / nanoemoji

A wee tool to build color fonts.
Apache License 2.0
239 stars 19 forks source link

Add CBDT to maximum_color #400

Closed rsheeter closed 2 years ago

rsheeter commented 2 years ago

See https://github.com/googlefonts/nanoemoji/tree/maximum_bitmap#adding-color-tables-to-existing-fonts for outline of what/why.

Remove formats with multiple color tables from --color_formats, user should use maximum_color instead.

Add support for variable width bitmaps. Fixes #401.

anthrotype commented 2 years ago

Remove formats with multiple color tables from --color_formats, user should use maximum_color instead.

what if one only wants COLRv1 and OT-SVG but not CBDT, or only COLRv1 and CBDT but not OT-SVG? Maybe maximum_color should have an option to select the desired list of formats (defaulting to all possible ones given input).

anthrotype commented 2 years ago

Remove formats with multiple color tables from --color_formats, user should use maximum_color instead.

I liked that one could make a hybrid font with multiple tables directly from the same set of input SVGs. Now one would have to first make either a COLRv1 or OT-SVG font, and then run maximum_color on it to add the rest of the tables (and may also find oneself with additional tables that were not requested, e.g. if one is only interested in testing vector color formats and is not interested in the bitmaps). Not only this process is slower and doesn't take advantage of parallel ninja builds, but also it may introduce slight differences due to, e.g. converting cubic2quads or rounding to UPEM integer grid (for COLR+glyf), or picosvg doing all sorts of relatively lossy transformations to simplify the SVGs. All this to say it was a nice feature to have and may be nice to keep.

rsheeter commented 2 years ago

I liked that one could make a hybrid font with multiple tables directly from the same set of input SVGs

I think if we want that back we should add a flag to nanoemoji to directly list the color table(s) desired and then it can share code with maximum color. The method of provisioning flags for every combination of formats just didn't scale, many valid combinations were left out.

EDIT: bitmaps are now off by default so if you just run the tool it adds whichever vector color table is missing