- utf8
- a string of text, encoded in UTF-8
the TextExtents
The extents describe a user-space rectangle that encloses the "inked" portion of the text, (as it would be drawn by Context.ShowText()). Additionally, the TextExtents.XAdvance and TextExtents.YAdvance values indicate the amount by which the current point would be advanced by Context.ShowText().
Note that whitespace characters do not directly contribute to the size of the rectangle (TextExtents.Width and TextExtents.Height). They do contribute indirectly by changing the position of non-whitespace characters. In particular, trailing whitespace characters are likely to not affect the size of the rectangle, though they will affect the TextExtents.XAdvance and TextExtents.YAdvance values.