Is it not possible to load fonts from resources in...
# compose
m
Is it not possible to load fonts from resources in Compose previews?
s
Is it you are looking for Font(resourceId) or they work on device but not preview?
Cc @Sean McQuillan [G]
m
They work on device, but crash on preview with
android.content.res.Resources$NotFoundException: Font resource ID #0x7f090002 could not be retrieved.
I'm using
ResourcesCompat.getFont(context, R.font.roboto_bold
in order to use the font in a Canvas.
I assume the problem is trying to use the context, but what is the solution?
s
Much delayed. Can you please file a bug with a repro case for this, it's a tooling issue that we'll need to fix. Thanks!