| 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;
|
|
|
|
|