diff options
author | 2012-09-10 20:18:24 +0000 | |
---|---|---|
committer | 2012-09-10 20:18:24 +0000 | |
commit | 8d7d052ca4120f8fe89fd129003f6298d3d042d5 (patch) | |
tree | 659fbb7ef931c3a3436fb6f56b2150fac468f30c /src/ports/SkFontHost_mac_coretext.cpp | |
parent | 2f5db885d7edf0163d78cb629551e5cf5056a41d (diff) |
land https://codereview.appspot.com/6492099/ -- fix for iOS
git-svn-id: http://skia.googlecode.com/svn/trunk@5474 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkFontHost_mac_coretext.cpp')
-rw-r--r-- | src/ports/SkFontHost_mac_coretext.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 307985fbc5..40e73a2305 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -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); |