[coretext] Pass buffer language to CoreText

This commit is contained in:
Behdad Esfahbod 2014-08-12 19:17:19 -04:00
parent 3eb6a4dbf2
commit 1b3011c27d
1 changed files with 12 additions and 0 deletions

View File

@ -698,6 +698,18 @@ retry:
CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
kCTVerticalFormsAttributeName, kCFBooleanTrue); kCTVerticalFormsAttributeName, kCFBooleanTrue);
} }
if (buffer->props.language)
{
CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault,
hb_language_to_string (buffer->props.language),
kCFStringEncodingUTF8,
kCFAllocatorNull);
if (unlikely (!lang))
FAIL ("CFStringCreateWithCStringNoCopy failed");
CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
kCTLanguageAttributeName, lang);
CFRelease (lang);
}
CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
kCTFontAttributeName, font_data->ct_font); kCTFontAttributeName, font_data->ct_font);