Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SenticoSansDT - Medium and thin not loading in xcode

Tags:

xcode

ios

uifont

I tried to load the following fonts

SenticoSansDT - Light
SenticoSansDT - Regular
SenticoSansDT - Thin
SenticoSansDT - Medium

all are font file with extension .ttf

i added to Xcode and check the target. added the fonts in build phase as well as info.plist. but i'm seeing only the Regular and Light font to be enabled. Medium is not showing in Font book and also in story board

like image 782
Sri Avatar asked Mar 21 '16 11:03

Sri


1 Answers

Install the .ttf file on mac and use this below code to find the exact name of the font.

NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger indFamily, indFont;
NSInteger fontsCount = [familyNames count];

for (indFamily = 0; indFamily < fontsCount; ++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]);
    }

}

Use the Font name of "SenticoSansDT Medium and Thin" printed on the log.

like image 103
Maniganda saravanan Avatar answered Sep 22 '22 19:09

Maniganda saravanan