Can load custom font, but not bold version

I have a font on my Windows 7 machine called “CreativeBlock BB”. When I check it in the Windows fonts directory it shows as one font, but when I copy it I get two files, CREABBRG.TTF (regular) and CREABBB.TTF (the bold version).

I need the bold version in my app, but when testing this in the simulator I can only load the regular, non-bold version using display.newText(’’, x, y, ‘CreativeBlock BB’, fontSize). How do I reference the bold version? I tried the obvious, like adding Bold, -Bold etc., but always get

“Warning: could not load font CreativeBlock BBBold. Using default font.”

Thanks for any help! For what it’s worth, finally it’s supposed to be an iPhone app, not an Android app, I’m just using Windows for development. [import]uid: 10284 topic_id: 11338 reply_id: 311338[/import]

You just reference the both (bold and non bold) in your build.settings and initialize the proper one when you want to display bold / non bold characters:

build.settings


UIAppFonts =
{
“CREABBRG.TTF”,
“CREABBB.TTF”
},

Then check the font names in a Windows software that displays that, equivalent to the Font Book on the Mac. The two fonts have for sure different names. Then initialize your text with the right font name:

display.newText(’’, x, y, ‘CreativeBlock BB Bold’, fontSize)

or

display.newText(’’, x, y, ‘CreativeBlock BB Regular’, fontSize)

Alex. [import]uid: 4572 topic_id: 11338 reply_id: 41158[/import]

Alex, thanks for the help. I still can’t get it to work. And for starters, shouldn’t the Bold version of this font be listed when I use

local fonts = native.getFontNames()  
for i, font in ipairs(fonts) do  
 print(font)  
end  

Because this listing returns a lot of fonts, including “CreativeBlock BB”, but nothing that would say “bold”. I tried to find the font name for the CreativeBlock file but don’t know if it has a special name or how to see it. (Trying to e.g. opening the TTF binary doesn’t yield anything except “CreativeBlock BB”.)

(Small sidenote: As a workaround I tried deleting the Regular version of the font and just installing the bold version; with this hack, Corona when loading “CreativeBlock BB” won’t show an error message, but it will also not display any font/ text in the app.)

Any further help appreciated! [import]uid: 10284 topic_id: 11338 reply_id: 41170[/import]

Just downloaded it on my drive. The two fonts are called identically. That’s why you won’t get the bold one in the font list.

Just tried also on my Mac to create a paragraph using only the bold font. It works.

Could you send a pastebin of your build.settings and then the code you use to create the paragraph?

Did you set a different font color than the background? (silly question, but a black on black text won’t be visible :)).

Alex [import]uid: 4572 topic_id: 11338 reply_id: 41172[/import]

Thanks again for following up.

Well, I tried it in the Mac simulator now, and all works fine!
So for better or worse, this seems to be a Windows simulator problem.
On the Mac, I was able to use the obvious font name, ‘CreativeBlock BB Bold’, and things show up as expected… [import]uid: 10284 topic_id: 11338 reply_id: 41186[/import]

Unfortunately i only have Macs, so i cannot follow that on Windows…

A. [import]uid: 4572 topic_id: 11338 reply_id: 41187[/import]