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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCache.h

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
Index: third_party/WebKit/Source/platform/fonts/FontCache.h
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.h b/third_party/WebKit/Source/platform/fonts/FontCache.h
index d3459882f4691d55d723abb95cebf43f21e8b743..d015e5e388897c11c9096709e915e48c582b77d5 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCache.h
+++ b/third_party/WebKit/Source/platform/fonts/FontCache.h
@@ -69,7 +69,12 @@ class SimpleFontData;
enum ShouldRetain { Retain, DoNotRetain };
enum PurgeSeverity { PurgeIfNeeded, ForcePurge };
-enum class AlternateFontName { AllowAlternate, NoAlternate, LastResort };
+enum class AlternateFontName {
+ AllowAlternate,
+ NoAlternate,
+ LocalUniqueFace,
+ LastResort
+};
class PLATFORM_EXPORT FontCache {
friend class FontCachePurgePreventer;
@@ -101,7 +106,22 @@ class PLATFORM_EXPORT FontCache {
PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&,
ShouldRetain = Retain);
SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&);
- bool isPlatformFontAvailable(const FontDescription&, const AtomicString&);
+
+ // Should be used in determining whether family names listed in font-family:
+ // ... are available locally. Only returns true if family name matches.
+ bool isPlatformFamilyMatchAvailable(const FontDescription&,
+ const AtomicString& family);
+
+ // Should be used in determining whether the <abc> argument to local in
+ // @font-face { ... src: local(<abc>) } are available locally, which should
+ // match Postscript name or full font name. Compare
+ // https://drafts.csswg.org/css-fonts-3/#src-desc
+ // TODO crbug.com/627143 complete this and actually look at the right
+ // namerecords.
+ bool isPlatformFontUniqueNameMatchAvailable(
+ const FontDescription&,
+ const AtomicString& uniqueFontName);
+
static String firstAvailableOrFirst(const String&);
// Returns the ShapeCache instance associated with the given cache key.
« no previous file with comments | « third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp ('k') | third_party/WebKit/Source/platform/fonts/FontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698