What are the default font characteristics in Android ?

Sephy picture Sephy · Nov 26, 2010 · Viewed 35.7k times · Source

I know that fonts properties can be found in the TypeFace class but I can't find the default characteristics of the writing in Android. I mean, if I take a TextView and simply do setText("Blabla") on it, what will I get? Which size in px? Which font? etc.

Answer

Maragues picture Maragues · Nov 26, 2010

You can check the default style of the widgets here: android/res/values/styles.xml

Then, looking for Textview you reach

  <style name="Widget.TextView">    
     <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>    
 </style>

and after researching a little bit, you find out that this appearance is defined in the same styles.xml file

<style name="TextAppearance.Small">    
 <item name="android:textSize">14sp</item>    
 <item name="android:textStyle">normal</item>    
 <item name="android:textColor">?textColorSecondary</item>    
</style>

where

<item name="textColorSecondary">@android:color/secondary_text_dark</item>

these colors are defined in /res/color/, check /res/color/secondary_text_dark.xml

Bookmarking the android/res/values folder is a must!

Update: my old links are broken, check Android core resources folder on Github. Thanks to kreker for the link.