Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

custom font not displaying on some simulator

I have tried deleted font from the xcode project and and copied again by dragging, but still custom font named "Helvetica-Neue-LT-Com-75-Bold-Outline.ttf" is not working on iphone 4 and 5c simulator but working in 5s simulator.

To set the font name to UILabel, I am using the name from fontbook app.

like image 500
Parth Pandya Avatar asked Sep 26 '14 07:09

Parth Pandya


People also ask

How do you change font size in simulator?

Go to File -> Settings -> Editor -> Font -> Size. Now Enter the suitable size and click Apply.

How do you show touches on iPhone simulator?

You can show touch indicators in the iOS simulator by opening Terminal and running defaults write com. apple. iphonesimulator ShowSingleTouches 1 . You can turn this setting off again by running defaults write com.


2 Answers

Follow this steps,it's work fine

1.Select the project

2.Select Targets->Build Phases->Copy Bundle Resoures->Click + Button->Add your Custom font

Like this:

enter image description here

like image 94
Preetha Avatar answered Oct 24 '22 11:10

Preetha


Few things after including the font files in your project:

  1. Include them in the target
  2. Include them as bundle resources
  3. Include them on your app's plist
  4. Make sure you're referring to the correct font name.

You can log all fonts by putting this on your app delegate's didFinishLaunchingWithOptions:

for (NSString* family in [UIFont familyNames])
{
    NSLog(@"%@", family);

    for (NSString* name in [UIFont fontNamesForFamilyName: family])
    {
        NSLog(@"  %@", name);
    }
}

Details here: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

like image 42
aj_f Avatar answered Oct 24 '22 10:10

aj_f