Custom Font Issue

Hi all,

Running into a weird problem for iOS. Font is showing up in the emulator (Corona Emulator), but not in actual ipa build. Following steps have been done:

  1. Font is installed on the Mac

  2. Dumped name of font on Mac using the iterator method mentioned in a forum shows the font name as: LiberationSans-Regular

  3. Font is included in the main source tree of the code next to build.settings etc

  4. Build.settings contains:

UIAppFonts = 

            {

                “LiberationSans-Regular.ttf”

            },

  1. Using another device detect lib mentioned elsewhere, have this block of code in various locations (using director lib):

mainFont = “Liberation Sans”

    local device = require(“device”)

    if(device.isApple)then

        mainFont = “LiberationSans-Regular”

    end

  1. I’ve verified that the device.isApple is working on actual devices via native alerts

  2. The Font Book shows the Font name as Liberation Sans Regular, and I’ve tried both ways but neither work

Has anyone implemented this font or know how to trouble shoot this further? I’m running out of options, thanks!

Hi David,

It appears that you have followed all of the recommended steps. Can you please try the same thing with another custom font, and see if the same behavior happens? This might be an issue isolated to the particular font (not common, but it happens).

Thanks,

Brent Sorrentino

Hi David,

It appears that you have followed all of the recommended steps. Can you please try the same thing with another custom font, and see if the same behavior happens? This might be an issue isolated to the particular font (not common, but it happens).

Thanks,

Brent Sorrentino

Hi David, did you fix this issue? if so how? i am having the same problem, thanks

Unfortunately I didn’t f.p. What I ended up doing is setting global values for the font, and doing a check for platform. In the case of iOS i used native font/Helvetica. 

darn… ive used custom fonts all throughout my app ill post here if i find a fix, just curious that code you used in your number 5 bullet point where did you add it? I’m using storyboard not director though…

Not sure how you do this in storyboard, but I have a global class that I load with the detection methods for platform, then in each view near the top I run through some setup/init code in which I specify a font declaration. I suppose I could have done it differently, but I was trying to avoid a lot of global classes for performance reasons, and also it was my first corona app so I was still figuring out some of the architectural stuff.

How custom are the fonts? If you haven’t already, you should read over Apple Human Interface Guidelines: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/ColorImagesText.html?utm_content=bufferae8c2&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer

no it’s just one font, with a pixelly style to go with the theme of my game… @brent if youre listening ive tried with different custom fonts and get the same, the font just doesnt show up… help if you can!

Hi David, did you fix this issue? if so how? i am having the same problem, thanks

Unfortunately I didn’t f.p. What I ended up doing is setting global values for the font, and doing a check for platform. In the case of iOS i used native font/Helvetica. 

darn… ive used custom fonts all throughout my app ill post here if i find a fix, just curious that code you used in your number 5 bullet point where did you add it? I’m using storyboard not director though…

Not sure how you do this in storyboard, but I have a global class that I load with the detection methods for platform, then in each view near the top I run through some setup/init code in which I specify a font declaration. I suppose I could have done it differently, but I was trying to avoid a lot of global classes for performance reasons, and also it was my first corona app so I was still figuring out some of the architectural stuff.

How custom are the fonts? If you haven’t already, you should read over Apple Human Interface Guidelines: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/ColorImagesText.html?utm_content=bufferae8c2&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer

no it’s just one font, with a pixelly style to go with the theme of my game… @brent if youre listening ive tried with different custom fonts and get the same, the font just doesnt show up… help if you can!

@f.p.mcmanus

I have the same problem with corona enterprise on iOS and I don’t want to use native fonts. 

@f.p.mcmanus

I have the same problem with corona enterprise on iOS and I don’t want to use native fonts.