More custom font problems

I’ve read several threads on this and I think I’m doing it right…

My build.config file:

settings =  
{  
 iphone =  
 {  
 plist=  
 {  
 UIStatusBarHidden = true,  
 UIAppFonts =  
 {  
 "tt\_bobo.ttf",  
 "laffayette\_comic\_pro.ttf",  
 },  
 },  
 },  
}  

In my lua code:

 hoboFont = native.newFont( "Hobo", 32 )  
 comicFont = native.newFont("Laffayette Comic Pro", 24)  
  
...  
  
 playButtonText = display.newText( "Tap to Start", 0, 0, comicFont, 24)  
 playButtonText:setTextColor( 255, 0, 0, 255 )  
 playButtonText.font = comicFont;  
 playButtonText.x = display.contentWidth / 2  
 playButtonText.y = display.contentHeight - 60  
 playButton:insert(playButtonText)  
 playButton.isVisible = true  

I get a lovely system font. Happens in both the Corona Simulator, the XCode Simulator and my iPhone. Its gotta be something simple, but I’m clueless…

Thanks
Rob
[import]uid: 19626 topic_id: 7707 reply_id: 307707[/import]

Rob,

Did you ever get this issue resolved? I am stuck in the same boat right now…my custom fonts are NOT showing up.

Thanks! [import]uid: 20687 topic_id: 7707 reply_id: 30036[/import]

No, I’m still getting the system font. [import]uid: 19626 topic_id: 7707 reply_id: 30038[/import]

Bummer! Trying to figure it out myself too using bits of your code. If I find a solution i’ll post it! Hang in there. [import]uid: 20687 topic_id: 7707 reply_id: 30040[/import]

Hey I was able to fix the same problem on windows by following the advice at the end of this thread using fontforge.

http://developer.anscamobile.com/forum/2011/02/28/custom-fonts-android

Hopefully it can help you guys also! [import]uid: 37867 topic_id: 7707 reply_id: 30745[/import]

Hey guys, I was able to get the example working. Look at this peace of code:
[lua] local harrowprint = native.newFont(“Harrowprint”, 50)
local text = display.newText( “Hello Harrowprint font!”, 0, 0, “Harrowprint”, 50 )
text:setTextColor(56, 147, 155)
local text2 = display.newText( “Hello2 Harrowprint font!”, 0, 100, harrowprint, 50 )
text2:setTextColor(56, 147, 155)[/lua]
text displays with custom harrowprint font, while text1 displays as system font for me. However, I was able to run it only on simulator yet, not on device (ipad). On device all texts are invisible. I am still searching for a solution of this. [import]uid: 52745 topic_id: 7707 reply_id: 34552[/import]

Well I solved part of the problem. The use of native.newFont is the problem.

That API call is for fonts for the native UI elements like text boxes, not for Corona display objects.

When I dropped those native.newFont() calls and just made sure my build.settings were correct and used a string:

playButtonText = display.newText( "Tap to Start", 0, 0, "Laffayette Comic Pro", 24)  

I saw my custom fonts in the simulator. display.newText takes a string of the font name, not an object returned from native.newFont().

I was so excited. Built it for my iPhone, loaded it and I got nothing.

[import]uid: 19626 topic_id: 7707 reply_id: 34564[/import]

Did you add the font in your BASE folder? [import]uid: 51516 topic_id: 7707 reply_id: 34565[/import]

I have everything in one folder, the same folder as my main.lua file. [import]uid: 19626 topic_id: 7707 reply_id: 34566[/import]

I was having a similar problem. Turns out it was a bad filename for my configuration.

You say in your original post “build.config” - but in order for fonts to show up you must save that data in “build.settings” !

That could very well be your problem. I had a similar mistake for more than two months. [import]uid: 65996 topic_id: 7707 reply_id: 58601[/import]