roboto - Android TextView custom typeset causes gravity to stop working -


update

this appears happening roboto-italic.ttf. if you're running issue, try font family.


i'm running odd issue when applying typeset textview. app name, "contact" in linearlayout android:gravity="center" set, causes centered nicely seen in "before" image below. when set typeface, causes gravity stop working reason. how i'm setting typeface:

tvappname.settypeface(   typeface.createfromasset(getactivity().getassets(),"fonts/roboto-italic.ttf")); 

any idea why might happening? i've tried setting gravity programmatically, didn't help. commenting 1 line causes text go being centered.

before

imgur

after

imgur

the roboto-italic.ttf file google's website seems broken or incompatible in way. work-around use normal roboto font specify italic 2nd argument:

typeface tf = typeface.createfromasset(getactivity().getassets(), "fonts/roboto-normal.ttf"));  tvappname.settypeface(tf, typeface.italic); 

what fake italics putting skew on text. theoretically not nice, solves problem of gravity , other layout attributes not working real roboto italic.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -