I'm making an app where sometimes I want to change the font of a textview to italics, depending on the data to show.
On my Galaxy Nexus, it's simply a case of
textView.setTypeface(font, iWantItalics ? Typeface.ITALIC : Typeface.NORMAL);
and it works beautifully.
The problem is that I've got a new Galaxy Note II to test and... nope, no italics.
Reading Samsung devices supporting setTypeface(Typeface.Italic)? I get the impression that it's a bug on the Note's Android build, so the Roboto font simply has no italics. I've tried every advice on that thread and others similar (Typeface.defaultFromStyle(Typeface.ITALIC)
, Typeface.create(null, Typeface.ITALIC)
, etc.) with no luck.
My problem is that the workaround the guy from that thread used was copying the Roboto TTF in the assets
directory and creating the font from there but what about people with another default font in their phones? I don't want to force Roboto on them or, even worse, to have that other font when the typeface is normal and Roboto italics otherwise.
Has anybody an idea for me? Thanks.