TTF Bold Font not working on Simulator (Windows)

A font is not showing up in the Simulator.

All the fonts are standard TTF from Google Fonts - so definitely good.

I have 3; 

OpenSans-CondBold.ttf

OpenSans-CondLight.ttf

OpenSans-CondLightItalic.ttf

    local displayText1 = display.newText( "Bold", 150, 80, "OpenSans-CondBold.ttf", 94 )     local displayText2 = display.newText( "Light", 150, 180, "OpenSans-CondLight.ttf", 94 )     local displayText3 = display.newText( "Italic", 150, 280, "OpenSans-CondLightItalic.ttf", 94)     

Light & Light Italic show up in the simulator. Bold does not. - Screen Shot attached.

But - all 3 show up on my Android device - Screen Shot attached.

I ran some code to dump out fonts;

    local systemFonts = native.getFontNames()     -- Set the string to query for (part of the font name to locate)     local searchString = "Open"     -- Display each font in the Terminal/console     for i, fontName in ipairs( systemFonts ) do         local j, k = string.find( string.lower(fontName), string.lower(searchString) )         if ( j ~= nil ) then             print( "Font Name = " .. tostring( fontName ) )         end     end

The output lists; 

Font Name = Open Sans Condensed Light Font Name = Open Sans Condensed 

Not sure what that really means - are those the Family Names? because using FontForge I see the Regular and Italic have the *same* family name (Open Sans Condensed Light), the Bold has different Family Name (Open Source Condensed).

All 3 have different Name For Humans and Fontname.

But however you look at it, I think the Bold should appear in the simulator - no?

It’s quite confusing.

Just to see what would happen, I cloned all 3 in FontForge, giving them totally different names to each other. I then installed all 3 on Windows…

The Corona font listing code shows all 3.

On the Android device, all 3 are displayed.

Yet on the Windows Simulator only 2 show up - but this time it is different 2, the bold and the regular show up, but not the Italic…

They are installed, because all 3 show up in MS Word, but even though I changed the names they are still related somehow because Word knows the bold and the italic belong to the regular.

I have the same issue in my Simulator. 

I have bold and a regular versions of a font, they both work on the device but the simulator only shows 1

(at first it showed the regular, now it suddenly only shows the bold…)

Honestly i only read the first 10 words of the post so i might be wrong here but try this.

Instead of adding the font like so -

OpenSans-CondBold.ttf

 Change the name and add it like this -

OpenSansCondBold.ttf

Corona sometimes bugs out or/and gives me errors when I use  things like “-” in file names.

Doesn’t happen all the time but happens.

Or for all we know it could be a bug.

–SonicX278 

Any warnings or errors in your console log? Make sure to upgrade to the latest public build to make sure you have the new console windows to work with.

Rob

Just to see what would happen, I cloned all 3 in FontForge, giving them totally different names to each other. I then installed all 3 on Windows…

The Corona font listing code shows all 3.

On the Android device, all 3 are displayed.

Yet on the Windows Simulator only 2 show up - but this time it is different 2, the bold and the regular show up, but not the Italic…

They are installed, because all 3 show up in MS Word, but even though I changed the names they are still related somehow because Word knows the bold and the italic belong to the regular.

I have sort-of the same issue, with strange behavior.

I am using Google’s OpenSans-Regular, OpenSans-Bold, OpenSans-Light and OpenSans-Italic.ttf. 

When I create a textfield with the bold font, the text does not show up in the (Windows) simulator. 

If I use the regular font, it works fine.

If I have 3 text fields, and the first one uses the bold font, the second one uses the regular and the third one uses the light font, only the second one is displayed. If I change the first textfield to use “regular” as well, all 3 fields are displayed. 

If I use “regular” as the first font, and “bold” as the second one, all fields are shown correctly. 

I followed InfiSnyp’s suggestion and removed the “-” from the font file names, but without success.

I am using the latest daily build currently available (2016.2879), and see no error messages in the console output.

I never got to the bottom of it. basically I just used the two fonts I liked most. lol.

Yeah, I’ll have to talk to the designer about that :slight_smile:

I googled around and read about the issue with using different fonts from the same family. Apparently that is what causes these issues, so they say. So I edited the ttf’s and gave them all different family names. Unfortunately without luck :frowning:

Sometimes free fonts can have bad information in them. A web browser or Photoshop may not be bothered by the problems but the OS’s rendering system might.

If you’ve addressed the font family issue, try a different font or see if you can find your font from another source.

Rob

Hi Rob, thanks.

I discovered that the semibold font works. There are issues with bold and italic, but I can go on without them.

When I use a font that has issues, there are no error messages in the console log. It’ll help if there would be some error message that indicates where the problem lies. But I’m okay for now.

Cheers, ~Rob

I have the same issue in my Simulator. 

I have bold and a regular versions of a font, they both work on the device but the simulator only shows 1

(at first it showed the regular, now it suddenly only shows the bold…)

Honestly i only read the first 10 words of the post so i might be wrong here but try this.

Instead of adding the font like so -

OpenSans-CondBold.ttf

 Change the name and add it like this -

OpenSansCondBold.ttf

Corona sometimes bugs out or/and gives me errors when I use  things like “-” in file names.

Doesn’t happen all the time but happens.

Or for all we know it could be a bug.

–SonicX278 

Any warnings or errors in your console log? Make sure to upgrade to the latest public build to make sure you have the new console windows to work with.

Rob

I have sort-of the same issue, with strange behavior.

I am using Google’s OpenSans-Regular, OpenSans-Bold, OpenSans-Light and OpenSans-Italic.ttf. 

When I create a textfield with the bold font, the text does not show up in the (Windows) simulator. 

If I use the regular font, it works fine.

If I have 3 text fields, and the first one uses the bold font, the second one uses the regular and the third one uses the light font, only the second one is displayed. If I change the first textfield to use “regular” as well, all 3 fields are displayed. 

If I use “regular” as the first font, and “bold” as the second one, all fields are shown correctly. 

I followed InfiSnyp’s suggestion and removed the “-” from the font file names, but without success.

I am using the latest daily build currently available (2016.2879), and see no error messages in the console output.

I never got to the bottom of it. basically I just used the two fonts I liked most. lol.

Yeah, I’ll have to talk to the designer about that :slight_smile:

I googled around and read about the issue with using different fonts from the same family. Apparently that is what causes these issues, so they say. So I edited the ttf’s and gave them all different family names. Unfortunately without luck :frowning:

Sometimes free fonts can have bad information in them. A web browser or Photoshop may not be bothered by the problems but the OS’s rendering system might.

If you’ve addressed the font family issue, try a different font or see if you can find your font from another source.

Rob

Hi Rob, thanks.

I discovered that the semibold font works. There are issues with bold and italic, but I can go on without them.

When I use a font that has issues, there are no error messages in the console log. It’ll help if there would be some error message that indicates where the problem lies. But I’m okay for now.

Cheers, ~Rob