提交 1b3011c2 编写于 作者: B Behdad Esfahbod

[coretext] Pass buffer language to CoreText

上级 3eb6a4db
......@@ -698,6 +698,18 @@ retry:
CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
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),
kCTFontAttributeName, font_data->ct_font);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册