Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextView with custom font isn't centered vertically

I need to use a custom font (VAG Rounded, probably not relevant) but the font changes how my TextViews react.

In the image below, you can see the two textviews with a black background. The left one use the custom font, the right one the default system font (Roboto ?). Both of them have the same xml properties and size, but the padding is not the same and more important, the left one isn't centered vartically !

enter image description here

How can I make the TextView draw its content well centered ?

like image 419
Stephane Mathis Avatar asked Aug 28 '14 09:08

Stephane Mathis


1 Answers

You can try to remove your customs font padding from your text style (styles.xml):

<item name="android:includeFontPadding">false</item>

If this still doesn't work, i would set a general padding in your styles xml.

like image 145
Javatar Avatar answered Sep 23 '22 17:09

Javatar