Can't use font in corona simulator

yes, this screenshot from Unity to show you that this font works on my PC

i’ve tried this font on another machine with Windows 8 and it works in Corona Simulator. So it doesn’t work in Corona Simulator for Windows 7.

I don’t have another Windows 7 now to make final tests and I understand that it is not very important for you - some font doesn’t work in some Windows for some user…there are too much fonts to check each

And just to confirm, you’re running the most recent version of Corona on both the Win7 and Win8 machines?

Win7 - daily build 2015.2697

Win8 - latest public release

Hi @mitsik,

Can you please install the latest public release on the Win7 machine as well? I’d like to determine if this is an issue between versions…

Thanks,

Brent

I installed daily build few days ago as soon as native text fields available in win simulator (many thanks for this).

So it likes I have win7 with latest public and with daily build

So you have both the latest public release and a daily build installed on the Win7 machine? That’s fine if you do. Does the font display in the public release version?

how can i switch versions on windows? i think it updates one version to another.

Font didn’t work in the public release version. It didn’t work in version before current public release too. 

Do you have Win7? if so try to install my font, please

Can you post the code you’re using (in Corona) to display the font?

Brent

local myText = display.newText( “Hello, World!”, display.contentCenterX, display.contentWidth / 4, “GothicBold”, 40 )

myText:setFillColor( 1, 110/255, 110/255 )

this code from Corona HelloWorld project.

just for information, maybe it will help

if i call this code:

local myText = display.newText( “Hello, World!”, display.contentCenterX, display.contentWidth / 4, " GothicBold123", 40 )

i have a warning: Could not load font GothicBold123. Using default font. 

Because I don’t have font with name  GothicBold123  in my system. I see text on simulator, it uses some default font.

But when I use " GothicBold" (again, font is installed and I need to display text with this font) i don’t have this warning (as I understand Simulator sees this font in system, so it loads the font?), however I don’t see text on simulator.

Can you post a screenshot of the project directory so I can see all of the files within it?

Brent

Try to write:

local myText = display.newText( “Hello, World!”, display.contentCenterX, display.contentHeight, “GothicBold”, 40 )

Or:

local myText = display.newText( “Hello, World!”, display.contentCenterX, display.contentHeight - 200, “GothicBold”, 40 )

Because: I dont know why but in one of the fonts I use I found out it is there, but mach higher on the screen. (Just in the simulator).

But still, on all of the other fonts it writes: “Warnning: Could not loud font Wekar. Using defult font.”

Quick chime in here:

  1. If you choose a large font size, some fonts will not work.  (Probably requiring too much memory to render).

  2. Some fonts are just broken, especially free ones.

  3. Some fonts will not print when you use a string like this: “BOB”, but if you do this, they will print " BOB " (notice space at front and at end).

  4. When you encounter a font problem, the best way to get help is to make a tiny project with these files and share it with the folks here so we can see it live and help debug it:

  • main.lua - Just one line showing you using the font and demonstrating it NOT working.
  • config.lua - We want to see this because it helps us understand how scaling may be affecting things.
  • build.settings - Super important if you want to use your font on iOS.  We need to check that bit too.
  • font.ttf (the font or fonts that are giving you trouble)

With the info from #4, we’ll have everything we need to help you and not worry about ambiguity in the forums post.

Hi guys, thanks for your help!

my test project link: https://www.dropbox.com/s/0qlkorlmwps94ng/HelloWorld.zip?dl=0

So i repeat:

  1. the font from project works well in iOS, Android, Mac OS, Win8

  2. So, Win7:

  2.a font works well in programs such as Photoshop, MS Office Word, Unity 3D etc

  2.b font doesn’t work in Corona Simulator. (there is no warning about “Could not found font…”)

I don’t have another Win7 PC to test, so if somebody have, please do tests.

Thank you all!

@mitsik,

  1. I ran your project on Windows 7 (in simulator) and it doesn’t show the text.

  2. I modified the project and simplified it a little more.  I also added code to print out any matches for ‘gothic’ (case-insensitive compare) in the loaded fonts.

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/08/fonts/HelloWorld.zip

  1. I edited the font and fixed some issues with (ttfedit), but it still didn’t work.

  2. Interestingly, the font uses an odd name in when installed on the system:

actualname.jpg

I’m at a loss for how to fix this.  It just seems broken under Windows 7.

@roaminggamer

thanks for your tests.

I found one issue. I think you can reproduce it.

In Control Panel -> Fonts I have Arial font. If you open it there will be a lot of arial fonts such as Arial Bold, Arial Black, Italic etc

next, in main.lua change searchString to “arial”, it doesn’t show all these fonts - Bold, Black Italic. Just only Arial.

When I try to use “Arial Bold” i see warning in console “Could not load font Arial Bold. Using default font.”

So, I think simulator doesn’t look “inside” font Arail to find Arial Bold, Arial Italic etc.

However, if you double click Arial Bold it shows font properties where font name is “Aria”, not  “Arial Bold” (I have russian UI, but I made some translation)

u11DSOs.png

I’m confused

This is not my “GothicBold” font issue, but how can i use simple Arial fonts. I have the same problems with other fonts like Raleway, Roboto. Simulator doesn’t see Bold, Italic etc. They are free, but available to download from google fonts. I don’t think these fonts corrupted or bad. Maybe it is Win7 font system specific issue?

Thanks

The font works on photoshop.

This is the file.

I tried your font with roaminggamer’s HelloWorld example. it doesn’t work. Could not found Dekar font, but it shows Dekar in fonts list native.getFontNames()

very strange. do you have win7 now?

Yes

Responding re: Font Families (Arial Bold, Arial Black, etc.)  I’ve frequently had problems using fonts that are part of a family.  I think it has something to do with looking up a variant of a font within the family.  

However, I’ve never looked at the source for this so I can’t give any insights into why Font Families are sometimes problematic.

I’m afraid I just avoid them in advance.  I know this doesn’t help much.

Tip: I always test my fonts on my target devices before using them in app dev.  That way I don’t get surprised later.

Best of luck on this.

But on device it works perfectly fine.