I have to make a text appear on a custom path, like a curve, and I am using native canvas for that.
Something like
Canvas{
drawIntoCanvas{
it.nativeCanvas.drawTextOnPath(
"Text Goes Here",
textPath,
0f,
0f,
Paint().apply{
//Here, I can specify the text size, but don't know how to specify the family
//PS: it offers a typeface to modify, but it is messed up with the legacy APIs
}
)
}
}
The issue is that the nativeCanvas
uses android.graphics.Paint
, and so everything inside it is also the legacy android stuff. How do I access the font in Compose, given that I have it located as a .tff
file in my res/fonts
.
Thanks!