fontbakery: COLR need to count for reachability (com.google.fonts/check/unreachable_glyphs)

Observed behaviour

Checks on Noto Color Emoji claim vast #s of unreachable glyphs. My guess is COLR v0 and/or v1 don’t “count” when computing reachability.

WARN: Check font contains no unreachable glyphs ([com.google.fonts/check/unreachable_glyphs](https://font-bakery.readthedocs.io/en/stable/fontbakery/profiles/universal.html#com.google.fonts/check/unreachable_glyphs))
⚠ WARN The following glyphs could not be reached by codepoint or substitution rules:

glyph05311
glyph10700
glyph21429
glyph16679
glyph20585
glyph30485
glyph08398
glyph18035
glyph39093
glyph29709
And 35524 more.

Ref https://github.com/google/fonts/pull/4994#issuecomment-1197611451.

Expected behaviour

COLR should count as a way to reach glyphs.

Resources and exact process needed to replicate

https://github.com/googlefonts/color-fonts has a set of sample font sthat may be useful in testing.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

new visitor module will help you more easily traverse all PaintGlyph and PaintColrGlyph nodes

COLR Paint objects already have a more specialized traverse method, which is also used by the fonttools subsetter, see:

https://github.com/fonttools/fonttools/blob/e494b118c4dd471fa268f817915249fd36858a10/Lib/fontTools/subset/__init__.py#L2112-L2123 https://github.com/fonttools/fonttools/blob/e494b118c4dd471fa268f817915249fd36858a10/Lib/fontTools/ttLib/tables/otTables.py#L1576-L1588

A kind +1 to this. The current build of Nabla reports more than 750 unreachable glyphs, even though they are all referenced by the COLR table.

The Nabla.ttf saved as an asset of the GH Action you referenced here does not fail the check implementation in our current git main branch (future FB v0.8.10 release).