Measures text with the current TextStyle, including glyph overhang, in the same coordinates as Painter.Text.
maxSize supplies the same layout bounds as a drawing rectangle; default uses Painter.Text's unconstrained bounds.
The result includes ScaleToScreen but excludes Painter.Transform, clipping and opacity. Empty text returns zero.
Prepares cached layout without recording a draw or allocating a bitmap or GPU texture. A later draw reuses the layout.