I'm using Raleway, and the default is to use old-style numbers where 3, 4, 5, 7, and 9 descend below the baseline. On iOS I can specify a feature setting to use the "upper case" (lining) numbers:
UIFontFeatureSelectorIdentifierKey : @(kUpperCaseNumbersSelector)
How do I do this on Android?
So, for Android 5.0 and above (API 21), you can use the fontFeatureSettings property to enable this:
TextView myTextView = findViewById(R.id.myTextView);
myTextView.setFontFeatureSettings("lnum"); // Enabling lining numbers
Which I've tested to work with Raleway. Unfortunately that's probably not a sufficient option. There's a similar question here in which the suggested solution is to re-upload the font to FontSquirrel's font generator and substitute the lining number glyphs for the tabular glyphs.
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