Repository: incubator-weex
Updated Branches:
  refs/heads/master db76e84c2 -> 806e1a0b8


*[ios]fix CTFont crash on iOS10


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/a790bedd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a790bedd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a790bedd

Branch: refs/heads/master
Commit: a790beddfe60f65935963f693c9f931c86db608d
Parents: 5b901c0
Author: fjzznjsh <fjzzn...@163.com>
Authored: Fri Mar 9 17:27:27 2018 +0800
Committer: fjzznjsh <fjzzn...@163.com>
Committed: Fri Mar 9 17:27:27 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a790bedd/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m 
b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
index 042f0a6..f4211bd 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
@@ -464,12 +464,8 @@ do {\
     
     // set font
     UIFont *font = [WXUtility fontWithSize:_fontSize textWeight:_fontWeight 
textStyle:_fontStyle fontFamily:_fontFamily 
scaleFactor:self.weexInstance.pixelScaleFactor useCoreText:[self useCoreText]];
-    CTFontRef ctFont = CTFontCreateWithName((__bridge 
CFStringRef)font.fontName,
-                                           font.pointSize,
-                                           NULL);
-    if (ctFont) {
-        [attributedString addAttribute:(id)kCTFontAttributeName 
value:(__bridge id)(ctFont) range:NSMakeRange(0, string.length)];
-        CFRelease(ctFont);
+    if (font) {
+        [attributedString addAttribute:NSFontAttributeName value:font 
range:NSMakeRange(0, string.length)];
     }
     
     if(_textDecoration == WXTextDecorationUnderline){

Reply via email to