Write with fonts

Hi corona community.

I am trying to write some numbers and letters with a popular font that is showed on this tutorial http://www.youtube.com/watch?v=Y6r2V4Nd2Vw.

My code dont have any bug or error, only the font dont work. Anyone see the problem? Thanks

Build.settings

settings =  
{  
 iphone = {  
  
 plist = {  
  
 UIAppFonts = {  
  
 "BorisBlackBloxx.ttf"  
  
 }  
 },  
 },  
}   

main.lua

  
local director = require("director")  
  
  
  
local MainGroup = display.newGroup();  
  
local sysFonts = native.getFontNames()  
for k,v in pairs(sysFonts) do print(v) end  
  
  
  
local function Main()  
  
 MainGroup:insert(director.directorView)  
 director:changeScene("exp")  
 return true  
  
end  
  
Main()  
  

exp.lua

[code]

module(…, package.seeall)

function new()

local LocalGroup = display.newGroup()

– Screen
local _W = display.contentWidth
local _H = display.contentHeight

local text = display.newText(“Game”,0,0,“BorisBlackBloxx”,24)
text.x = math.round( _W*0.5 )
text.y = math.round( _H*0.5 )
text.isVisible = true
text:toFront()
LocalGroup:insert( text )

return LocalGroup

end

[/code] [import]uid: 26056 topic_id: 25097 reply_id: 325097[/import]

um…

I don’t see anything wrong with the actual code but I didn’t look long.

two things i suggest in fixing the problem is,

first, is the text file “BorisBlackBloxx” in your main file directory? like is it in the same folder as the main.lua file

And Second, one thing to note is that the calling of the text font should be named what it is in the text file itself.

Example- in my game i have a text font called Hurry Up.
The file itself is called hurry up.ttf and when i open the file up at the top is should say Font name: Hurry Up, which is a different title then the file name.

So you should use the name of the font that is written in the file.

Hope that helps,
Boxie

[import]uid: 113909 topic_id: 25097 reply_id: 101961[/import]

Thanks for the answer boxie, i changed the name of the font, and now it both the same BorisBlackBloxx.ttf i am using the same name that is inside of the font and the file is on the same directory of the main.lua i know that it dont have any problem, but it still dont work :frowning: [import]uid: 26056 topic_id: 25097 reply_id: 101964[/import]

make sure the font was installed in the font book on Mac
or font folder on winblows

edit: and have a copy of font in folder with main [import]uid: 7911 topic_id: 25097 reply_id: 101966[/import]

Thank you for the help it really works, but now when i tried to build the app to run on the xcode simulator it closes the corona sdk, and dont build anything, i tested the app to find the error and it is because of this:

UIAppFonts = {

“AppleCasual.ttf”
}

this is the problem, but i dont know why, because all of other code about the font is working nice and the AppleCasual.ttf is on the main directory with the file main.lua.

P.S AppleCasual font is free?

Thanks [import]uid: 26056 topic_id: 25097 reply_id: 102315[/import]

have you tried a different font to see if it works?
i think apple allows us to use the fonts shipped with osx but im not 100% sure [import]uid: 7911 topic_id: 25097 reply_id: 102352[/import]