googlefonts / noto-emoji

Noto Emoji fonts
SIL Open Font License 1.1
3.75k stars 452 forks source link

Woff2 font from Google Fonts is broken #375

Closed boris-petrov closed 2 years ago

boris-petrov commented 2 years ago

Check out this CodePen. If you run it on Chrome you'll get:

Failed to decode downloaded font: https://fonts.gstatic.com/s/notocoloremoji/v1/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXw.0.woff2
OTS parsing error: Unable to instantiate font face from font data.

I got this font URL from here.

I'm not sure whether this is the correct repo to open this issue, I'm sorry if it is not. In any case, my use case is that I just want a smaller version of the noto-emoji font which just contains the country flags. Is it possible with the build system of this repo to do that (and/or is it possible to fix the woff2 from above)?

drott commented 2 years ago

See this codepen for an example for how you can embed Noto Emoji: https://codepen.io/drott_chrome/pen/xxrvXxa (we've used this example in some presentations on COLRv1). Avoid pointing to static asset URLs but use the Google Fonts API that generates the CSS for you instead. Note that access to the Noto Emoji font through Google Fonts is experimental and things may change in the future.

anthrotype commented 2 years ago

I just want a smaller version of the noto-emoji font which just contains the country flags

you can try using https://github.com/fonttools/fonttools (which contains among others a fonttools subset --help CLI tool) to subset a font (e.g. you could pass as a --text-file only containing the region flags)

drott commented 2 years ago

We also have an experimental build of just the flags in https://github.com/googlefonts/color-fonts/blob/main/fonts/noto_flags-glyf_colr_1.ttf (cff and cff2 versions in that directory as well).