Starting in API 16, Jellybean Roboto was introduced as available font family to use. See whats "new" in Android 16 here.
Specifying android:fontFamily="sans-serif"
(Roboto in API 16+) on a TextView
the default fontFamily
of the TextView
?
Is
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
equivalent to
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif" />
?
From Material design typography website:
"Roboto and Noto are the standard typefaces on Android and Chrome."
From Wiki,
"Roboto is a sans-serif typeface family developed by Google as the system font for its mobile operating system Android."
I do not see in the docs what the default fontFamily
of Android is. See references:
There is no documentation on d.android.com for font family names. However, if you look at AOSP, the default fonts are loaded in
android.graphics.*
. The FontListParser loads the default fonts from/system/etc/fonts.xml
(Android 5.0+) or/system/etc/system_fonts.xml
(Android 4.1). The default fonts are loaded in Typeface#init.The two XML files have some documentation. The first font is the default font. You can pull /system/etc/fonts.xml from your device. A device manufacturer or custom ROM may change the default system fonts.
fonts.xml (API 21+)
system_fonts.xml (API 16-20)
If you parse the fonts.xml file, you can find which font family uses which typeface (see here):