2

I'm applying a typeface like so:

findViewById<TextView>(R.id.text).apply {
    typeface = Typeface.createFromAsset(assets, "fonts/blackjack.otf")
}

It works in the emulator and on most Android devices, but it has no effect on Huawei devices with a system font selected.

One such device has the following specs:

EMUI 4.1
Model number EVA-L09
Android Version 6.0

How can I set the font on a device like this? and more importantly, how can I set the font with Spans? that also doesn't work on this device with an alternate system font selected.

Andrew G
  • 2,596
  • 2
  • 19
  • 26

1 Answers1

0

You can tried by clean . build and uninstall old APK to devices some device . keeps cache .

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
  • It's quite reproducible. I get the same result even with first install, and it works on the emulator. – Andrew G Feb 04 '19 at 07:23
  • Have you check with some other ttf or otf file may be there is some problem in your typeface file. – Chetan Joshi Feb 04 '19 at 07:24
  • Yeah, I've tried an otf and a ttf that work on the emulator, but not on this device. – Andrew G Feb 04 '19 at 07:25
  • Huawei has it's own themes app that enables you to change the system font device-wide. So they're doing something to change the font, apparently even when it is set to "default". – Andrew G Feb 04 '19 at 07:26
  • I have a system font file Huawei Nova Regular located here `/system/fonts/Huawei-Nova-Regular.ttf` but when I apply it, text disappears from `TextView`. This is Huawei's _system font_. – Bugs Happen Oct 24 '19 at 05:18
  • I think in the end it was a bug on this exact version of the OS, and when the user updated the OS, the bug was fixed. – Andrew G Mar 09 '20 at 12:18