开发者

Custom Fonts in Application

开发者 https://www.devze.com 2023-03-12 18:57 出处:网络
I have one font named ArnovalTCStd.otf which I want to use in my iPad application for开发者_如何学Go some labels. How can I do it ?Please make sure that your font is supported for iPad.

I have one font named ArnovalTCStd.otf which I want to use in my iPad application for开发者_如何学Go some labels. How can I do it ?


Please make sure that your font is supported for iPad. Please use following loop to identify list of Font Family

for (NSString *familyName in [UIFont familyNames])
{
    NSLog(@"Font Family = %@", familyName);

    for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]){
        NSLog(@"\t%@", fontName);
    }
}


There hasn’t been an easy way to add custom fonts to your iPhone applications. As of iOS 4 it has become very easy to do. Here is what you need to do in order to add custom fonts:

Check How to include ttf fonts to iOS app


Copy your fonts in application's resources folder.

in info.plist file add new row with name Fonts provided by application it will be of type array
add item in it. write your font name in item's value example:-Birch.TTF

than in your code write following line:-

[label1 setFont:[UIFont fontWithName:@"Birch" size:36.0]];
0

精彩评论

暂无评论...
验证码 换一张
取 消