How to get a specific font for display.newText displayed on iOS 5

Hello.

I'd like to display a text on a screen in a font other than native.systemFont

This works:
myText = display.newText(" ", 500, 605, native.systemFont, 36)
myText.text = "TEST123"

This doesn't work:
myText = display.newText(" ", 500, 605, "Arial Black", 36)
myText.text = "TEST123"

It works in the simulator, but all I get is a blank spot on the iPad. I am guessing this is because, the font is actually present on Mac OS X and not on the actual iPad.

How do you guys usually work this ? Do you just use the native.systemFont ? Do you embed a font ? How's the copyright in play here ?

thank you!

First, go to your iPad and download an app called "Fonts".. It will display all the fonts you have on your device.

You could also write a little Corona App, that will list the fonts it finds too.

Any fonts you want to use that a) are not on the device and b) you have legal access to distribute and c) are not corrupt True Type fonts can be included in your app build and with the proper build.settings make them available for your app.

Now, here's the catch. Corona has to use the Exact Font name. Not the font file name, not the font family name.

FWIW: Arial Black is **NOT** a font native to iOS5 on **MY** iPhone 4. So I suspect its not on your iPad either.

If you want to embed your own font, you have to add this block to the plist section of your build.settings:

1
2
3
4
5
    UIAppFonts =
    {
        "orbitron-black.ttf",
        "VIPESRG_.TTF"
    },

excellent information, thank you! it answers ALL of my questions.

you get 50 karma points from me :)

views:1388 update:2011/10/22 9:46:13
corona forums © 2003-2011