I need to draw text onto Canvas
in Compose, for this purpose I need a TextPaint
with android.graphics.Typeface
.
Is there a way to easily convert Compose TextStyle
to a android.graphics.Typeface
?
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Currently the only workaround that i found is to provide with resources:
However if android version < android oreo, idk how to provide the font, so i fallback to default fount.
To draw text to canvas, you can do like this
I think to convert
TextStyle
(compose library) totypeface
will be a pain since no support from android, If you want to draw text to canvas I think this will be enough