googlefonts / nanoemoji

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

Meaninglessness of font with COLR+CBDT tables in Android 13+ #437

Closed VladWinner closed 1 year ago

VladWinner commented 1 year ago

Looks like maximum_color command just useless for Android 13 because this OS prioritizes the display of CBDT instead of COLR.

Android 13, COLR font (left) vs COLR+CBDT font (right): image

I used this command from README.md to ensure compatibility with previous Android versions which does not support COLR: maximum_color --bitmaps my_colr_font.ttf

anthrotype commented 1 year ago

Chrome has a similar issue that it prefers CBDT over COLR (as we mention in the nanoemoji's README): https://bugs.chromium.org/p/chromium/issues/detail?id=1315537

Not surprised that Android has the same problem, given it also relies on a similar font stack.

The root of the problem can be traced to the interaction between Skia and Freetype, see https://bugs.chromium.org/p/skia/issues/detail?id=12945#c_ts1644833236 and https://gitlab.freedesktop.org/freetype/freetype/-/issues/1142

Maybe we should update the README accordingly until the issue is fixed upstream. /cc @rsheeter

anthrotype commented 1 year ago

@VladWinner for now, there's nothing the font compiler can do to work around this, you'd need two distinct fonts, one with COLR and without CBDT/CBLC, the other viceversa

rsheeter commented 1 year ago

+1 to update readme, that's a bit of a nasty surprise.

anthrotype commented 1 year ago

Updated README.md accordingly, PTAL https://github.com/googlefonts/nanoemoji/commit/cefcacd3d7dbe7e02d71ed433afd28cbd1708f50

rsheeter commented 1 year ago

LGTM. I think that means there is nothing further to do to nanoemoji so closing. Please reopen if I'm mistaken.