New issue
Advanced search Search tips

Issue 605334 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 703332


Show other hotlists

Hotlists containing this issue:
Hotlist-1
Hotlist-1


Sign in to add a comment

Apple color font is not supported when served as a web font

Project Member Reported by js...@chromium.org, Apr 20 2016

Issue description

CrOS, Chrome-Android (and Chrome-Linux with a newer version of FreeType and fontconfig [1] ) supports color fonts in 'Google' format (such as Noto Color Emoji) when it's a local font. 

Chrome-Mac supports color fonts in 'Apple' format (Apple Color Emoji) when it's a local font. 

However, a Google-format color font when served as a *web font*, it is not supported on CrOS, Android-Chrome , Linux-Chrome.

Similary, when an Apple-format color font (with sbix table) is served as a web font, it's not supported by Mac-Chrome. 


A test page: https://pixelambacht.nl/demo/color-font-test.html


In case of Google-format color font, Blink gets OTS to pass CBDT/CBLT [2]. I'm pretty sure it worked before, but according to the above test page, it does not. 

In case of Apple-format color fonts, Blink does not pass through 'sbix' table (used in Apple format color fonts). I'll try to pass through 'sbix' table and see what happens. 


[1] On Linux, if freetype is older than 2.5.x, it'd not work. For the old version of fontconfig, the instruction at
https://github.com/googlei18n/noto-emoji/issues/36#issuecomment-185925485
should be followed.

[2] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp&l=147



P.S. 
SVG color fonts (proposed by Mozilla and Adobe) is not supported yet. 
Neither is Microsoft color font. And, that's a known issue.



 

Comment 1 by e...@chromium.org, Apr 21 2016

Components: Blink>WebFonts
Status: Available (was: Untriaged)

Comment 2 by js...@chromium.org, Apr 21 2016

Ok. Mac was easy. Just passing through sbix table worked. I'll upload a CL 
with a test. 

JFYI, Firefox (as a web font) supports SVG color font on all platforms and 'Apple format' emoji on Mac. 

Comment 3 by js...@chromium.org, Apr 21 2016

Labels: -OS-All OS-Mac
Owner: js...@chromium.org
Status: Started (was: Available)
Summary: Apple color font is not supported when served as a web font (was: None of color fonts (Google, Apple, Microsoft, SVG) works as a web font)
It turned out that the test page has a bug. Its test font in Google color format has a color glyph ( light green check mark inside a green circle) for 'X' (capital) but the html uses 'x' (lowercase). By changing the html file, I confirmed that Google color format served as a web font works fine on CrOS (and it should on Linux, too with a FT newer than 2.5.x). 

I'm making this bug as a Mac OS alone for Mac color format. 

Comment 4 by js...@chromium.org, Apr 21 2016

Labels: OS-Android OS-Chrome OS-Linux
sbix color fonts should be supported by Android, Linux, Chrome OS, too because FreeType (2.5.x or later) supports it. 

I'm testing https://codereview.chromium.org/1911123002/ on Linux. It's confirmed to work on Mac. 

Comment 5 by js...@chromium.org, Apr 25 2016

IT works on Linux as well. I need a test sbix font (that I've already made, but will tweak it more before adding a layout test). 

Comment 6 Deleted

Comment 7 by j...@fontself.com, Dec 28 2016

Hi!

It looks like sbix webfonts don't work for now on Chrome/Mac (only when installed locally).
Do do you plan to make it happen? -> It would be a great 🎁! :) #2017DeservesColorWebfonts

Comment 8 by behdad@google.com, Dec 28 2016

Jungshik, is this because of OTS?

Comment 9 by drott@chromium.org, Dec 28 2016

Looks like it, Jungshik uploaded https://codereview.chromium.org/1911123002/ and it looks good to me. Are you planning to follow up on the CL, Jungshik?

Comment 10 by j...@fontself.com, Feb 27 2017

Hi all, like @drott said, if everything looks good it would be great to merge it, we can't wait to see sbix webfonts :)

Comment 11 by e...@chromium.org, Mar 22 2017

Blocking: 703332

Comment 12 by drott@chromium.org, Oct 13 2017

Owner: drott@chromium.org
jshin@, mind if I take this over? I am working on cross platform sbix in https://chromium-review.googlesource.com/c/chromium/src/+/706248

Comment 13 by js...@chromium.org, Nov 22 2017

Feel free to take it over. 
https://codereview.chromium.org/1911123002/ was stalled because I failed to make a working test sbit font for layout test. (see comment 5). 

The fix itself is very simple as you see


Comment 14 by drott@chromium.org, Nov 23 2017

