Invisible custom text?

Hello everyone,

I seem to have an odd issue with a custom font I’m trying to implement.  I’ve implemented custom fonts in the past, so I’m not completely new to this… I’m using a Windows, I’ve installed the font onto my computer as well as have it in the same folder as my main.lua / build.settings directory.  After installing the font, I even closed/restarted the simulator a couple of times as suggested in other threads. When I create a new text object, there are no warnings tell me this font does not exist upon its creation.

What’s happening is is that once that text object is created, on simulator there’s… nothing there.  Emptiness.  I’m drawing the text on the middle of the screen for testing, so it’s not like it’s being offset offscreen somehow (I really doubt it’s being offset more than 200 units in a direction, especially because of the next sentence).  However, building this to my Android device I can see the font properly in the proper position, and it’s the custom font and size I intended it to be.  Ultimately, yes, it seems to be building properly to device, but I don’t want to have to build every time to test text positioning… has anyone encountered this or know of a solution?

have you tried using systemFont just to make sure its on screen or not behind another object

also you didnt say but i assume you included it the build file

I’m placing it over an empty area for testing, but if I use native.systemFont, yeah I can see text.  And yeah, it’s included in the build file as well.  The file format is .ttf as well, and I tried re-converting it to .ttf to see if it helped but it didn’t.

try reinstalling on computer. make sure your using correct name. sometimes the font name is different the the file name.

http://docs.coronalabs.com/api/library/native/getFontNames.html

Also use native.getFontNames() if you’re using custom fonts. On Android the font name must be spelled exactly
right, but often the font name is different from the font file name;
for a given font file, the font name can be different on Android than on
iOS.

I’ve done that… where I used/printed out getFontNames before and after I installed it to Windows.  Before the font did not exist in the list, afterward it was in the list, and that name in the list what I use when I create the text object on simulator.  Like I said, I’m not getting the warning that it can’t find this font (and this is a pretty unique font name), so it is installed correctly and the system is finding it… it’s just not being displayed (on simulator) for some reason.

I wasn’t sure to what you referred when you mentioned reinstalling, but I tried installing/overwriting the font again on my computer and I’ve updated Corona SDK to the current public build (before I was at build 2076, a July 2013 build).  Still not seeing it.

maybe try a different installed font. if it loads then may be an issue with the font

Yeah… I just tried re-downloading the same font actually, and I guess the original file somehow got corrupted or otherwise couldn’t work for whatever reason, because now I’m able to get it displaying on simulator perfectly fine.  Thanks for the help!

have you tried using systemFont just to make sure its on screen or not behind another object

also you didnt say but i assume you included it the build file

I’m placing it over an empty area for testing, but if I use native.systemFont, yeah I can see text.  And yeah, it’s included in the build file as well.  The file format is .ttf as well, and I tried re-converting it to .ttf to see if it helped but it didn’t.

try reinstalling on computer. make sure your using correct name. sometimes the font name is different the the file name.

http://docs.coronalabs.com/api/library/native/getFontNames.html

Also use native.getFontNames() if you’re using custom fonts. On Android the font name must be spelled exactly
right, but often the font name is different from the font file name;
for a given font file, the font name can be different on Android than on
iOS.

I’ve done that… where I used/printed out getFontNames before and after I installed it to Windows.  Before the font did not exist in the list, afterward it was in the list, and that name in the list what I use when I create the text object on simulator.  Like I said, I’m not getting the warning that it can’t find this font (and this is a pretty unique font name), so it is installed correctly and the system is finding it… it’s just not being displayed (on simulator) for some reason.

I wasn’t sure to what you referred when you mentioned reinstalling, but I tried installing/overwriting the font again on my computer and I’ve updated Corona SDK to the current public build (before I was at build 2076, a July 2013 build).  Still not seeing it.

maybe try a different installed font. if it loads then may be an issue with the font

Yeah… I just tried re-downloading the same font actually, and I guess the original file somehow got corrupted or otherwise couldn’t work for whatever reason, because now I’m able to get it displaying on simulator perfectly fine.  Thanks for the help!