Custom Font not loading on build

PROBLEM SOLVED!

Hi Peach,

I tried lots of things to solve this problem, my last try was to install OSX Lion and the newest Xcode 4.2.1 - but still the problem persisted and caused me some headache.

But in the end I solved it, and the reason is a slight misunderstanding of the Corona Project Manager file handling:

In the assests-list in the CPM I only had the main.lua, config.lua and build.settings files.
In the project folder I had these files AND the “Harrowprint.ttf”.

I just didn’t draw the font file into the assets in CPM because I didn’t think that I have to do this - because it’s only a reference to the font file, and of course I thought that the simulator knows the project folder and because of this the font file will be loaded, too.

And the font was working in the simulator, so obviously the simulator knew where to find the font.

This is were I was wrong, the simulator is not even interested in knowing the font location, I don’t have to provide the font because the font is already installed in the system (Suitcase Fusion 3 in my case).

But if the font isn’t referenced in the CPM assets, the font file won’t be packed into the IPA, and there it was, my very annoying problem.

And of course it worked with my test project on the Mac of another developer, because he just added the complete project folder to CPM and the font file was included into the assets list.

So it’s my new rule: If I want it in my project, I put it into the CPM assets list.

Easy, hm? But on the bright side I made the update to OSX Lion, installed the newest Xcode and learned a lot about frustration tolerance. And happily I didn’t blame someone else. :slight_smile:

Thanks for your time!

Best,
Andreas

P.S.:
Now all works as intended on iPad 1, iPad 2, iPhone 4 and Kindle Fire.
[import]uid: 107675 topic_id: 19520 reply_id: 81269[/import]

@a.lepel:

I understand how frustrating that issue of font is since I got the same issue but for a difference reason. Peach resolved my issue as you see above ( thanks Peach;)

I too uses CPM and for the future, there is a check box that show up in the project window ( when double click on the project) that check box allow to automatically add assets or Lua files to a project anytime you add such file to the project folder on your computer. Ie, you do not need to drag new assets files into CPM window, the system can do that for you. It really my life easier and I hope this will be helpful to you. Good luck for your project.

Mo

ps: once you check that box ( sorry, I am not in front my Mac, not sure of the name of the check box) a text line will show up and you just enter the files extension you need CPM to add automatically to your project. Something like: lua, mp3, png, ttf, jpeg… [import]uid: 49236 topic_id: 19520 reply_id: 81294[/import]

@lemsim:

You’re absolutely right, and think this will help some other developers to avoid that little trap.
I did check the box and all the files got automatically added to the assets - but I definitely did NOT add .ttf into the line. I didn’t want the asset to show up in CMP, it’s already a bit cluttered there with all the assets of a bigger project, even having the images and LevelHelper files in subdirs.

Development & bugs - a never-ending story. I found a problem with fonts & kindle Fire, but for this I will start another threat.
[import]uid: 107675 topic_id: 19520 reply_id: 81301[/import]

Thanks for the update - very interesting indeed. I don’t use CPM currently so I wasn’t aware of this issue but will recall it in the future if others have similar issues, so thanks :slight_smile:

RE Lion, if you’re still interested, yes - I run Lion on two of my three machines - I love it. (It’s especially cool if you use a magic trackpad with an iMac, IMHO.)

Peach :slight_smile: [import]uid: 52491 topic_id: 19520 reply_id: 81438[/import]