I must change default font of alertDialog.setMessage
and alertDialog.setTitle
but I can't use a custom layout, so I have to change it by code in Kotlin.
I tried using typeface, but he doesn't detect the font in res/font/product_sans_bold.ttf
I also used
content.text = Html.fromHtml(resources.getString(R.string.centripetaFormule))
content.typeface = ResourcesCompat.getFont(applicationContext, R.font.product_sans_bold)
alertDialog.setView(content)
and it works, but not as i want.
I have a string
<string name ="centripetaFormule>![CDATA[<h5>(...)</h5><p>(...)</p>
where h5
is bold, so using variable content there will be no differences between h5 and "normal" text, except for the size.
So, I want to change font just for normal text, I can't use a custom layout, I have to use strings with CDATA
.
How to do that?
Hope I explained it well