Hello, does anyone know why the compose canvas doe...
# compose
m
Hello, does anyone know why the compose canvas does not have a function to draw text similar to the native canvas? Is it not implemented yet or we should just use the
drawContext.canvas.nativeCanvas()
?
s
Didnt implement it yet
We are not very happy with the old api either, and compose requires integration with compose text stack
m
There is a lot of work to centre a char for example with the old API. Nice to hear that new API's are coming for this.
@Siyamed Does the
@Composable Text()
not use the
nativeCanvas.drawText()
to draw text ? Is there some other skia API exposed by compose for drawing text?
s
It uses Paragraph
You can use Paragraph
Which probably will be what we will do
Still there are going to be issues related to paint etc maybe (issues in terms of paint is hidden in Paragraph)
Compose uses static layout etc. So skia is too low level at that point
m
Well i was trying to build a Sudoku game and all i draw is lots of chars at different x,y positions on the screen so i don't need full blown text layout which i assume adds unnecessary overhead. I'm not sure if Paragraph is all that different from Text for what i need it to do but i'll look into it I didn't even know it existed so thanks for the suggestion.