-1

i want to change my label's font using below code:

UILabel *lblBolge = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 38)];
lblBolge.text=@"Bölge";
lblBolge.font=[UIFont fontWithName:@"CarterOne" size:10];

but still i see system font and default size

any reason?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ercan
  • 825
  • 3
  • 16
  • 27
  • 2
    you did not add the font to your project correctly. there may be several things that you could do wrong. The process of adding a font has been covered multiple times here. Google it – Andrey Chernukha Jun 18 '14 at 10:28
  • Where do you actually add it to its superview? Are you sure you didn't get confused with the object declared in interface builder and the newly allocated object in your code? – Hermann Klecker Jun 18 '14 at 10:31
  • in viewdidLoad function – ercan Jun 18 '14 at 10:32

1 Answers1

1

Carter font is not part of the iOS SDK. To add a custom font you need to get hold of the .ttf or .otf file of the font and add it to your project. Here's a tutorial on how to do that.

Community
  • 1
  • 1
NavinDev
  • 995
  • 1
  • 7
  • 8