2

I added a custom Chinese font to my project, (followed the instruction here). I only want to set the font for a few buttons, but when i do this in code or in storyboard, all the other labels, buttons, textFields.. are all set to this font too. And this only happens to ios8, and it works fine on ios9. Why did this happen, can anyone help?

this is my code to set the font:

UIFont *hannotate = [UIFont fontWithName:@"Hannotate SC" size:18];
self.button1.titleLabel.font = hannotate;
self.button2.titleLabel.font = hannotate;

this is what i set in storyboard:

enter image description here

Updation1:

this is screenshot of my Info.plist, I have change the font name everywhere to "FHTHannotateSC".

enter image description here

Updation2

I printed all the fonts in ios 8 system, and found i was using the font family name(Hannotate SC) as the font name, the real font name is "HannotateSC-W5", so i corrected the font name, and run the APP again, but unluckily, the font is still global set.

Community
  • 1
  • 1
MudOnTire
  • 506
  • 3
  • 9

1 Answers1

2

I solved this problem by doing following steps: 1. Go to project target 2. Choose Build Phase option 3. Add the font files in Copy Bundle resources.

May this help you!

Vibha Thakur
  • 171
  • 1
  • 1
  • 10
  • Hi dude, I have already done that, or the font can't not be set to any UI widgets. The problem is the system did much more I want it to do. I only want 2 buttons to use the font, but now other labels, buttons are forced to use the font. – MudOnTire May 10 '16 at 12:16