Custom fonts working on iOS but not on Android

Hi folks, in my game I’m using custom fonts, and I have added them following the guide that can be found @ https://docs.coronalabs.com/guide/system/customFont/index.html.

Anyway, I managed to make them work only in the iOS version of the game, but not on the Android one.

The code I’m using is:

local coinCounterText = display.newText("0", x.x+55, coinCounterCoin.y-3, "Pusab", 18 ) coinCounterText:setFillColor( 255, 255, 255 ) coinCounterText.alpha = 1

instead of “Pusab”, it loads the system native font.

The font file name (in the folder of the project, alongside main.lua) is “Pusab.ttf”

Is there something I’m missing? I have tried to compile my app on Windows and OS X, and the simulator loads the font correcty in both operating systems.

Thank you.

Hi @estiennelorenzo,

Which version (build) of Corona are you using? I believe at some point between the last public build (2511) and the current public build (2646), a change was made which allowed Android to accept either the extended OR non-extended font name (when displaying it). If you’re using an older build, that change may not be implemented…

Best regards,

Brent

Hi Brent, sorry for the delay. Actually I’m using Version 2014.2511 (2014.11.18)

Best regards, 

Lorenzo

Hi Lorenzo,

Please upgrade to the latest public release (2646) and report back if anything changes.

Thanks,

Brent

Hi Brent, sorry again for not being into this topic for so long. Anyway, it doesn’t work even with the latest public release.

Hi @estiennelorenzo,

Can you test another font and report back if it works on both Android and iOS? Sometimes it’s an unfortunate case where a particular font file is corrupted somehow.

Brent

Hi Brent, your were right: the font I was using was presumably corrupted. Trying with another font (FOO) it works as it should.

Thanks for your support,

Best regards.

Hi @estiennelorenzo,

Which version (build) of Corona are you using? I believe at some point between the last public build (2511) and the current public build (2646), a change was made which allowed Android to accept either the extended OR non-extended font name (when displaying it). If you’re using an older build, that change may not be implemented…

Best regards,

Brent

Hi Brent, sorry for the delay. Actually I’m using Version 2014.2511 (2014.11.18)

Best regards, 

Lorenzo

Hi Lorenzo,

Please upgrade to the latest public release (2646) and report back if anything changes.

Thanks,

Brent

Hi Brent, sorry again for not being into this topic for so long. Anyway, it doesn’t work even with the latest public release.

Hi @estiennelorenzo,

Can you test another font and report back if it works on both Android and iOS? Sometimes it’s an unfortunate case where a particular font file is corrupted somehow.

Brent

Hi Brent, your were right: the font I was using was presumably corrupted. Trying with another font (FOO) it works as it should.

Thanks for your support,

Best regards.