WebKit Bugzilla
Attachment 358583 Details for
Bug 191976
: [FreeType] Color emoji not properly supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
wc-ft-colored-emojis.diff (text/plain), 23.12 KB, created by
Carlos Garcia Campos
on 2019-01-08 03:59:57 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-01-08 03:59:57 PST
Size:
23.12 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 763ea36bc98..f9cf79fb8d0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-08 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [FreeType] Color emoji not properly supported >+ https://bugs.webkit.org/show_bug.cgi?id=191976 >+ >+ Reviewed by Michael Catanzaro. >+ >+ Add new test to ensure we fallback to noto color emoji for emojis. >+ >+ * platform/gtk/fonts/font-emoji-system-fallback-expected.html: Added. >+ * platform/gtk/fonts/font-emoji-system-fallback.html: Added. >+ > 2019-01-07 Youenn Fablet <youenn@apple.com> > > LayoutTests/http/wpt/fetch/csp-reports-bypass-csp-checks.html is flaky >diff --git a/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback-expected.html b/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback-expected.html >new file mode 100644 >index 00000000000..cb0c96ab2ce >--- /dev/null >+++ b/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback-expected.html >@@ -0,0 +1,2 @@ >+<span style="font-family: 'Noto Color Emoji';">😁</span> >+ >diff --git a/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback.html b/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback.html >new file mode 100644 >index 00000000000..b9ed0d9115f >--- /dev/null >+++ b/LayoutTests/platform/gtk/fonts/font-emoji-system-fallback.html >@@ -0,0 +1 @@ >+😁 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f8a87b09bcf..db968f23b9f 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-08 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [FreeType] Color emoji not properly supported >+ https://bugs.webkit.org/show_bug.cgi?id=191976 >+ >+ Reviewed by Michael Catanzaro. >+ >+ Add a name for combining enclosing keycap character. >+ >+ * wtf/unicode/CharacterNames.h: >+ > 2019-01-07 David Kilzer <ddkilzer@apple.com> > > Prefer RetainPtr<NSObject> to RetainPtr<NSObject *> >diff --git a/Source/WTF/wtf/unicode/CharacterNames.h b/Source/WTF/wtf/unicode/CharacterNames.h >index 696660370e4..d9b3feefd79 100644 >--- a/Source/WTF/wtf/unicode/CharacterNames.h >+++ b/Source/WTF/wtf/unicode/CharacterNames.h >@@ -46,6 +46,7 @@ const UChar blackUpPointingTriangle = 0x25B2; > const UChar bullet = 0x2022; > const UChar bullseye = 0x25CE; > const UChar carriageReturn = 0x000D; >+const UChar combiningEnclosingKeycap = 0x20E3; > const UChar ethiopicPrefaceColon = 0x1366; > const UChar ethiopicWordspace = 0x1361; > const UChar firstStrongIsolate = 0x2068; >@@ -114,6 +115,7 @@ using WTF::Unicode::blackUpPointingTriangle; > using WTF::Unicode::bullet; > using WTF::Unicode::bullseye; > using WTF::Unicode::carriageReturn; >+using WTF::Unicode::combiningEnclosingKeycap; > using WTF::Unicode::ethiopicPrefaceColon; > using WTF::Unicode::ethiopicWordspace; > using WTF::Unicode::firstStrongIsolate; >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 03bc51d848a..c0e8acf8272 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2019-01-08 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [FreeType] Color emoji not properly supported >+ https://bugs.webkit.org/show_bug.cgi?id=191976 >+ >+ Reviewed by Michael Catanzaro. >+ >+ Always try to fallback to a colored font for emojis. >+ >+ Test: platform/gtk/fonts/font-emoji-system-fallback.html >+ >+ * platform/graphics/ComplexTextController.cpp: >+ (WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs. >+ * platform/graphics/Font.cpp: >+ (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey): >+ (WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters. >+ * platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter(). >+ * platform/graphics/FontCache.h: >+ * platform/graphics/FontCascadeFonts.cpp: >+ (WebCore::FontCascadeFonts::glyphDataForSystemFallback): >+ * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: >+ (WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji. >+ (WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored >+ font even if base font can render the emoji in black and white. >+ * platform/graphics/cocoa/FontCacheCoreText.cpp: >+ (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored. >+ * platform/graphics/freetype/FontCacheFreeType.cpp: >+ (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter. >+ * platform/graphics/freetype/FontPlatformDataFreeType.cpp: >+ (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont. >+ * platform/graphics/freetype/SimpleFontDataFreeType.cpp: >+ (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file. >+ (WebCore::Font::platformSupportsCodePoint const): Add freetype implementation. >+ * platform/graphics/win/FontCacheWin.cpp: >+ (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored. >+ * platform/text/CharacterProperties.h: >+ (WebCore::isEmojiKeycapBase): >+ (WebCore::isEmojiRegionalIndicator): >+ (WebCore::isEmojiWithPresentationByDefault): >+ (WebCore::isEmojiModifierBase): >+ > 2019-01-07 Youenn Fablet <youenn@apple.com> > > Crash in SWServer::Connection::resolveRegistrationReadyRequests >diff --git a/Source/WebCore/platform/graphics/ComplexTextController.cpp b/Source/WebCore/platform/graphics/ComplexTextController.cpp >index 9a9c9768612..cbe32b94b10 100644 >--- a/Source/WebCore/platform/graphics/ComplexTextController.cpp >+++ b/Source/WebCore/platform/graphics/ComplexTextController.cpp >@@ -286,6 +286,7 @@ static bool advanceByCombiningCharacterSequence(const UChar*& iterator, const UC > // Consume marks. > bool sawEmojiGroupCandidate = isEmojiGroupCandidate(baseCharacter); > bool sawJoiner = false; >+ bool sawRegionalIndicator = isEmojiRegionalIndicator(baseCharacter); > while (iterator < end) { > UChar32 nextCharacter; > unsigned markLength = 0; >@@ -296,6 +297,11 @@ static bool advanceByCombiningCharacterSequence(const UChar*& iterator, const UC > if (isVariationSelector(nextCharacter) || isEmojiFitzpatrickModifier(nextCharacter)) > shouldContinue = true; > >+ if (sawRegionalIndicator && isEmojiRegionalIndicator(nextCharacter)) { >+ shouldContinue = true; >+ sawRegionalIndicator = false; >+ } >+ > if (sawJoiner && isEmojiGroupCandidate(nextCharacter)) > shouldContinue = true; > >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index 9fabaa07c0c..d03c25f62f8 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -502,10 +502,10 @@ public: > { > } > >- CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, bool isForPlatformFont) >+ CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, IsForPlatformFont isForPlatformFont) > : locale(locale) > , character(character) >- , isForPlatformFont(isForPlatformFont) >+ , isForPlatformFont(isForPlatformFont == IsForPlatformFont::Yes) > { > } > >@@ -560,13 +560,13 @@ static SystemFallbackCache& systemFallbackCache() > return map.get(); > } > >-RefPtr<Font> Font::systemFallbackFontForCharacter(UChar32 character, const FontDescription& description, bool isForPlatformFont) const >+RefPtr<Font> Font::systemFallbackFontForCharacter(UChar32 character, const FontDescription& description, IsForPlatformFont isForPlatformFont) const > { > auto fontAddResult = systemFallbackCache().add(this, CharacterFallbackMap()); > > if (!character) { > UChar codeUnit = 0; >- return FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, &codeUnit, 1); >+ return FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, FontCache::PreferColoredFont::No, &codeUnit, 1); > } > > auto key = CharacterFallbackMapKey(description.locale(), character, isForPlatformFont); >@@ -586,7 +586,7 @@ RefPtr<Font> Font::systemFallbackFontForCharacter(UChar32 character, const FontD > codeUnitsLength = 2; > } > >- fallbackFont = FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, codeUnits, codeUnitsLength).get(); >+ fallbackFont = FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, FontCache::PreferColoredFont::No, codeUnits, codeUnitsLength).get(); > if (fallbackFont) > fallbackFont->m_isUsedInSystemFallbackCache = true; > } >@@ -612,7 +612,7 @@ void Font::removeFromSystemFallbackCache() > } > } > >-#if !PLATFORM(COCOA) >+#if !PLATFORM(COCOA) && !USE(FREETYPE) > bool Font::variantCapsSupportsCharacterForSynthesis(FontVariantCaps fontVariantCaps, UChar32) const > { > switch (fontVariantCaps) { >diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h >index bffcbb85bca..11df1e6b9f6 100644 >--- a/Source/WebCore/platform/graphics/Font.h >+++ b/Source/WebCore/platform/graphics/Font.h >@@ -65,6 +65,7 @@ struct WidthIterator; > > enum FontVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant, BrokenIdeographVariant }; > enum Pitch { UnknownPitch, FixedPitch, VariablePitch }; >+enum class IsForPlatformFont : uint8_t { No, Yes }; > > class Font : public RefCounted<Font> { > public: >@@ -176,7 +177,7 @@ public: > bool supportsCodePoint(UChar32) const; > bool platformSupportsCodePoint(UChar32) const; > >- RefPtr<Font> systemFallbackFontForCharacter(UChar32, const FontDescription&, bool isForPlatformFont) const; >+ RefPtr<Font> systemFallbackFontForCharacter(UChar32, const FontDescription&, IsForPlatformFont) const; > > const GlyphPage* glyphPage(unsigned pageNumber) const; > >diff --git a/Source/WebCore/platform/graphics/FontCache.h b/Source/WebCore/platform/graphics/FontCache.h >index b635a13cc48..5aa41df9525 100644 >--- a/Source/WebCore/platform/graphics/FontCache.h >+++ b/Source/WebCore/platform/graphics/FontCache.h >@@ -60,6 +60,7 @@ class FontPlatformData; > class FontSelector; > class OpenTypeVerticalData; > class Font; >+enum class IsForPlatformFont : uint8_t; > > #if PLATFORM(WIN) > #if USE(IMLANG_FONT_LINK2) >@@ -190,7 +191,8 @@ public: > WEBCORE_EXPORT static FontCache& singleton(); > > // These methods are implemented by the platform. >- RefPtr<Font> systemFallbackForCharacters(const FontDescription&, const Font* originalFontData, bool isPlatformFont, const UChar* characters, unsigned length); >+ enum class PreferColoredFont : uint8_t { No, Yes }; >+ RefPtr<Font> systemFallbackForCharacters(const FontDescription&, const Font* originalFontData, IsForPlatformFont, PreferColoredFont, const UChar* characters, unsigned length); > Vector<String> systemFontFamilies(); > void platformInit(); > >diff --git a/Source/WebCore/platform/graphics/FontCascadeFonts.cpp b/Source/WebCore/platform/graphics/FontCascadeFonts.cpp >index 04239bf36e5..a9f41e1773b 100644 >--- a/Source/WebCore/platform/graphics/FontCascadeFonts.cpp >+++ b/Source/WebCore/platform/graphics/FontCascadeFonts.cpp >@@ -345,7 +345,7 @@ GlyphData FontCascadeFonts::glyphDataForSystemFallback(UChar32 character, const > if (!font) > font = &realizeFallbackRangesAt(description, 0).fontForFirstRange(); > >- auto systemFallbackFont = font->systemFallbackFontForCharacter(character, description, m_isForPlatformFont); >+ auto systemFallbackFont = font->systemFallbackFontForCharacter(character, description, m_isForPlatformFont ? IsForPlatformFont::Yes : IsForPlatformFont::No); > if (!systemFallbackFont) > return GlyphData(); > >diff --git a/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp b/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp >index 9efe6f587c7..107dc71317b 100644 >--- a/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp >+++ b/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp >@@ -29,6 +29,7 @@ > > #if USE(CAIRO) > >+#include "CharacterProperties.h" > #include "FontCache.h" > #include "SurrogatePairAwareTextIterator.h" > #include <unicode/normlzr.h> >@@ -45,6 +46,60 @@ bool FontCascade::canExpandAroundIdeographsInComplexText() > return false; > } > >+static bool characterSequenceIsEmoji(const Vector<UChar, 4>& normalizedCharacters, int32_t normalizedLength) >+{ >+ UChar32 character; >+ unsigned clusterLength = 0; >+ SurrogatePairAwareTextIterator iterator(normalizedCharacters.data(), 0, normalizedLength, normalizedLength); >+ if (!iterator.consume(character, clusterLength)) >+ return false; >+ >+ if (isEmojiKeycapBase(character)) { >+ iterator.advance(clusterLength); >+ UChar32 nextCharacter; >+ if (!iterator.consume(nextCharacter, clusterLength)) >+ return false; >+ >+ if (nextCharacter == combiningEnclosingKeycap) >+ return true; >+ >+ // Variation selector 16. >+ if (nextCharacter == 0xFE0F) { >+ iterator.advance(clusterLength); >+ if (!iterator.consume(nextCharacter, clusterLength)) >+ return false; >+ >+ if (nextCharacter == combiningEnclosingKeycap) >+ return true; >+ } >+ >+ return false; >+ } >+ >+ // Regional indicator. >+ if (isEmojiRegionalIndicator(character)) { >+ iterator.advance(clusterLength); >+ UChar32 nextCharacter; >+ if (!iterator.consume(nextCharacter, clusterLength)) >+ return false; >+ >+ if (isEmojiRegionalIndicator(nextCharacter)) >+ return true; >+ >+ return false; >+ } >+ >+ if (character == combiningEnclosingKeycap) >+ return true; >+ >+ if (isEmojiWithPresentationByDefault(character) >+ || isEmojiModifierBase(character) >+ || isEmojiFitzpatrickModifier(character)) >+ return true; >+ >+ return false; >+} >+ > const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characters, size_t length) const > { > UErrorCode error = U_ZERO_ERROR; >@@ -61,8 +116,12 @@ const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characte > if (!iterator.consume(character, clusterLength)) > return nullptr; > >+ bool isEmoji = characterSequenceIsEmoji(normalizedCharacters, normalizedLength); >+ > const Font* baseFont = glyphDataForCharacter(character, false, NormalVariant).font; >- if (baseFont && (static_cast<int32_t>(clusterLength) == normalizedLength || baseFont->canRenderCombiningCharacterSequence(characters, length))) >+ if (baseFont >+ && (static_cast<int32_t>(clusterLength) == normalizedLength || baseFont->canRenderCombiningCharacterSequence(characters, length)) >+ && (!isEmoji || baseFont->platformData().isColorBitmapFont())) > return baseFont; > > for (unsigned i = 0; !fallbackRangesAt(i).isNull(); ++i) { >@@ -70,12 +129,12 @@ const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characte > if (!fallbackFont || fallbackFont == baseFont) > continue; > >- if (fallbackFont->canRenderCombiningCharacterSequence(characters, length)) >+ if (fallbackFont->canRenderCombiningCharacterSequence(characters, length) && (!isEmoji || fallbackFont->platformData().isColorBitmapFont())) > return fallbackFont; > } > >- if (auto systemFallback = FontCache::singleton().systemFallbackForCharacters(m_fontDescription, baseFont, false, characters, length)) { >- if (systemFallback->canRenderCombiningCharacterSequence(characters, length)) >+ if (auto systemFallback = FontCache::singleton().systemFallbackForCharacters(m_fontDescription, baseFont, IsForPlatformFont::No, isEmoji ? FontCache::PreferColoredFont::Yes : FontCache::PreferColoredFont::No, characters, length)) { >+ if (systemFallback->canRenderCombiningCharacterSequence(characters, length) && (!isEmoji || systemFallback->platformData().isColorBitmapFont())) > return systemFallback.get(); > } > >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >index e258141e99a..528528425b6 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >@@ -1354,7 +1354,7 @@ static RetainPtr<CTFontRef> lookupFallbackFont(CTFontRef font, FontSelectionValu > return result; > } > >-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool isPlatformFont, const UChar* characters, unsigned length) >+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, IsForPlatformFont isForPlatformFont, PreferColoredFont, const UChar* characters, unsigned length) > { > #if PLATFORM(IOS_FAMILY) > if (length && requiresCustomFallbackFont(*characters)) { >@@ -1383,7 +1383,7 @@ RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr > CTFontRef substituteFont = fallbackDedupSet().add(result).iterator->get(); > > bool syntheticBold, syntheticOblique; >- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(substituteFont, description, isPlatformFont).boldObliquePair(); >+ std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(substituteFont, description, isForPlatformFont == IsForPlatformFont::Yes).boldObliquePair(); > > FontPlatformData alternateFont(substituteFont, platformData.size(), syntheticBold, syntheticOblique, platformData.orientation(), platformData.widthVariant(), platformData.textRenderingMode()); > >diff --git a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >index c446edb5107..d3097740991 100644 >--- a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >@@ -118,7 +118,7 @@ static void getFontPropertiesFromPattern(FcPattern* pattern, const FontDescripti > } > } > >-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font*, bool, const UChar* characters, unsigned length) >+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font*, IsForPlatformFont, PreferColoredFont preferColoredFont, const UChar* characters, unsigned length) > { > FcUniquePtr<FcCharSet> fontConfigCharSet(FcCharSetCreate()); > UTF16UChar32Iterator iterator(characters, length); >@@ -132,6 +132,8 @@ RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr > FcPatternAddCharSet(pattern.get(), FC_CHARSET, fontConfigCharSet.get()); > > FcPatternAddBool(pattern.get(), FC_SCALABLE, FcTrue); >+ if (preferColoredFont == PreferColoredFont::Yes) >+ FcPatternAddBool(pattern.get(), FC_COLOR, FcTrue); > > if (!configurePatternForFontDescription(pattern.get(), description)) > return nullptr; >diff --git a/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp b/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >index 043793488ca..bcf6754c4a9 100644 >--- a/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >@@ -32,6 +32,7 @@ > #include <cairo-ft.h> > #include <fontconfig/fcfreetype.h> > #include <ft2build.h> >+#include FT_FREETYPE_H > #include FT_TRUETYPE_TABLES_H > #include <hb-ft.h> > #include <hb-ot.h> >@@ -117,6 +118,12 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, FcPattern* patte > m_fixedWidth = fixedWidth; > > buildScaledFont(fontFace); >+ >+#ifdef FT_HAS_COLOR >+ CairoFtFaceLocker cairoFtFaceLocker(m_scaledFont.get()); >+ if (FT_Face ftFace = cairoFtFaceLocker.ftFace()) >+ m_isColorBitmapFont = FT_HAS_COLOR(ftFace); >+#endif > } > > FontPlatformData::FontPlatformData(const FontPlatformData& other) >diff --git a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >index d636233abe2..f1ca7eb680d 100644 >--- a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >@@ -188,4 +188,27 @@ float Font::platformWidthForGlyph(Glyph glyph) const > return width ? width : m_spaceWidth; > } > >+bool Font::variantCapsSupportsCharacterForSynthesis(FontVariantCaps fontVariantCaps, UChar32) const >+{ >+ switch (fontVariantCaps) { >+ case FontVariantCaps::Small: >+ case FontVariantCaps::Petite: >+ case FontVariantCaps::AllSmall: >+ case FontVariantCaps::AllPetite: >+ return false; >+ default: >+ // Synthesis only supports the variant-caps values listed above. >+ return true; >+ } >+} >+ >+bool Font::platformSupportsCodePoint(UChar32 character) const >+{ >+ CairoFtFaceLocker cairoFtFaceLocker(m_platformData.scaledFont()); >+ if (FT_Face face = cairoFtFaceLocker.ftFace()) >+ return !!FcFreeTypeCharIndex(face, character); >+ >+ return false; >+} >+ > } >diff --git a/Source/WebCore/platform/graphics/win/FontCacheWin.cpp b/Source/WebCore/platform/graphics/win/FontCacheWin.cpp >index f2d660da9fb..0794881367e 100644 >--- a/Source/WebCore/platform/graphics/win/FontCacheWin.cpp >+++ b/Source/WebCore/platform/graphics/win/FontCacheWin.cpp >@@ -211,7 +211,7 @@ static HFONT createMLangFont(IMLangFontLinkType* langFontLink, HDC hdc, DWORD co > return hfont; > } > >-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, unsigned length) >+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, IsForPlatformFont, PreferColoredFont, const UChar* characters, unsigned length) > { > UChar character = characters[0]; > RefPtr<Font> fontData; >diff --git a/Source/WebCore/platform/text/CharacterProperties.h b/Source/WebCore/platform/text/CharacterProperties.h >index c6530a48aca..e20d680137c 100644 >--- a/Source/WebCore/platform/text/CharacterProperties.h >+++ b/Source/WebCore/platform/text/CharacterProperties.h >@@ -76,4 +76,34 @@ inline bool isVariationSelector(UChar32 character) > return character >= 0xFE00 && character <= 0xFE0F; > } > >+inline bool isEmojiKeycapBase(UChar32 character) >+{ >+ return (character >= '0' && character <= '9') || character == '#' || character == '*'; >+} >+ >+inline bool isEmojiRegionalIndicator(UChar32 character) >+{ >+ return character >= 0x1F1E6 && character <= 0x1F1FF; >+} >+ >+inline bool isEmojiWithPresentationByDefault(UChar32 character) >+{ >+#if U_ICU_VERSION_MAJOR_NUM >= 57 >+ return u_hasBinaryProperty(character, UCHAR_EMOJI_PRESENTATION); >+#else >+ UNUSED_PARAM(character); >+ return false; >+#endif >+} >+ >+inline bool isEmojiModifierBase(UChar32 character) >+{ >+#if U_ICU_VERSION_MAJOR_NUM >= 57 >+ return u_hasBinaryProperty(character, UCHAR_EMOJI_MODIFIER_BASE); >+#else >+ UNUSED_PARAM(character); >+ return false; >+#endif >+} >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191976
:
355977
|
357567
|
357679
| 358583