xcode - Having trouble installing specific font in an iOS app - incompatible TTF? -


there font files in code repo font nubian , nubian-alt. licensed , paid , need used. cannot use font in ios, , cannot open font font book though font previews ok in finder , identified truetype font.

finder's view of "bad" font

i started trying add nubian-medium ios app - using key "fonts provided application" in app's info.plist. font did not appear in list generated using:

 (nsstring *familyname in [uifont familynames]) {    (nsstring *fontname in [uifont fontnamesforfamilyname:familyname]) {      nslog(@"%@", fontname);    }  } 

i checked target's "copy bundle resources" build phase, saw font had been added list.

i tried adding font have used in app, "chess-merida-unicode.ttf", check adding font correctly - copied app , added array of fonts provided application, saw appear in "copy bundle resources" list, reported available using above code snippet.

next took @ font in os x - double-clicking open font book font not opened or added. when tried drag nubian fonts font book new collection reported problems files, in tables contained within font file.

font problems displayed font book

selecting fonts , choosing proceed did nothing.

i downloaded trial of third-party app named font agent pro , not load these fonts.

i found sketchy site called fonts.com , downloaded nubian-medium ("ufonts.com_nubian-medium_1_.ttf") - xcode able recognise file.

i checked permissions on these files , made sure rw all, no change.

at point suspect files broken or corrupted in use on web page (that part of project) , works fine. other steps take? can these files added ios project? if there kinds of ttf cannot used in ios project, how can check whether these kind?

step 1: download nubian font : http://www.fontpalace.com/font-download/nubian-thin/

step 2: add font .ttf file in project

step 3: register font application, set fonts provided application key in info.plist file, see screenshot details.

step 4: create label , assign font ,as following

uilabel *lbl = [[uilabel alloc] initwithframe:cgrectmake(0, 0, 200, 50)]; [lbl settext:@"i nubian-thin"]; [lbl setfont:[uifont fontwithname:@"nubian-thin" size:26.0f]];  [self.view addsubview:lbl]; 

see screenshot more reference


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -