Determine height in g.DrawString

Assuming you use g.DrawString to print text with word wrap, is it possible to determine the height of the
printed image? so that you can position the next g.DrawString correctly after the first text? e.g. if you have two
text fields or text areas that you want to print consecutively one after the other?

Use StringHeight. See http://documentation.xojo.com/index.php/Graphics.StringHeight . Why can’t you print the 2 text areas at once?

With word wrap, the height of each printed-as-graphic text area will vary in height depending on the width of g and the length of the text in the text area as well as the PenHeight and PenWidth being used. … so I figured this as a very close approximation…

The height would then be:
Dim tbi as integer // text box ‘instructions’ height
tbi = round(400/len(F_Instructions.text)+(g.TextSize * 12)+ (g.TextSize*12)
tbc = pic.height + tbi

where 400 is the wrap width, 12 is the point size being used. The return value is the points
on the graphic representing the height of the printed text area.

The Y-value of the next text area to be printed would be the height of the Picture pic, + the height of the F_Instructions.text