[SOLVED] Having trouble using custom fonts

I’m having small problem in using custom fonts. My problem is putting it in the build.settings so the device can recognize it. I don’t know how to display it properly in build.settings here is how I have it

[code]settings = {
orientation =
{
default = “landscapeRight”,
},
iphone =
{
plist=
{
UIApplicationExitsOnSuspend = false,
CFBundleIdentifier = “com.decease.game”,
UIStatusBarHidden=true,
CFBundleIconFiles = {
“Icon.png”,
“Icon@2x.png”,
“Icon-72.png”,
UIAppFonts = {
“04B_03__.ttf”

}
}
},
},
} [/code]

This is my build.settings. Can anyone make it so that when I use it shows in my device. The above code is wrong , but I don’t know How to correct it. Anyone fix it.

Thanks :slight_smile: [import]uid: 17058 topic_id: 24191 reply_id: 324191[/import]

Couple things I can help you with:

  1. The font must be installed on the mac when compiling
  2. the name must be perfect. If you search here you will find a program that will list out the correct names of all the fonts on your system in the simulator. It helped me. Here is my bs file, just for any extra formatting it may provide.
settings =   
{  
 orientation =   
 {  
 default = "portrait",  
 supported =  
 {  
 "portrait"  
 },  
 },  
 iphone =  
 {  
 plist =  
 {  
 UIAppFonts =  
 {  
 "SHOWG.TTF"  
 },  
 UIApplicationExistsOnSuspend = false,  
 UIStatusBarHidden = true,  
 UIFileSharingEnabled = false,  
 },  
 components = {},  
 },  
}  

For me the two listed above were the ones that were kill’in me.
Good Luck! [import]uid: 21331 topic_id: 24191 reply_id: 97621[/import]

Your structure is different than mine. Here is an early version of one that I am using for a new app which is showing my custom font fine:

settings =  
{  
 orientation =  
 {  
 default = "portrait",  
 supported =  
 {  
 "portrait"  
 }  
 },  
  
 iphone =  
 {  
 plist = {  
 UIAppFonts = "Cantarell-Regular.ttf,Cantarell-Bold.ttf",  
 UIApplicationExitsOnSuspend = false,  
 UIStatusBarHidden = true  
 },  
 components = {}  
 }  
}  

The other possible thing is that you are referencing the name of the font incorrectly in your code. Here are the notes in the API doc:
Then, refer to the font when creating the text object. IMPORTANT: (1) You must use the name of the font as returned by native.getFontNames(), not the file name. (2) The font name must be spelled EXACTLY right or it won’t be used. (3) For a given font file, the font name on Android may be different from the one on iOS. [import]uid: 17827 topic_id: 24191 reply_id: 97622[/import]

@TheRealTonyK Thanks for the help it worked :slight_smile:

@thegdog I tried yours too some how it did not work hmmm? But thanks for helping :slight_smile: [import]uid: 17058 topic_id: 24191 reply_id: 97628[/import]