Я хочу использовать собственный шрифт для 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:]
?