I had a look at "DrawText", but the position is given in "Dips".
No, the coordinates are given in pixels.
Attached a small demo program showing the principle.
The upper 4 points are drawn with physical scale.
At the bottom, the "My text" display shows what you get with the
rectText = cvsTest.MeasureText("My text", fnt) routine.
The blue cross represents the coordinates xt and yt you give in
cvsTest.DrawText("My text", xt, yt, fnt, xui.Color_Red, "LEFT")
The green rectangle is the outer rectangle of the text.
rectTextOuter.Initialize(xt + rectText.Left, yt + rectText.Top, xt + rectText.Right, yt + rectText.Bottom)
At the right, the gray lines from top to bottom:
yt + rectText.Top, the top position (-rectText.Top is the distance between the top and the base line)
yt + rectText.CenterY, the center position (-rectText.CenterY is the distance between the center and the base line)
yt, the base line of the text
yt + rectText.Bottom, the bottom position (rectText.Bottomis the distance between the bottom and the base line)
At the bottom, the gray lines from left to right:
xt + rectText.Left, the left position, you see that there is a kind of padding
xt + rectText.CenterX, the center position
xt + rectText.Right, the right position.