Closed adrifernandev closed 6 months ago
@jeziellago
Hi, @adrifernandev Thank you for contributing.
Considering that compose has multiple strategies of font loading and the MarkdownText under the hood uses a TextView, my suggestion for you is to try to implement this wrapper function to translate the compose strategies into a typeface for a native TextView. https://github.com/jeziellago/compose-markdown/blob/c990cebefd72c93f1902c8941cc216bd7bb2081c/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/TextAppearanceExt.kt#L50
fun TextView.applyFontFamily(fontFamily: FontFamily) {
when(fontFamily) {
is SystemFontFamily -> {}
is FontListFontFamily -> {}
is LoadedFontFamily -> {}
}
}
If fontfamily is defined on the style that is passed by arguments, it takes it from this style, instead of having to pass the fontResource.