How to use other font in corona

Hi all ,
I want to know how to add other font in corona .

 local txt = display.newText("ABCDEF", 0, 35, native.systemFont, 15)

Any sample code for this if I want to use font “aaa.ttf”(for example) ?
Thanks , [import]uid: 89131 topic_id: 22591 reply_id: 322591[/import]

I find it easier to use the system font with a little twist

function newFont( params )
local isAndroid = “Android” == system.getInfo(“platformName”)

if isAndroid and params.android then
font = params.android – return font for Android
elseif params.ios then
font = params.ios – return font for iOS/MacOS
else
font = native.systemFont – default font (Helvetica on iOS, Android Sans on Android)
end

return font
end

It makes it easier for the user to accepct the app as part of the device but if you want custom fonts you have to include the font file in an include folder in the application folder. and add the following to your build.settings file

UIAppFonts = { “EXACT_FONT_NAME.ttf” }

then you reference it in your application as a *function itself either in the ui.lua file or in the main.lua file.
*(There is a new blog up about functions as of 2-28-12 by Jonathan Beebe (CoronaSDK - DemiGod))

i.e.:

–Code for main.lua or ui.lua file–

local fontName = “font_name”

–Indicate the size to ensure it fits the space it will display–

local fontSize = 26 [import]uid: 104728 topic_id: 22591 reply_id: 90063[/import]

Just watch this tutorial video: http://www.youtube.com/watch?v=Y6r2V4Nd2Vw

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 22591 reply_id: 90068[/import]

Thanks all , this video and sample code of robert.bingham is so easy to learn :smiley: . [import]uid: 89131 topic_id: 22591 reply_id: 90069[/import]

Sorry but I just had problem with corona simulator

Sometimes I can use other font in corona simulator , but sometimes is not .
This is Warning : Could not load font \*\*\*\* .Using default font.
May it still good on devide but can not check it on corona simulator ? [import]uid: 89131 topic_id: 22591 reply_id: 90381[/import]