Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Development: how to use custom fonts?

I used a special font in my photoshop design,

  1. is it possible to use these fonts natively in the iphone app? or

  2. do I need to convert them into an image first?

  3. If this is the only way to do it, what do you do with dynamic text?

like image 946
001 Avatar asked Dec 16 '10 16:12

001


People also ask

How do you use custom fonts on iPhone?

You can download fonts from the App Store app , then use them in documents you create on iPhone. After you download an app containing fonts from the App Store, open the app to install the fonts. To manage installed fonts, go to Settings > General, then tap Fonts.


1 Answers

  1. Copy your font file into Resources

  2. In your application .plist create (if it's exist just create a row) a row called "Fonts provided by application" and then in "item 0" copy your font name for example "Ciutadella-Bold.otf" (if there are some spaces in font name, rename it and for example replace all spaces to minus '-')

  3. Then you can define this font in your application:

    UIFont *CiutadellaBold = [UIFont fontWithName:@"Ciutadella-Bold" size:17.0f];
    
  4. And use in for instance in uiLabel:

    [uiLabel setFont:CiutadellaBold];
    
like image 88
edzio27 Avatar answered Sep 22 '22 09:09

edzio27