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

Unified Diff: third_party/WebKit/Source/platform/fonts/mac/FontFamilyMatcherMac.mm

Issue 2137483004: Enable "system-ui" generic font family (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drott nit 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/mac/FontFamilyMatcherMac.mm
diff --git a/third_party/WebKit/Source/platform/fonts/mac/FontFamilyMatcherMac.mm b/third_party/WebKit/Source/platform/fonts/mac/FontFamilyMatcherMac.mm
index cef19ba2439aa1551180f19baab6b23176ff4cfd..fb45882acea0d5d94a9a058dec4507bf71b08291 100644
--- a/third_party/WebKit/Source/platform/fonts/mac/FontFamilyMatcherMac.mm
+++ b/third_party/WebKit/Source/platform/fonts/mac/FontFamilyMatcherMac.mm
@@ -32,6 +32,7 @@
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import <math.h>
+#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontTraits.h"
#include "platform/LayoutTestSupport.h"
#include "platform/mac/VersionUtilMac.h"
@@ -125,11 +126,12 @@ static BOOL betterChoice(NSFontTraitMask desiredTraits,
// exact match comparing the desiredFamily to the PostScript name of the
// installed fonts. If that fails we then do a search based on the family
// names of the installed fonts.
-NSFont* MatchNSFontFamily(NSString* desiredFamily,
+NSFont* MatchNSFontFamily(const AtomicString& desiredFamilyString,
NSFontTraitMask desiredTraits,
FontWeight desiredWeight,
float size) {
- if ([desiredFamily isEqualToString:@"BlinkMacSystemFont"]) {
+ DCHECK_NE(desiredFamilyString, FontCache::legacySystemFontFamily());
+ if (desiredFamilyString == FontFamilyNames::system_ui) {
// On OSX 10.9, the default system font depends on the SDK version. When
// compiled against the OSX 10.10 SDK, the font is .LucidaGrandeUI. When
// compiled against the OSX 10.6 SDK, the font is Lucida Grande. Layout
@@ -163,6 +165,7 @@ NSFont* MatchNSFontFamily(NSString* desiredFamily,
return font;
}
+ NSString* desiredFamily = desiredFamilyString;
NSFontManager* fontManager = [NSFontManager sharedFontManager];
// Do a simple case insensitive search for a matching font family.

Powered by Google App Engine
This is Rietveld 408576698