Custom Fonts

Hi, I’m trying to add a custom font to my app, and I keep getting a warning that says ‘Could not load font: “Segment14”. Using default font’.

In my main.lua I have the following code:

[code]local fonts = native.getFontNames()
fontname = “”

for i, v in ipairs (fonts) do
if string.find(v, “egment”, 1, true) then
fontname = v
end
end
print ("font = " … fontname)[/code]

This outputs: ‘font = Segment14’

However when I use the following code:

txtbox = display.newText( "default", 0, 0, fontname, 20 )

I get the warning described above.
Any help would be much appreciated. [import]uid: 35591 topic_id: 11507 reply_id: 311507[/import]

@slicedpan, I do not know why the Segment14 font is not working for you, but instead of just dumping it to the console, I modified it a bit to view all the fonts available on the computer or the device

[lua]local fonts = native.getFontNames()

local scr = require(“scrollview”)
–local scroll = display.newGroup()
local scroll = scr.new()

local i,v, counter, text

for i,v in pairs(fonts) do

text = display.newText(scroll, v,10,i*30,v,40)
text:scale(0.5,0.5)
text:setReferencePoint(display.TopLeftReferencePoint)
text.x=10
text.y = i*30

–if i > 100 then break end
end[/lua] [import]uid: 3826 topic_id: 11507 reply_id: 41864[/import]