Search code examples
iosxcodeipadfontsapp-store

Font on UILabel different when in App Store versus Xcode


This is a very very strange issue. I have added a custom font to my iPad app. The font is a modified Times New Roman font provided by the company that enlisted me to make this app. The font and the size are set in code in the app and is updated on a timer (as the font size changes) and applied to 5 different labels.

When run from Xcode onto an iPad or in the iPad simulator the font displays correctly, proper size and font type. However, after publishing to the app store the company contacted me and told me that the fonts were totally wrong. I downloaded the update from the App Store onto my iPad and lo and behold the font was completely different. The font had returned to Arial 12pt, when it should have been Modified Times New Roman 50pt (which had been demonstrated on my iPad).

I tried changing the compiler type to see if it was an error there but that didn't help. My Xcode is fully updated and running iOS SDK beta for iOS 7 (that isn't the issue since I released this version when I was running the iOS 6 SDK). My workstation is a black MacBook from 2008 (I know terrible specs but it works) with 2 GB of RAM and an Intel Core 2 Duo. The only other program running at the same time (to eliminate write errors as the issue).

Does anyone have any ideas about what could be causing this problem? And how I could fix it?

Thank you!!! Been struggling with this for several days and couldn't find anything on it anywhere.


Solution

  • As mentioned in my comment, the issue is likely that the font was not bundled in the app. It may have been attached at the target or source at some point, getting it in your DerivedData, and later accidentally removed. This would make it appear in your app when you built it for the simulator or your phone but not when you archived it.

    You should be able to see the actual behavior by deleting your DerivedData from your Mac and deleting the apps from your simulator/phone. Your next build will show the wrong font. Adding the fonts back into your target will get it to build correctly.