3

I try to import my own font to a project and i'm stuck. I do my research and found this but As of iOS 3.2, this functionality is built in. If you need to support pre-3.2, you can still use this solution. and I create app for iOS 5.0.

I'm try to use fontWithName:size: and docs said that The fully specified name of the font. This name incorporates both the font family name and the specific style information for the font. So I Put there my display name.

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

But it doesn't work. Where do i have store this font? In my project? is that correct name? My font name is: Sansation_Light.ttf

Community
  • 1
  • 1
Jakub
  • 13,712
  • 17
  • 82
  • 139

3 Answers3

1

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.
jillu_
  • 132
  • 1
  • 1
  • 6
0

This works! http://kgriff.posterous.com/45359635

Jakub
  • 13,712
  • 17
  • 82
  • 139
-1

It seems to be the line between Sansation and Light, it should be

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

Or change your font name to Sansation-Light.ttf

Christian
  • 318
  • 2
  • 17
  • Even if he changed the file name, doesn't `-fontWithName:size:` use the font's *internal* name? – macserv Apr 24 '12 at 15:22