You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/09/26 05:01:56 UTC
[incubator-weex] branch master updated: Fix CTFont changed under
xcode11 build. (#2936)
This is an automated email from the ASF dual-hosted git repository.
jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 344bb3f Fix CTFont changed under xcode11 build. (#2936)
344bb3f is described below
commit 344bb3f7a981cce8e42760e558e154bdce73db52
Author: sunshl <su...@gmail.com>
AuthorDate: Thu Sep 26 13:01:50 2019 +0800
Fix CTFont changed under xcode11 build. (#2936)
Issue: https://github.com/apache/incubator-weex/issues/2935
---
ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm
index a796b49..7827816 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm
@@ -504,9 +504,9 @@ do {\
if (_fontStyle == WXTextStyleItalic) {
CGAffineTransform matrix = CGAffineTransformMake(1, 0, tanf(16 * (CGFloat)M_PI / 180), 1, 0, 0);
- ctFont = CTFontCreateWithName((__bridge CFStringRef)font.fontName, font.pointSize, &matrix);
+ ctFont = CTFontCreateWithFontDescriptor((__bridge CTFontDescriptorRef)font.fontDescriptor, font.pointSize, &matrix);
}else {
- ctFont = CTFontCreateWithName((__bridge CFStringRef)font.fontName, font.pointSize, NULL);
+ ctFont = CTFontCreateWithFontDescriptor((__bridge CTFontDescriptorRef)font.fontDescriptor, font.pointSize, NULL);
}
_fontAscender = font.ascender;
@@ -898,7 +898,7 @@ do {\
CGFloat fontSize = font ? CTFontGetSize(font):32 * self.weexInstance.pixelScaleFactor;
UIFont * uiFont = [UIFont systemFontOfSize:fontSize];
if (uiFont) {
- font = CTFontCreateWithName((__bridge CFStringRef)uiFont.fontName, uiFont.pointSize, NULL);
+ font = CTFontCreateWithFontDescriptor((__bridge CTFontDescriptorRef)uiFont.fontDescriptor, uiFont.pointSize, NULL);
}
if (font) {
attrs[(id)kCTFontAttributeName] = (__bridge id)(font);