Custom fonts on Android 8 (Oreo)

It looks like custom fonts aren’t working in Android Oreo. We only have one Oreo device to test on at the moment (a Google Pixel XL) and only one game written in Corona so far, so I can’t be sure that this is an always-reproducible issue, but on all other devices the custom font (a TTF file) loads just fine and has done since our initial release in July.

Is this a known issue, or can other developers confirm that either custom fonts are or aren’t working on Oreo for them? For us, they’re just being replaced with something standard looking (Roboto I’d guess).

Example code that isn’t working on Orea:

local scoredPreText = display.newText(‘You Scored’, screenX + ((screenWidth / 6) * 5), display.contentCenterY - 80, ‘fonts/african.ttf’, 22 )

scoredPreText:setFillColor(255, 255, 255)

uinterfaceGroup:insert(scoredPreText)

Much appreciated.

I’m checking to see if we have anyone with Oreo devices to test this with.

Rob

Hey,

This font is not working for me too on Pixel C (8.0.0) but seems it’s font compatibility problem. I built native Android app fully written on Java and used that african.ttf font and still it was not applied. I tested with some other random custom fonts and they did well.

That’s strange. The font works on earlier Android versions so presumably whatever the issue is, it’s caused by Android removing something from more recent releases. Were the other fonts you tested also TTF’s?

Sure, a bunch of TTF’s.

You can test yourself, I believe you will find many fonts working perfectly on Android Oreo.

OK, it looks then like this is an Android issue rather than something Corona is doing. I’ll see if I can find out what it is with the font that’s causing this to happen and if I can, will report back here.

Thanks.

Been a while since I’ve had chance to look at this again, sorry. Seems I’ve found an easy solution that works though! Uploading the ttf for conversion through https://everythingfonts.com/font-face and then using the returned ttf file as a replacement has done the trick for me.

No idea what Everything Fonts does to the file to fix this, but hopefully this works for others?

Regards.

I’m checking to see if we have anyone with Oreo devices to test this with.

Rob

Hey,

This font is not working for me too on Pixel C (8.0.0) but seems it’s font compatibility problem. I built native Android app fully written on Java and used that african.ttf font and still it was not applied. I tested with some other random custom fonts and they did well.

That’s strange. The font works on earlier Android versions so presumably whatever the issue is, it’s caused by Android removing something from more recent releases. Were the other fonts you tested also TTF’s?

Sure, a bunch of TTF’s.

You can test yourself, I believe you will find many fonts working perfectly on Android Oreo.

OK, it looks then like this is an Android issue rather than something Corona is doing. I’ll see if I can find out what it is with the font that’s causing this to happen and if I can, will report back here.

Thanks.

Been a while since I’ve had chance to look at this again, sorry. Seems I’ve found an easy solution that works though! Uploading the ttf for conversion through https://everythingfonts.com/font-face and then using the returned ttf file as a replacement has done the trick for me.

No idea what Everything Fonts does to the file to fix this, but hopefully this works for others?

Regards.