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
after
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
Post a Comment