land https://codereview.appspot.com/6492099/ -- fix for iOS
git-svn-id: http://skia.googlecode.com/svn/trunk@5474 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
2f5db885d7
commit
8d7d052ca4
@ -362,12 +362,17 @@ private:
|
||||
};
|
||||
|
||||
static SkFontID CTFontRef_to_SkFontID(CTFontRef fontRef) {
|
||||
SkFontID id = 0;
|
||||
// CTFontGetPlatformFont and ATSFontRef are not supported on iOS, so we have to
|
||||
// bracket this to be Mac only.
|
||||
#if SK_BUILD_FOR_MAC
|
||||
ATSFontRef ats = CTFontGetPlatformFont(fontRef, NULL);
|
||||
SkFontID id = (SkFontID)ats;
|
||||
id = (SkFontID)ats;
|
||||
if (id != 0) {
|
||||
id &= 0x3FFFFFFF; // make top two bits 00
|
||||
return id;
|
||||
}
|
||||
#endif
|
||||
// CTFontGetPlatformFont returns NULL if the font is local
|
||||
// (e.g., was created by a CSS3 @font-face rule).
|
||||
CGFontRef cgFont = CTFontCopyGraphicsFont(fontRef, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user