Using the Fonts in XML feature you can specify various font weights for a font family. For example:
I struggled with several weights of a font: bold, semibold, medium, regular.
For me it finally worked when I created a .xml file for each weight, with normal and italic, and then referencing them in the layout or style with both android:fontFamily:
and fontFamily:
. The latter was important, cause otherwise it would only work in very high API levels.
This works even in Android 5.0, didn't test it for lower ones.
So basically create a font.xml file for each font weight, use both app: and android: prefixes, and then reference them with both prefixes.