Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom fonts on iOS app - working in Simulator but not iPad

Encountering a weird problem here. I'm developing a game for my school project (non-commercial), and I'm using a custom font Black Chancery (free under GNU GPL). I followed the instructions from multiple sources, which includes:

  • Add the font to the project (TTF).
  • Modify app-Info.plist to add the font to it ("Fonts provided by application").
  • Using [UIFont fontWithName:@"BlackChancery" size:30] when the font is needed.

I could get the font displayed in the Simulator, however when I load it into my iPad, the default system font is used. I'm pretty sure there isn't a problem with the font itself as it displays in the simulator, and I've used FontForge to open the font without any warnings (following from This Question).

Any help is greatly appreciated. Thanks! :)

like image 443
vemoxy Avatar asked Mar 26 '11 10:03

vemoxy


People also ask

How do I install fonts on Ipados?

You can download fonts from the App Store app , then use them in documents you create on iPad. After you download an app containing fonts from the App Store, open the app to install the fonts. To manage installed fonts, go to Settings > General, then tap Fonts.

How do you use fancy fonts on iPad?

You can use your device's built-in font manager under Settings > General > Fonts, where you'll see installed fonts from Font Diner, iFont, and any other font apps you may have downloaded and used. Tap a font and select a typeface to view a sample.


2 Answers

I can only guess as you haven't posted the contents of your plist or a directory listing of the bundle, but many cases of "resource works on the simulator but not on the device" are caused by the fact that the OS X filesystem is normally configured to be case-insensitive while the filesystem on the device is case sensitive. For example, if your file is named "BlackChancery.TTF" and your plist refers to it as "BlackChancery.ttf", it will be found on the simulator but not on the device.

like image 168
Anomie Avatar answered Oct 22 '22 01:10

Anomie


I was having problem with font not recognizing, I fixed it by checking the correct name of the font by checking info of the font file by Get Info option. In my case the file name was written xyzfont.ttf but actually it was XyzFont.TTF in the info, i replaced and it worked.

Hope, it helps someone.

Another Way I have come across one more way of finding the correct name, is by installing the font in the FontBook..

Just open FontBook from Finder and select User now from File->Add Fonts select the font you want to add into your application, after little processing the FontBook will show the Font listed in with the Correct name, use the name in the FontBook ignoring the actual ttf file name you have imported or, added to plist.. It should work..

like image 28
iphonic Avatar answered Oct 22 '22 00:10

iphonic