anyone know a way to load Font from http url inste...
# compose
s
anyone know a way to load Font from http url instead of ResourceID ?
c
You’d need to download it to a file, then load it as an Android typeface using
Typeface.createFromFile()
, and then wrap that up for Compose https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/package-summary#typeface_1
s
I would like to load font on the fly during runtime, just like we lazy load image from http url and display.
c
Well you'll have to write it yourself, Compose doesn’t do this for you
👍 1
o
I think I saw api to load font from bytes. But may be it was in desktop variant of compose