0

I have copy my ttf font (ABeeZee-Italic.ttf) from Google WebFonts into Supporting Files and added into plist :

enter image description here

and assign my Label with tag = 4 :

enter image description here

because I have this code to embed fonts into UILabel:

for (UILabel *customLabel in [[self view] subviews]) {
    if (customLabel.tag == 1) {
        [customLabel setFont:[UIFont fontWithName:@"Raleway-ExtraLight" size:21]];
    } else if (customLabel.tag==2){
        [customLabel setFont:[UIFont fontWithName:@"ABeeZee-Regular" size:14]];
    } else if (customLabel.tag==3){
        [customLabel setFont:[UIFont fontWithName:@"ABeeZee-Regular" size:11]];
    } else if (customLabel.tag==4){
        [customLabel setFont:[UIFont fontWithName:@"ABeeZee-Italic" size:12]];
    }
}

it's all working like a charm, but the italic font is not loaded into my iPod (iOS 6.1.3). UILabel with tag 4 is the iOS system font. not ABeeZee-Italic.

I tried to change the tag number, but also failed. Is there any specific requirements for non-regular font to be embedded into iOS?

thank you

UPDATE @iPatel answer : here's how my FontBook looks like, it has same name... enter image description here

Saint Robson
  • 5,475
  • 18
  • 71
  • 118

2 Answers2

1

Check what is real name of font (ABeeZee-Italic) in "FontBook" ? and write name of font which is in "FontBook".

And use such like

[myLabelName  setFont: [UIFont fontWithName:@"Font Name From Font Book" size:32]];

More information about how to add custom font in app. then read This Answer.

EDITED:

Also try with

  • Select Your font from your project
  • right click
  • Open With External Editor
  • Install Font
  • select inserted font
  • And check what is "Full name", copy and past it in your code:

May be helpful :)

Community
  • 1
  • 1
iPatel
  • 46,010
  • 16
  • 115
  • 137
1

You can do this in two ways.

Using ttf file

[customLabel setFont:[UIFont fontWithName:@"Raleway-ExtraLight.ttf" size:21]];

or

Using font name

[customLabel setFont:[UIFont fontWithName:<Name of Raleway-ExtraLight> size:21]];

In your case just add .ttf in setFont: else get Name of font as shown in below image.

Just right click on .ttf file > Get Info > Full Name (your font name. You can use this name as font name in setFont)

enter image description here

EDIT

Check the full name here and paste it in your code.

[customLabel setFont:[UIFont fontWithName:@"ABeeZee Italic" size:21]];

EDIT 1

May be you need to Register Fonts. Just try to register and check.

Community
  • 1
  • 1
βhargavḯ
  • 9,786
  • 1
  • 37
  • 59