Maybe this can be of some help
First be shure to install the font on your mac/PC
When working with custom fonts there are two references you need to deal with.
In this example I refers to the font MarsAttacks truetype font (ttf)
MarsAttacks.ttf --<< The actual font file on your computer (used in build.settings file)
MarsAttacks-Regular --<< The font name you use when you declaring the font handle (i.e. your main file)
your main file:
I usually make a global var of the fonts I use, like this:
_G.messageFont = “MarsAttacks-Regular”
To be shure how to address the font name in the right way I put this for-loop snippet in the main file as well:
local sysFonts = native.getFontNames()
for k,v in pairs(sysFonts) do print(v) end
When you run this code in the simulator with the terminal open you can scroll through the list of fonts and copy the font name and put it in the variable _G.messageFont (shown over)
when this is done you can comment out the code again like this:
–[[
local sysFonts = native.getFontNames()
for k,v in pairs(sysFonts) do print(v) end
–]]
Now you go to the build.settings file and make the reference to the actual fontFILE ( Here is my build.settings code as an example ) :
settings = {
orientation = {
default =“landscape”,
content = “landscape”,
supported = {
“landscape”
},
},
iphone = {
plist = {
UIAppFonts = {
“MarsAttacks.ttf”
},
CFBundleIconFiles = {
‘Icon.png’,
‘Icon@2x.png’,
‘Icon-Small-40.png’,
‘Icon-Small-40@2x.png’,
‘Icon-60.png’,
‘Icon-60@2x.png’,
‘Icon-72.png’,
‘Icon-72@2x.png’,
‘Icon-76.png’,
‘Icon-76@2x.png’,
‘Icon-Small-50.png’,
‘Icon-Small-50@2x.png’,
‘Icon-Small.png’,
‘Icon-Small@2x.png’
}
},
},
}