Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android downloadable fonts using semi bold style

I am using google downloadable fonts as given in below link

https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html

I want to use Montserrat font style semi bold but that option is not there in android

Also in below link there is style semibold any idea how to do it

https://fonts.google.com/specimen/Montserrat

following is my textview xml after adding font family

 <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="8dp"
        android:layout_marginTop="8dp"
        android:fontFamily="@font/montserrat"
        android:text="@string/address"
        android:textAllCaps="false"
        android:textColor="@color/title_light_color"
        android:textSize="10sp"
        android:textStyle="bold" />
like image 460
amodkanthe Avatar asked Oct 17 '22 00:10

amodkanthe


1 Answers

You can download here all types of fonts montserrat

https://github.com/google/fonts/tree/master/ofl/montserrat

https://github.com/google/fonts/blob/master/ofl/montserrat/Montserrat-SemiBold.ttf

Add in your res/font folder use this

android:fontFamily="@font/Montserrat-SemiBold"

Hope it helps

like image 196
Ramesh sambu Avatar answered Oct 29 '22 20:10

Ramesh sambu