Is it possible that Corona’s trial version doesn’t support custom fonts?
I’ve made a test project using the documentation referred font, Harrowprint.ttf, and it doesn’t work.
From here: http://developer.anscamobile.com/content/display-objects#Using_a_custom_font
If I don’t add any font in my build.settings file I get 374 fonts and if I do add I get the same 374 fonts.
I’ve used the referred sample code from here: http://developer.anscamobile.com/reference/index/nativegetfontnames
My build.settings file
settings = {
orientation = {
default = "portrait",
supported = { "portrait", }
},
iphone = {
plist = {
UIAppFonts =
{
"Harrowprint.ttf"
}
}
},
}
My main.lua file
local \_w = display.contentWidth
local \_h = display.contentHeight
local \_crf = display.CenterReferencePoint
local testText = display.newText("Custom fonts", 0, 0, "Harrowprint", 48)
testText:setReferencePoint(\_crf)
testText.x = \_w \* 0.5
testText.y = \_h \* 0.5
local g = display.newGroup()
local fonts = native.getFontNames()
local count, found\_count = 0, 0
for i,fontname in ipairs(fonts) do
count = count+1
end
print ("Font count: " .. count)
local count\_text = display.newText("Found " .. count .. " fonts.", 0, (found\_count) \* 40, fontname, 18)
g:insert(count\_text)
count\_text:setTextColor(255, 255, 255)
Thanks
[import]uid: 131900 topic_id: 17737 reply_id: 96975[/import]
[import]uid: 52491 topic_id: 17737 reply_id: 105328[/import]