Thanks, I have https://chromium-review.googlesource.com/c/chromium/src/+/706248 which does this for all platforms, test case included, by using combinations of FreeType plus the platform's rasterizer for rasterization on all platforms for CBLC/CBDT and sbix, this is  issue 703332 .

It's currently blocked on Skia issues with Sbix on Mac. I have a change for ots.cc in that CL - I need to double check what happened with sbix - I think I tested it and I am not sure why it didn't need a change in ots for sbix.

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cd32864f21b540832c3297c68d9473f465e6341

commit 7cd32864f21b540832c3297c68d9473f465e6341
Author: Dominik Röttsches <drott@chromium.org>
Date: Thu Feb 22 16:59:28 2018

Cross platform support for font formats sbix, CBDT/CBLC, CFF2

Chrome previously supported CBDT/CBLC on FreeType based platforms:
Android, Linux, ChromeOS. FreeType added support for rasterizing sbix as
well as CFF2 glyph outlines. This CL enables usage of all these formats
on all Chrome platforms. This means with this CL color font formats
sbix, CBDT/CBLC and CFF2 OpenType fonts are supported on all platforms
Chrome supports.

This CL introduces a format dependent font instantiation mechanism which
chooses between FreeType or the system rasterizer backend. This
mechanism first identifies the font format, then chooses the
corresponding Skia Font Manager for SkTypeface instantiation.

The font format is determined by reading the list of table tags using
HarfBuzz API. HarfBuzz API is a lightweight way of accessing the table
tags without performing any additional font loading / instantiation
operations, which we don't need until we know which format the font is.

Thanks to Roel Niskens for pixelambacht.nl/chromacheck/ and the
Chromacheck fonts, which are used in the newly added layout tests. I
contributed a fix to the Chromacheck sbix test font in
https://github.com/RoelN/ChromaCheck/pull/37 in order to fix sbix
testing in Chromium on Mac OS < 10.13.

FreeType got rolled in CL:924152 to include my FreeType patch from
https://savannah.nongnu.org/bugs/?53154 for preferrring bitmap fonts in
CBDT/CBLC fonts.

font-format-support-cbdt-sbix-cff2.html,
font-format-support-cbdt-sbix-cff2-vertical.html test rendering at
different sizes, with transforms applied. Color font rendering is
currently limited to bitmaps of size 256x256 pixels, see issue
skia:6099. inspector-protocol/layout-fonts/cross-platform-cbdt-sbix-cff2.js
tests for correct glyph selection from the color fonts.

Bug:  758209 ,  605334 ,  713529 
Tbr: jshin@chromium.org, bashi@chromium.org
Change-Id: I8bc65aacade46014405330f54c6f5d9ac6b1cc8f
Reviewed-on: https://chromium-review.googlesource.com/706248
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538458}
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/fast/text/font-format-support-cbdt-sbix-cff2-vertical.html
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/fast/text/font-format-support-cbdt-sbix-cff2.html
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/cross-platform-cbdt-sbix-cff2-expected.txt
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/inspector-protocol/layout-fonts/cross-platform-cbdt-sbix-cff2.js
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.12/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-mac10.12/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-retina/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac-retina/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/win/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/win/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-format-support-cbdt-sbix-cff2-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-format-support-cbdt-sbix-cff2-vertical-expected.png
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/AdobeVF/AdobeVFPrototype.otf
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/AdobeVF/LICENSE.md
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/AdobeVF/README.chromium
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/ChromaCheck/LICENSE.md
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/ChromaCheck/README.chromium
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/ChromaCheck/chromacheck-cbdt.woff
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/LayoutTests/third_party/ChromaCheck/chromacheck-sbix.woff
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.h
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/WebFontDecoder.h
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/WebFontTypefaceFactory.cpp
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/WebFontTypefaceFactory.h
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/opentype/FontFormatCheck.cpp
[add] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/opentype/FontFormatCheck.h
[delete] https://crrev.com/b25820415f6630e4b57a55e2fd56a6e475961cf0/third_party/WebKit/Source/platform/fonts/opentype/VariableFontCheck.cpp
[delete] https://crrev.com/b25820415f6630e4b57a55e2fd56a6e475961cf0/third_party/WebKit/Source/platform/fonts/opentype/VariableFontCheck.h
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/ots/README.chromium
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/third_party/ots/src/ots.cc
[modify] https://crrev.com/7cd32864f21b540832c3297c68d9473f465e6341/tools/metrics/histograms/enums.xml

Comment 16 by ebra...@gnu.org, Feb 22 2018

Status: Fixed (was: Started)

Comment 17 by ebra...@gnu.org, Feb 22 2018

I assumed OTS is OK as there was some layout tests associated with the patch.

Sign in to add a comment