[Webkit-unassigned] [Bug 191976] [FreeType] Color emoji not properly supported

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 2 23:57:36 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=191976

--- Comment #17 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Myles C. Maxfield from comment #16)
> Comment on attachment 357679 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=357679&action=review
> 
> I think this is the wrong direction.
> 
> > Source/WebCore/platform/graphics/Font.cpp:569
> > +        return FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, false, &codeUnit, 1);
> 
> We usually use 2-value enums so it's clear at the calling site what the
> meaning of "false" is.

I thought about it, but I saw the other bool parameter in the function and decided to keep a bool. I can change both, though. 

> > Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:49
> > +static bool characterSequenceIsEmoji(const Vector<UChar, 4>& normalizedCharacters, int32_t normalizedLength)
> 
> This logic shouldn't be necessary; WebKit shouldn't be in the business of
> iterating through strings codepoint-by-codepoint.

But I need to know if the sequence is an emoji, the point is to prefer a colored font when falling back to system fonts only when rendering emojis.

> > Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:136
> > +    if (auto systemFallback = FontCache::singleton().systemFallbackForCharacters(m_fontDescription, baseFont, false, isEmoji, characters, length)) {
> 
> There are color fonts that don't support emoji, and it's conceptually
> possible to have an emoji font that isn't color. It isn't right to pass
> "isEmoji" to "bool coloredFont"

I think so, what we want here is to prefer a colored font when rendering emojis. We are also passing the characters, so we will fallback to a font that supports those codepoints and it's colored (if it exists, for course). I know what we want is an emji font, but I wanted to avoid heuristics using the font name, because there might be emojis fonts without the emoji word in the name. What we really want here is a colored version of the emoji, so a colored font supporting the sequence should be enough and it will probably be an emoji font anyway.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190103/62b57adf/attachment-0001.html>


More information about the webkit-unassigned mailing list