[SOLVED] Custom fonts are making me sad

Hi all!

So, I’m having problems using custom fonts—as in, they don’t work. In the game I’m working on, if I try to embed a custom font and use it, they font shows up REEEALLY small in the simulator, but then doesn’t show up at all on the device. If I make a brand new project, and do the custom font example that’s in the docs (downloading the font file from the included link), the text shows up, but not with the Harrowprint font.

My settings file is set up properly, and I’ve tried several .ttf and .otf files. Is there some silly little secret that I’m missing?

Thanks! [import]uid: 44896 topic_id: 17617 reply_id: 317617[/import]

do you have the font installed on your computer and a copy of it in your folder with the main.lua file [import]uid: 7911 topic_id: 17617 reply_id: 67069[/import]

I didn’t have it installed, but now I do. And that solves the issue of the font not displaying in the simulator, but it still doesn’t show up on the device.

Logan [import]uid: 44896 topic_id: 17617 reply_id: 67073[/import]

a copy of the font file needs to be in the folder with main.lua also [import]uid: 7911 topic_id: 17617 reply_id: 67075[/import]

Yep, I have the copy of the font file in the same folder. [import]uid: 44896 topic_id: 17617 reply_id: 67078[/import]

Did you include it in the build.settings? See this blog post for a guide on using custom fonts:

http://blog.anscamobile.com/2011/07/custom-fonts-corona/

Also note that on Android, the actual font name must be used (see the blog post for more details). [import]uid: 52430 topic_id: 17617 reply_id: 67089[/import]

Hi, yep! I definitely have it in the build.settings file…I followed the blog post to the letter. Is there some subtle formatting thing that I’m missing? My build.settings file looks like this:

settings =  
{  
 orientation =  
 {  
 default ="landscapeRight",  
 content = "landscapeRight",  
 supported =  
 {  
 "landscapeRight"  
 },  
 },  
 plist =  
 {  
 UIApplicationExitsOnSuspend = false,  
 UIAppFonts = {"Harrowprint.ttf"}  
 },  
}  

[import]uid: 44896 topic_id: 17617 reply_id: 67094[/import]

(I’m doing this for iOS, by the way.) [import]uid: 44896 topic_id: 17617 reply_id: 67096[/import]

I found your problem.

The ‘plist’ table should be within the ‘iphone’ table, so yours should look like this:

[blockcode]
settings =
{
orientation =
{
default =“landscapeRight”,
content = “landscapeRight”,
supported =
{
“landscapeRight”
},
},

iphone =
{
plist =
{
UIApplicationExitsOnSuspend = false,
UIAppFonts = {“Harrowprint.ttf”}
}
}
}
[/blockcode] [import]uid: 52430 topic_id: 17617 reply_id: 67098[/import]

That fixed it! Thanks so much! :smiley: [import]uid: 44896 topic_id: 17617 reply_id: 67101[/import]