Friday, October 26, 2018

Font Setup





1. SETTING FONT TO TEXTVIEW FROM GOOGLE FONT

In Layout Inspector   ->   Textview  ->  Font-Family  -> More  -> Select your Font

Now, In TextView

<TextView    
android:layout_width="match_parent"    
android:layout_height="wrap_content"     
android:text="Test Data"    
android:fontFamily="@font/faster_one"    
/>


2. SETTING FONT FROM GOOGLE FONT

First, Download Google font from above method, After that add Font-Family in your
style

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->    
<item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:fontFamily">@font/faster_one</item>
</style>


3. SETTING FONT, WHICH NOT FROM GOOGLE

https://github.com/googlesamples/android-DownloadableFonts





SOME FONT
----------
1. Crimson Text

No comments:

Post a Comment