We recommend using TextMeasurer instead of using (multi)paragraph directly, since it does some more caching. Cc @Halil Ozercan
h
Halil Ozercan
04/13/2023, 1:57 AM
Yes, it could be quite expensive to create a Paragraph/MultiParagraph instance in DrawScope and draw without any kind of caching mechanism in place. TextMeasurer comes with an internal cache so you can call measure in whichever phase you need. Also,
DrawScope.drawText(textMeasurer, "Hello, World!")
is a handy way to merge measure and draw calls. All of this is ofc multiplatform.