How to create custom font family with bold font

Near1999

I'm trying to create custom font family using this doc https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html The problem in that that there is no bold attribute and I can not set it programmatically Fonts in XML?

jeprubio

Set 700 as the fontWeight value for your font in bold.

As it's in the font resources documentation:

The most common values are 400 for regular weight and 700 for bold weight.

In the lobster font family example you linked it would be:

<!-- bold -->
<font
    android:fontStyle="normal"
    android:fontWeight="700"
    android:font="@font/lobster_bold" />

And, if you are using support lib:

<!-- bold -->
<font
    app:font="@font/lobster_bold"
    app:fontStyle="normal"
    app:fontWeight="700" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I alias the bold weight of a font family to the bold weight of another font family?

How to set custom bold font programmatically - swift

Font family Roboto light and bold in react native

How to create custom font icons?

custom fonts with Font-Family

How do I get a bold version of a custom font?

How to use bold, regular and italic font styles for custom fonts?

How to use a specific font from a font family

How to Set a Custom Font Family in the Xamarin ActionBar Title?

How do you apply a custom font family for placeholder, textbox & button?

How to define the "Light, Normal, Bold" versions of a font-family in Document Service?

how to override bootstrap font family?

how to change font family of sweetalert

How to change levelplot font family?

How to set custom font with regular and bold font while setting html string to label in swift 4?

How to change the font family of Highchart to Bootstrap css default font family

Device wise font change but not apply font family and type - how to add font type and font family is ClashGrotesk

Android show HTML text as bold with custom font

iOS: Custom Font Robot-Bold (not working)

Setting TextView to bold font with xml-attribute and custom font (not working)

How to set bold font instead font weight in Bootstrap 4 SCSS?

Change Font Family, Rename Font

How to specify a proprietary font with font-family property?

how to change font size of label without changing font family in xcode

How do you adjust the font and font family on this date script

How to use font-face font family in react component render?

How can i get list of font family(or Name of Font) in matplotlib

How to set a "bold" dynamic font type for UILabel?

How to apply both bold and italic font to an NSAttributedString?