I have a custom font which has variable-width numeric glyphs by default, and I would like to use the font's monospace tabular numbers feature in an Android TextView
so that numbers align vertically.
That is, change something like this:
to something like this:
To select a font's tabular number feature, use TextView
's fontFeatureSettings
with tnum
:
<TextView
...
android:fontFeatureSettings="tnum"
android:text="1111.11\n2222.22"
/>
Requires API level 21.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With