googlefonts / ufo2ft

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

[COLRv1] automatically compute clipBoxes if not provided #728

Closed anthrotype closed 1 year ago

anthrotype commented 1 year ago

This require https://github.com/fonttools/fonttools/pull/3027 (yet unreleased so tests will fail until that's bumped)

The intention is being able to add ClipList to COLRv1 table when UFO doesn't include explicitly defined clipBoxes. Unlike nanoemoji, glyphsLib doesn't pre-compute those, so COLRv1 fonts generated from .glyphs sources via fontmake won't have ClipList (it is optional, but good to have anyway).

After this PR, they will get clipBoxes.

For variable builds, I disabled this because computing clipboxes which are guaranteed to contain and not clip the outlines throughout the variation space is complicated by angle-based rotation/skew variable transforms.