summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm')
-rw-r--r--chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm b/chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
index 42cdbedf9f2..822aa8cb8f0 100644
--- a/chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
+++ b/chromium/third_party/WebKit/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
@@ -223,9 +223,14 @@ void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp,
static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ ProviderInfo info = { cp, length, stringAttributes.get() };
+ RetainPtr<CTTypesetterRef> typesetter(AdoptCF, WKCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+#else
RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, cp, length, kCFAllocatorNull));
RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), stringAttributes.get()));
RetainPtr<CTTypesetterRef> typesetter(AdoptCF, CTTypesetterCreateWithAttributedStringAndOptions(attributedString.get(), m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+#endif
line.adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
} else {