TextExtent(rp, string, count, textExtent)
void textExtent(
struct RastPort *, STRPTR, WORD,
This function determines a more complete metric of the space that a text string would render into than the
TextLength() function.
textExtent is filled in as follows:
- te_Width
-
same as TextLength() result: the rp_cp_x advance that rendering this text would cause.
- te_Height
-
same as tf_YSize. The height of the font.
- te_Extent.MinX
-
the offset to the left side of the rectangle this would render into. Often zero.
- te_Extent.MinY
-
same as -tf_Baseline. The offset from the baseline to the top of the rectangle this would render into.
- te_Extent.MaxX
-
the offset of the left side of the rectangle this would render into. Often the same as te_Width-1.
- te_Extent.MaxY
-
same as tf_YSize-tf_Baseline-1. The offset from the baseline to the bottom of the rectangle this would render into.
Before V47, this function suffered from an off-by-one error in case the input font was not fixed width.