FontWithName: size: How to import my own font for a project?

I am trying to import my own font into a project and I am stuck. I do my research and found this but Starting with iOS 3.2, this functionality is built-in. If you need to support pre-3.2, you can still use this solution. , and I am creating an application for iOS 5.0.

I'm trying to use fontWithName:size:, and the docs , said he fully specified font name. This name includes both the name of the font family and specific style information for the font. So put your display name there.

cell.textLabel.font = [UIFont fontWithName:@"Sansation-Light" size:10.0];

But that will not work. Where can I store this font? In my project? is this the correct name? My font name:Sansation_Light.ttf

+3
source share
3 answers

For this

  You have to add  key   "Fonts provided by application" in your info.plist .   
  for that key add  your ttf file name  for ex: "Sansation_Light.ttf" .
  it works fine for me.
+1
source

It seems that the line between Sansation and Light should be

cell.textLabel.font = [UIFont fontWithName:@"Sansation_Light" size:10.0]; 

Or change the font name to Sansation-Light.ttf

-1
source

All Articles