Why isn't my custom font working?

Why isn’t my font working? I’m using Quicksand (quicksand.ttf), and I followed all the instructions in http://www.coronalabs.com/blog/2011/07/13/custom-fonts-corona/.

UIAppFonts = { "quicksand.ttf" } 

And then:

myText = display.newText("10" , 0, 0, Quicksand, 20)

All I get is the native.systemFont (I think it’s Helvetica). Is it just the simulator? I’m using windows, but because it’s a .ttf it means that it should be shown on the Windows Simulator.

Thanks guys!

You are setting the font name as a variable, so unless you have Quicksand = “Quicksand” somewhere before you need to do:

[lua]

myText = display.newText(“10” , 0, 0, “Quicksand”, 20) – Font name as string

[/lua]

Also, you might want to read through this just in case:

http://coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Naomi

@jonjonsson thanks, that worked!

@naomi I saw that article too. 

Are there any advantages to making a Font Texture Atlas using something like bmGlyph instead of including the font file and using display.newText, other than maybe having extra effects?

For my project I needed exact size and placement for numbers so I ended up using a bitmapped font (numbers only).  I think my case is not the norm though. Using newText with font file is almost always fine.

You are setting the font name as a variable, so unless you have Quicksand = “Quicksand” somewhere before you need to do:

[lua]

myText = display.newText(“10” , 0, 0, “Quicksand”, 20) – Font name as string

[/lua]

Also, you might want to read through this just in case:

http://coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Naomi

@jonjonsson thanks, that worked!

@naomi I saw that article too. 

Are there any advantages to making a Font Texture Atlas using something like bmGlyph instead of including the font file and using display.newText, other than maybe having extra effects?

For my project I needed exact size and placement for numbers so I ended up using a bitmapped font (numbers only).  I think my case is not the norm though. Using newText with font file is almost always fine.