UILabel
에 맞춤 글꼴을 사용하고 싶습니다.CIFontRef를 UIFont로 변환하는 방법?
NSString *fontPath = ... ; // a TTF file in iPhone Documents folder
CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]);
CGFontRef customFont = CGFontCreateWithDataProvider(fontDataProvider);
CGDataProviderRelease(fontDataProvider);
가 어떻게이 CGFontRef
UIFont
A를가 [UILabel setFont:]
에 사용되는 변환 할 수 있습니다 : 사용자 정의 글꼴 파일에서에 의해로드?
어떤 iOS 버전을 지원해야합니까? Info.plist를 편집하여 번들 된 글꼴을'UIFont' 인스턴스로로드 할 수 있습니다. – Costique
CGFontRef를 UIFont로 변환하는 것에 대해서는 확신이 없지만 CGFontRef를 사용하는 UILabel의 하위 클래스를 만들 수 있습니다. 이 [blog] (http://blog.mro.name/2010/08/uilabel-with-a-custom-cgfont/)에서 확인하십시오. –
@Costique iOS 4.3 이상은 정상입니다.글꼴은 사용자가 앱을 다운로드 한 후 추가되므로 Info.plist를 미리 설정할 수 없습니다. – ohho