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

Unified Diff: Source/core/platform/graphics/mac/FontCacheMac.mm

Issue 14856004: Finish removing WebKitSystemInterface from Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify Created 7 years, 8 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: Source/core/platform/graphics/mac/FontCacheMac.mm
diff --git a/Source/core/platform/graphics/mac/FontCacheMac.mm b/Source/core/platform/graphics/mac/FontCacheMac.mm
index d3fbcbef8127e4c5c844130858853d49cfac1a91..8191d9b8ecf5bd3a82749cf0d945e2a12f686c76 100644
--- a/Source/core/platform/graphics/mac/FontCacheMac.mm
+++ b/Source/core/platform/graphics/mac/FontCacheMac.mm
@@ -34,7 +34,6 @@
#import "core/platform/graphics/Font.h"
#import "core/platform/graphics/FontPlatformData.h"
#import "core/platform/graphics/SimpleFontData.h"
-#import "core/platform/mac/WebCoreSystemInterface.h"
#import "core/platform/mac/WebFontCache.h"
#import <wtf/MainThread.h>
#import <wtf/StdLibExtras.h>
@@ -45,6 +44,12 @@ extern "C" {
void CGFontSetShouldUseMulticache(bool enable);
}
+// Request for public API: rdar://13803570
+@interface NSFont (WebKitSPI)
++ (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSRange)range inLanguage:(id)useNil;
++ (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)useNil;
+@end
+
namespace WebCore {
// The "void*" parameter makes the function match the prototype for callbacks from callOnMainThread.
@@ -100,11 +105,11 @@ PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacters(const Font& font,
NSFont *nsFont = platformData.font();
NSString *string = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(characters) length:length freeWhenDone:NO];
- NSFont *substituteFont = WKGetFontInLanguageForRange(nsFont, string, NSMakeRange(0, length));
+ NSFont *substituteFont = [NSFont findFontLike:nsFont forString:string withRange:NSMakeRange(0, length) inLanguage:nil];
[string release];
if (!substituteFont && length == 1)
- substituteFont = WKGetFontInLanguageForCharacter(nsFont, characters[0]);
+ substituteFont = [NSFont findFontLike:nsFont forCharacter:characters[0] inLanguage:nil];
if (!substituteFont)
return 0;

Powered by Google App Engine
This is Rietveld 408576698