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

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

Issue 2137483004: Enable "system-ui" generic font family (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and Mac fix Created 4 years, 2 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.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
index 500a8848955c2cc658349e3bc0c815cc5ccddbb4..683f3962bdf84a29e056d083f44da1f2e109f3ae 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
@@ -107,6 +107,29 @@ FontPlatformData* FontCache::getFontPlatformData(
platformInit();
}
+ if (creationParams.creationType() == CreateFontByFamily) {
+#if !OS(MACOSX)
+ if (creationParams.family() == FontFamilyNames::system_ui) {
+ const AtomicString& actualFamily = FontCache::systemFontFamily();
+#if OS(LINUX)
+ if (actualFamily.isEmpty() || actualFamily == FontFamilyNames::system_ui)
+ return nullptr;
+#else
+ DCHECK(!actualFamily.isEmpty() &&
+ actualFamily != FontFamilyNames::system_ui);
+#endif
+ return getFontPlatformData(fontDescription,
+ FontFaceCreationParams(actualFamily), true);
+ }
+#else
drott 2016/10/18 10:16:30 Nit perhaps, but I am considering how we could mak
kojii 2016/10/18 10:37:35 Ok, it's still nesting IIUC but nest in #else migh
kojii 2016/10/18 10:42:40 Note, this part will need some re-write, since whe
+ if (creationParams.family() == FontCache::legacySystemFontFamily()) {
+ return getFontPlatformData(
+ fontDescription, FontFaceCreationParams(FontFamilyNames::system_ui),
+ true);
+ }
+#endif
+ }
+
float size = fontDescription.effectiveFontSize();
unsigned roundedSize = size * FontCacheKey::precisionMultiplier();
FontCacheKey key = fontDescription.cacheKey(creationParams);

Powered by Google App Engine
This is Rietveld 408576698