Can't use font in corona simulator

@Rob

And what is the File name of the font file: Wekar.ttf (also tried with otf).

Is it in the same folder with your main.lua: Yes 

are you getting any errors in your console log: Yes, it write - “Warnning: Could not loud font Wekar. Using defult font.”

Hi @idanahal3,

Please make this into the most simple test possible without all of the variables, like this:

[lua]

highScore_txt = display.newText( “TEST”, 100, 200, “Wekar”, 15 )

[/lua]

Thanks,

Brent

Still doesn’t work.

Still doesn’t work.

Please provide the answers to the questions we asked above.  Please help us help you. 

At the end of the day, you have to use the filename (match case exactly) or you have to use the Font Family Name. Double Click on the font and look for the “Font Name” at the top of the screen.

This is certainly not a Corona SDK bug. Too many people use this feature. The documentation has been updated and triple checked for accuracy.

Rob

OK I’ll trie different computer

OK I’ll trie different computer.
Tnx

It’s likely not your computer either.  Please answer the questions so we can help you?  Just a reminder of the information we need:

  1. What is the file name of the font you are trying to use?

  2. What is the Font Name? (Double click on the font from Windows and get the Font Name )

  3. Is the font in the same folder as your main.lua?

  4. What messages are in your console log? (the black window with white text that opens with the simulator)

We need this information if you want us to help you.

Rob

I answered. Never mind I’ll do it again:

1. Wekar.ttf (also tried with otf).

  1. Wekar

  2. Yes 

  3. Yes, it writes - “Warnning: Could not loud font Wekar. Using defult font.”

I didn’t see the answers above.

Anyway, why don’t you try:

highScore\_txt = display.newText( "TEST", 100, 200, "Dekar", 15 )

or

highScore\_txt = display.newText( "TEST", 100, 200, "Wekar.ttf", 15 )

Rob

My bad. look again I have edited my reply

What did you edit?  Have you tried the two suggestions above?

Rob

The name is “Wekar” and not “Dekar”.

And yes i tried. didnt work…

Can you zip up the font and send it to us. Perhaps put it on Dropbox and post a download link?

Hi, Rob

I have the same problem with this font for example 
https://www.dropbox.com/s/5dd8co3p9n11b8p/GothicBold.zip?dl=0
It works good on Android, iOS, Mac OS, but not for Windows (i use Win 7). However, I can use it in other programs such as Photoshop, office etc. Only Corona simulator can’t dusplay text with this font.

btw, I print textObject.contentHeight and it is equal to 1. Also, I don’t have a warning about using Default system font in console log.

Thanks 

Hi @idanahal3 and @mitsik,

If a font works on all platforms (including Android) but not Windows, this may indicate that there is something wrong with the font file and Windows is failing to load it. A good way to test this theory is to double click on the font file in Windows to see if it’s able to display its glyphs in the font viewer window. If Windows can’t load/display the font, then you have no choice but to use a different font file.

To further test that you are coding this correctly in Lua, try copying one of the installed Windows fonts to your Corona project’s root directory (alongside “main.lua”). For example, a font file such as “WingDings”. The pre-installed Windows fonts are obviously guaranteed to load correctly in Windows, so if you attempt to use that font in a Corona project and it doesn’t work, then there’s something wrong with your Lua/Corona code.

Best regards,

Brent

I said that only Corona Simulator doesn’t display text with my font, other applications (Photoshop, Office Word) can display this font. It looks good in Windows Font Viewer (Control Panel -> Fonts -> double click on font).

Of course I can’t say about all fonts (only used by me), but I’ve never seen Bold fonts in Windows Simulator. I tried to load Roboto Bold and GothicBold (dropbox link in my previous post) and some other bold fonts in Corona Simulator and nothing.

I develop with Corona few years, so of course i restarted simulator after font installed, i restarted PC etc

Some my researches:

I have installed font family Raleway (https://www.google.com/fonts/specimen/Raleway]) . I have installed two fonts of this family: “Raleway” and “Raleway Bold”. I can use them in Photoshop and other text editors. But when I call this code

https://docs.coronalabs.com/api/library/native/getFontNames.html#example

with searchString = “Rale” it shows in console only:

Font Name = Raleway

there is no Raleway Bold

It would be great if it is my fault, and it is easy to fix.

Thanks

Hi @mitsik,

Windows doesn’t use that “family name” or “internal font name” that you’re gathering from the “native.getFontNames()” example… that’s for iOS and OS X. When you install that “Raleway” font in two varieties (normal and bold), what are the names of the actual font files?

no metter, Raleway was as an example.

I just wanted to say that this font works everywhere

d5bf95f510f1d5c9b377d60951a6326c.png

it doesn’t work in (my?) Corona Simulator for (my?) Windows.

What is that a screen shot from?  It doesn’t look like the Corona simulator to me.

Rob