I am trying to use a custom font in my iPhone app but somehow it does not load I believe at all in the app as a start to my problem.
I dragged and dropped the "My Font.ttf" in xcode and create the key with UIAppFonts. First question: I guess the these 2 names should be strictly identical i.e. my key must display the the exact filename and so with the extension ".ttf"...? what about if upper/lower case? what about if there are spaces in the filename...?
Then I use this:
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSLog(@"Fonts: %@", [UIFont familyNames]);
[familyNames release];
to display all the fonts and clearly see that my font is NOT there....
Then so when I use that below, nothing works (for sure):
lblSol1.font = [UIFont fontWithName:@"My Font" size:32];
(if I replace by Arial, it does work so I can only think it has to do with the loading of the font...)
I understood that the name to use with -fontWithName can be different that filename (and is actually the name of the font "fullname" when you open in the get info window). Anyway, I by now tried all combinations and can't get it to work...
(I also did deploy and build for iOS 4.o to be sure to be far from 3.2 in case of..)
Thanks for your help.
Cheers, geebee
EDIT1: the result (as asked) of showing the fonts is: Fonts: ( "Arial Hebrew", Zapfino, "Oriya Sangam MN", Cochin, Baskerville, Palatino, "Chalkboard SE", "Gurmukhi MN", Verdana, "Tamil Sangam MN", "Marker Felt", "Courier New", Courier, "Trebuchet MS", "DB LCD Temp", "Apple Color Emoji", "Arial Rounded MT Bold", "Bangla Sangam MN", "Telugu Sangam MN", "American Typewriter", Arial, Kailasa, AppleGothic, "Hiragino Kaku Gothic ProN", "Heiti SC", "Malayalam Sangam MN", Thonburi, Helvetica, Noteworthy, "Gujarati Sangam MN", "Heiti K", Futura, "Devanagari Sangam MN", "Heiti TC", "Sinhala Sangam MN", "Kannada Sangam MN", Georgia, "Heiti J", "Times New Roman", "Snell Roundhand", "Geeza Pro", "Helvetica Neue"