How to change “fontFamily”of Android TextView ?

In android xml file you can change font like bellow

<pre class="default prettyprint prettyprinted"><code><span class="pln">android</span><span class="pun">:</span><span class="pln">fontFamily</span><span class="pun">=</span><span class="str">"sans-serif"</span>           <span class="com">// roboto regular</span><span class="pln">
android</span><span class="pun">:</span><span class="pln">fontFamily</span><span class="pun">=</span><span class="str">"sans-serif-light"</span>     <span class="com">// roboto light</span><span class="pln">
android</span><span class="pun">:</span><span class="pln">fontFamily</span><span class="pun">=</span><span class="str">"sans-serif-condensed"</span> <span class="com">// roboto condensed</span><span class="pln">
android</span><span class="pun">:</span><span class="pln">fontFamily</span><span class="pun">=</span><span class="str">"sans-serif-thin"</span>      <span class="com">// roboto thin (android 4.2)</span><span class="pln">
android</span><span class="pun">:</span><span class="pln">fontFamily</span><span class="pun">=</span><span class="str">"sans-serif-medium"</span>    <span class="com">// roboto medium (android 5.0)

Some built in fonts names:

  • Roboto regular
  • Roboto italic
  • Roboto bold
  • Roboto bold italic
  • Roboto-Light
  • Roboto-Light italic
  • Roboto-Thin
  • Roboto-Thin italic
  • Roboto-Condensed
  • Roboto-Condensed italic
  • Roboto-Condensed bold
  • Roboto-Condensed bold italic
  • Roboto-Medium
  • Roboto-Medium italic
 
It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someoneBuffer this pageDigg thisFlattr the authorShare on StumbleUponPin on PinterestShare on YummlyShare on VKShare on RedditPrint this pageShare on Tumblr
Related Posts

Add a Comment

Your email address will not be published. Required fields are marked *