git-svn-id: http://skia.googlecode.com/svn/trunk@5474 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-09-10 20:18:24 +00:00
parent 2f5db885d7
commit 8d7d052ca4

View File

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