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

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

Issue 2721613002: Fix matching Roboto Bold for src: local("Roboto Regular") (Closed)
Patch Set: Fix test case for Mac Created 3 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 | « third_party/WebKit/Source/platform/fonts/FontCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index be0a9b728573cad2b388ccfe86dc650e7dd101a1..d9a669248ace5ceca13f802ca9793dfa30d910d5 100644
--- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -347,6 +347,20 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(
FontWeight variantWeight;
FontStretch variantStretch;
+ // TODO: crbug.com/627143 LocalFontFaceSource.cpp, which implements
+ // retrieving src: local() font data uses getFontData, which in turn comes
+ // here, to retrieve fonts from the cache and specifies the argument to
+ // local() as family name. So we do not match by full font name or
+ // postscript name as the spec says:
+ // https://drafts.csswg.org/css-fonts-3/#src-desc
+
+ // Prevent one side effect of the suffix translation below where when
+ // matching local("Roboto Regular") it tries to find the closest match even
+ // though that can be a bold font in case of Roboto Bold.
+ if (alternateFontName == AlternateFontName::LocalUniqueFace) {
+ return nullptr;
+ }
+
if (alternateFontName == AlternateFontName::LastResort) {
if (!tf)
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698