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?
Type the keyboard shortcut: CTRL+B.
Start with the font you want, and always end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. Note: Separate each value with a comma. Note: If a font name contains white-space, it must be quoted.
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With