getFontCompat

fun Context.getFontCompat(@FontRes id: Int): Typeface?

Get a font from the resources based on their ID using ResourcesCompat.getFont()