Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1570)

Unified Diff: Source/platform/fonts/FontFallbackList.cpp

Issue 179983007: Add last resort to fallback chain in FontFallbackList::primaryFontData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontFallbackList.cpp
diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp
index 1f838eae90aa3879b0615a04eece77c649f940cc..2397099d3c5290e93dfd7eed3ef854765a3e05fb 100644
--- a/Source/platform/fonts/FontFallbackList.cpp
+++ b/Source/platform/fonts/FontFallbackList.cpp
@@ -114,8 +114,11 @@ const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDes
const FontData* fontData = fontDataAt(fontDescription, fontIndex);
if (!fontData) {
// All fonts are custom fonts and are loading. Return the first FontData.
- // FIXME: Correct fallback to the default font.
- return fontDataAt(fontDescription, 0);
+ fontData = fontDataAt(fontDescription, 0);
+ if (!fontData)
+ fontData = FontCache::fontCache()->getLastResortFallbackFont(fontDescription).get();
+ ASSERT(fontData);
+ return fontData;
}
if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsCharacter(' '))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698