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

Unified Diff: Source/platform/fonts/win/FontCacheSkiaWin.cpp

Issue 307243002: Fix font family based fallback font selection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Windows link fix. Created 6 years, 6 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 | « Source/platform/fonts/skia/FontCacheSkia.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index dd088b9660203240f4ffb59b094ea0374f400154..f3d59e30e83a59b13eefd603b2f3db86781ed3ed 100644
--- a/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -36,6 +36,7 @@
#include "SkTypeface_win.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontFaceCreationParams.h"
#include "platform/fonts/SimpleFontData.h"
#include "platform/fonts/harfbuzz/FontPlatformDataHarfbuzz.h"
#include "platform/fonts/win/FontFallbackWin.h"
@@ -95,8 +96,10 @@ PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
&script,
m_fontManager.get());
FontPlatformData* data = 0;
- if (family)
- data = getFontPlatformData(fontDescription, AtomicString(family, wcslen(family)));
+ if (family) {
+ FontFaceCreationParams createByFamily(AtomicString(family, wcslen(family)));
+ data = getFontPlatformData(fontDescription, createByFamily);
+ }
// Last resort font list : PanUnicode. CJK fonts have a pretty
// large repertoire. Eventually, we need to scan all the fonts
@@ -155,7 +158,8 @@ PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
int i;
for (i = 0; (!data || !fontContainsCharacter(data, family, character)) && i < numFonts; ++i) {
family = panUniFonts[i];
- data = getFontPlatformData(fontDescription, AtomicString(family, wcslen(family)));
+ FontFaceCreationParams createByFamily(AtomicString(family, wcslen(family)));
+ data = getFontPlatformData(fontDescription, createByFamily);
}
// When i-th font (0-base) in |panUniFonts| contains a character and
@@ -201,10 +205,11 @@ static bool typefacesMatchesFamily(const SkTypeface* tf, const AtomicString& fam
return matchesRequestedFamily;
}
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const FontFaceCreationParams& creationParams, float fontSize)
{
+ ASSERT(creationParams.creationType() == CreateFontByFamily);
CString name;
- RefPtr<SkTypeface> tf = createTypeface(fontDescription, family, name);
+ RefPtr<SkTypeface> tf = createTypeface(fontDescription, creationParams, name);
if (!tf)
return 0;
@@ -213,7 +218,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
// really used.
// FIXME: Do we need to use predefined fonts "guaranteed" to exist
// when we're running in layout-test mode?
- if (!typefacesMatchesFamily(tf.get(), family)) {
+ if (!typefacesMatchesFamily(tf.get(), creationParams.family())) {
return 0;
}
« no previous file with comments | « Source/platform/fonts/skia/FontCacheSkia.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698