Skip to content

Instantly share code, notes, and snippets.

@xhacker
Created October 5, 2017 14:16
Show Gist options
  • Save xhacker/2a505210bb93b529a7bcac8998957a4b to your computer and use it in GitHub Desktop.
Save xhacker/2a505210bb93b529a7bcac8998957a4b to your computer and use it in GitHub Desktop.
NSArray *cascadeList = @[[UIFontDescriptor fontDescriptorWithName:@"Helvetica" size:20.0],
[UIFontDescriptor fontDescriptorWithName:@"PingFangTC-Regular" size:20.0]];
CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes((CFDictionaryRef) @{(id)kCTFontCascadeListAttribute: cascadeList});
UIFont *font = (__bridge_transfer UIFont *) CTFontCreateWithFontDescriptor(descriptor, 20, NULL);
CFRelease(descriptor);
self.label.font = font;
self.label.text = @"Helvetica fallback 到 PingFangTC-Regular 汉体书写信息技术标准相容档案下载使用界面简单支援服务升级资讯专业制作创意空间快速无线上网";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment