0

I want to change the font of label. And font which i am using is shown in image. How use it in my application. I have already add in .plist as show in image. But it not working proper. How i manage it?

Thanks in advances...enter image description here

iRavan12
  • 101
  • 6

5 Answers5

1

Use this to set the font programmatically:

[TheLabelName setFont:[UIFont fontWithName:@"American Typewriter" size:18]];
Sheni
  • 129
  • 8
0

Custom fonts in IOS

to set an label font just

yourLabel.font = [UIFont fontWithName:@"CloisterBlack" size:64.0];
Alex Terente
  • 12,006
  • 5
  • 51
  • 71
0

If you want to use the standard font, then just as usually: you can set it in the interface builder for this label or programmatically for this label.

If you want to apply your custom font (according to the image you want that), then you can do smth. like

     UIFont *font = [UIFont fontWithName:@"MyFont" size:20];
     [label setFont:font];

Also you can explore this ref: Can I embed a custom font in an iPhone application?

it might be useful in your case.

Community
  • 1
  • 1
makaron
  • 1,585
  • 2
  • 16
  • 30
0

Add your custom font file .ttf in resourse and use every time when you want to display formatted font like

headLbl.font = [UIFont fontWithName:@"Museo-700" size:20.f];
Hiren
  • 12,720
  • 7
  • 52
  • 72
0

Add a font in your resource directory like this image that you have already done now main thing you cann't wirte the name of the font that you have added as it is check my image font having name ROCKB.ttf but i have write the Rockwell-Bold so you have to check by what name it has been installed in your code then pick the name from there and then put that name in lable the font will reflect the label now.enter image description here

label.font = [UIFont fontWithName:@"Rockwell-Bold" size:20];

and font family by this code NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; NSArray *fontNames; NSInteger indFamily, indFont; for (indFamily=0; indFamily<[familyNames count]; ++indFamily) { NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); fontNames = [[NSArray alloc] initWithArray: [UIFont fontNamesForFamilyName: [familyNames objectAtIndex:indFamily]]]; for (indFont=0; indFont<[fontNames count]; ++indFont) { NSLog(@" Font name: %@", [fontNames objectAtIndex:indFont]); } [fontNames release]; } [familyNames release];

B25Dec
  • 2,301
  • 5
  • 31
  • 54