If you choose a large font size, some fonts will not work. (Probably requiring too much memory to render).
Some fonts are just broken, especially free ones.
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).
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.
I ran your project on Windows 7 (in simulator) and it doesn’t show the text.
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.
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)
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?
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()
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.
This thread is getting a bit long. If I can summarize:
There seems to be a font issue on Windows 7, but not on device and not on OS-X. While I realize that testing in the simulator is important, perhaps this is one case where it’s time to move on and either:
a) Upgrade to Win 10 continue to develop and test in the simulator
b) Test on device. Not the best solution, but it will work.
If the concern is releasing Win32 desktop apps, or if you’re stuck on Windows 7 for some reason, then file a bug report. The simple text example with your trouble fonts will do. If it works fine on Win 10, Win 8 and all devices, but not Win 7, perhaps the engineers can find a work around.
To file a bug report create a simple project that includes:
main.lua
config.lua
build.settings
your fonts
In the main.lua try to create a display object for each font that says “Hello World”.
Put all of that into a .zip file (no .bz2 files or other weird compression) and use the Report a bug link at the top of the page.
In the form that comes up, clearly state your problem. Mention it only happens on Windows 7 (if that’s really the case). Put a link to this forum thread in the post. After you submit the bug, you will get an email that will have a Case ID number in the subject of the email. Please post that number back to this forum thread as a reference.
The guide is now updated. If you follow these steps carefully and precisely and a custom font still doesn’t work, most likely there is a problem/issue with the actual font file (uncommon but not unheard of).