NOTE: This tutorial is outdated and has been replaced by the Using Custom Fonts guide.


  1. Hi Tom,

    thanks again for a straight & helpful tutorial.

    We use custom fonts a lot, so I want to share two small tips:

    1. License

    Normally you have to buy an extra license to use a font in your apps, it’s not enough to have bought the license for web publishing or print (if you’re e.g. working on converting kids books into interactive storybooks). It’s not steep, we in average pay about $20-40 for the license per font.

    2. OTF -> TTF

    We use only TTF because we publish for iOS / Android / Kindle / NOOK – hey, that’s what the Coronalabs SDK was made for. :-)
    So we sometimes need to convert OTF -> TTF. A very fast, free (and hassle-free) online converter doing the task nicely is:
    http://www.freefontconverter.com

    Best,
    Andreas

  2. Hi!

    I Have a question.

    With custom font, on the device font is sometimes misplaced, and appears a couple of pixels higher or lower. Do you know what is the problem or how to fix that?

    the difference also appears to be different on different devices.

    • Julius Bangert says:

      Stiven, did you ever figure this out? I’ve noticed this problem with the text being slightly higher on the device compared to the simulator. I’ve been aware of this the whole time I’ve been developing my game but kind of ignored it as something I could fix at the end. Really need to fix it now though.

  3. How about an article on bitmap fonts – if you want to make your game look that little more polished this is really the only route to go. So far as I can teel the only way is to use a pretty outdated community module (bmf.lua) or the third-party Text Candy option. Some advice on this would be pretty helpful.

  4. I was trying to use custom font in my Android device (Galaxy S-I) but even following the instructions above the custom font was not working.

    After several tentatives and tests, I found that the problem was that my font file was with its extension in capital letters (.TTF). I changed the font file extension to .ttf and it worked perfectly.

  5. I was fighting an with a Font on my Droid Razr. Read Renato’s comment above and found that the same issue fixed my problem too.

    The font file extension ( TTF ) must be lower case; ttf

    As soon as I changed that, my font display perfectly on Device.

  6. Hi,

    I found this tutorial very useful; however, i’m facing a problem with font family to work in Win. I have 2 fonts, helveticaneue.ttf and HelveticaNeue-Bold.ttf, and i installed them in My Win 7, but i can get only Helvetica Neue font name to work.
    How can i get the Bold one to work? i used the above method to get font name from system font, but there’s no HelveticaNeue-Bold printed. Anyone has solved this?

    By the way, it seems to work fine on Mac and IOS.

    Thanks.

  7. Can the fonts be in a folder or do they need to be at the project root?
    If in a folder, what needs to change to the syntax of build_settings??

    Thx
    D

  8. Hi,
    after some test i was able to understand how to use correctly custom fonts under android.
    1) choose a .ttf font file and put it in the root folder (where main.lua is) of your app. File name extension (.ttf) MUST be lowercase
    2) No need to write something in build.setting (for android)
    3) Under emulator font file must be referenced by Font Name but under android font file must be referenced by file name. So in my case i put LUNAKRONIKLIGHT.ttf under root folder of my app, i installed it in my OS and referenced it (in emulator) with “Luna Kronik Light”. Under android device i referenced it with LUNAKRONIKLIGHT. It took me some time to understand. If you change the name of the file and set it equal to font name you won’t need to detect if you are under emulator or under real device. In my case i renamed “LUNAKRONIKLIGHT.ttf” in “Luna Kronik Light.ttf” and have it work under emulator AND under android device with same name convention.
    Hope it helps
    Federico Pici

  9. Not working. The font is listed via native.getFontNames() but newText does not display.

    swap font to “Arial” (or any of the other preloaded fonts) and everything works… :(

  10. I can confirm, fonts not working on my Android devices.
    – Fonts are .tff (lowercase) in main.lua directory
    – added to UIAppFonts in build.settings

    I don’t even see the custom font names in native.getFontNames(). I’m using corona ver 2014.2456

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>