Material-components-android: Material Button adding spaces between letters on Lollipop

Created on 23 Jul 2019  ·  3Comments  ·  Source: material-components/material-components-android

In API 21, when using a custom font, the MaterialButton seems to be placing spacing between each letter.

The font is not the problem, as in other Views such as the TextView, the letters are intact.

image

bug

Most helpful comment

android:textAppearance=”?attr/textAppearanceBody1”

All 3 comments

Hi,
You can override the MaterialButton letter spacing to achieve the desired result with this font.
You should set textAppearanceButton in your theme to be a TextAppearance which sets android:letterSpacing to 0.

Let us know if this doesn't solve your problem or if you have any other questions.

android:textAppearance=”?attr/textAppearanceBody1”

Thanks @PawankumarPK, this solution is easier

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JakeWharton picture JakeWharton  ·  3Comments

KelvinPac picture KelvinPac  ·  3Comments

JavierSegoviaCordoba picture JavierSegoviaCordoba  ·  3Comments

Mirmuhsin picture Mirmuhsin  ·  3Comments

danielwilson1702 picture danielwilson1702  ·  3Comments