5

I need to know from with version of Android these fonts are supported :

sans-serif (Roboto-Regular)
sans-serif-light (Roboto-Light)
sans-serif-thin (Roboto-Thin)
sans-serif-medium (Roboto-Medium)

also it's look like that on android 4.4.2 i can't make sans-serif-thin "Bold". any ideas why ?

zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

4

These fonts are supported from API 16 - minSdkVersion 16. Here you have related topic: Valid values for android:fontFamily and what they map to?

Here is a link to the documentation

So you styles should look like that:

<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">bold</item>

sans-serif-medium (Roboto-Medium) was added in Android Lollipop so that's the reason you can not see changes on 4.4.2 (if you use these fonts).

More helpful links: https://android.googlesource.com/platform/frameworks/base/+/lollipop-release/data/fonts/system_fonts.xml

https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/fonts.xml

And another answer on SO: https://stackoverflow.com/a/29834998/2065587

Community
  • 1
  • 1
mmBs
  • 8,421
  • 6
  • 38
  • 46
  • thanks mmbs, but where did you saw that sans-serif-thin were added in lollipop ? i didn't see any doc about this :( – zeus Oct 05 '16 at 10:16