Index: Source/platform/fonts/FontFallbackList.cpp |
diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp |
index 046e962646513383aa334d0ef74fdfe8c2822f8f..8911a4c11b21238859e4b29706dfc6f0fc01876c 100644 |
--- a/Source/platform/fonts/FontFallbackList.cpp |
+++ b/Source/platform/fonts/FontFallbackList.cpp |
@@ -108,6 +108,8 @@ bool FontFallbackList::loadingCustomFonts() const |
const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDescription) const |
{ |
+ bool shouldLoadCustomFont = true; |
+ |
for (unsigned fontIndex = 0; ; ++fontIndex) { |
const FontData* fontData = fontDataAt(fontDescription, fontIndex); |
if (!fontData) { |
@@ -116,13 +118,17 @@ const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDes |
return fontDataAt(fontDescription, 0); |
} |
+ if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsCharacter(' ')) |
+ continue; |
+ |
// When a custom font is loading, we should use the correct fallback font to layout the text. |
// Here skip the temporary font for the loading custom font which may not act as the correct fallback font. |
if (!fontData->isLoadingFallback()) |
return fontData; |
// Begin to load the first custom font if needed. |
- if (!fontIndex) { |
+ if (shouldLoadCustomFont) { |
+ shouldLoadCustomFont = false; |
const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(' '); |
if (simpleFontData && simpleFontData->customFontData()) |
simpleFontData->customFontData()->beginLoadIfNeeded(); |