What are the default font characteristics in Android ?

前端 未结 2 2002
滥情空心
滥情空心 2020-12-07 18:02

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

相关标签:
2条回答
  • 2020-12-07 18:17

    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.

    0 讨论(0)
  • 2020-12-07 18:30

    For the newer 4.0 ICS etc there's the Android design pages which shows a list of font sizes:

    http://developer.android.com/design/style/typography.html

    All specified as 'sp' units

    HTH

    0 讨论(0)
提交回复
热议问题