Custom Fonts and Corona

I’m trying to use a custom font in my app so it has a consistent look.  Since I wanted to use a free one, I choose Open Sans and downloaded it from Google - OpenSans-Regular.ttf and OpenSans-Bold.ttf

I’ve put the font files in my project directory - both the normal and bold versions of the ttf.  In my globals.lau, I’m defining the font…

globals.regularFont = "Open Sans Regular" globals.regularFontBold = "Open Sans Bold"

I’ve tried mulitple ways of referring to the font, but I keep getting the:

Warning: could not load font Open Sans Regular. Using default font.

I’ve tried listing out native fonts using a code fragment in the API documents but all I find is

Font Name = Open Sans

So it seems there’s an Open Sans… but no bold or normal specified.

Any ideas?

Have you read the Font’s guide:
 

http://docs.coronalabs.com/guide/system/customFont/index.html

Rob

I did, thank you.  It got me started, but that’s when I started having problems.  I’ve actually gone into the fonts and renamed them to match and now it works in the app… but not in the viewer… even though I have the font installed on my computer and the names all match.

Let me correct that… the REGULAR version of the font works… but not the BOLD version…

Hi John,

What system are you using (Mac or Windows), and what devices are you deploying to (iOS or Android)?

Brent

Do you also have the fonts in the Viewer app?  If it’s iOS does the Viewer’s build.settings have the write code in it to reference the fonts?

Rob

Have you read the Font’s guide:
 

http://docs.coronalabs.com/guide/system/customFont/index.html

Rob

I did, thank you.  It got me started, but that’s when I started having problems.  I’ve actually gone into the fonts and renamed them to match and now it works in the app… but not in the viewer… even though I have the font installed on my computer and the names all match.

Let me correct that… the REGULAR version of the font works… but not the BOLD version…

Hi John,

What system are you using (Mac or Windows), and what devices are you deploying to (iOS or Android)?

Brent

Do you also have the fonts in the Viewer app?  If it’s iOS does the Viewer’s build.settings have the write code in it to reference the fonts?

Rob