我想为一个UILabel
使用自定义字体。自定义字体是从文件中加载的:
NSString *fontPath = ... ; // a TTF file in iPhone Documents folder
CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]);
CGFontRef customFont = CGFontCreateWithDataProvider(fontDataProvider);
CGDataProviderRelease(fontDataProvider);
我该如何将 CGFontRef
转换为 UIFont
,以便在 [UILabel setFont:]
中使用?
UIFont
实例加载。 - Costique