measure

abstract fun measure(text: String, style: TextStyle): TextMetrics

Measures text rendered with style and returns its dimensions. The result must agree with what the matching PdfCanvas.drawText call would actually produce, otherwise wrapping calculations drift away from the rendered output.