[coretext] Add version guards for kCTLanguageAttributeName

This commit is contained in:
Behdad Esfahbod 2014-08-12 19:26:35 -04:00
parent 1b3011c27d
commit 20076cc41e
1 changed files with 7 additions and 0 deletions

View File

@ -698,8 +698,15 @@ retry:
CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
kCTVerticalFormsAttributeName, kCFBooleanTrue);
}
if (buffer->props.language)
{
/* What's the iOS equivalent of this check?
* The symbols was introduced in iOS 7.0.
* At any rate, our fallback is safe and works fine. */
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
# define kCTLanguageAttributeName CFSTR ("NSLanguage")
#endif
CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault,
hb_language_to_string (buffer->props.language),
kCFStringEncodingUTF8,