Append print to multi-line text

I have a block of text I want to print.
I run it through a word wrapping function to make it multi-line.
I want to now add some more text to the end of the last line but in a different colour (so I can’t just add it to the block of text before wrapping).

How do I measure what I have just printed to get new x and y for the new text.
Would it help if the wrap function returned the number of lines created?

// wrap the text and print
strTextToPrint = WordWrap(strBlockOfText,wrapLength.val)
g.DrawString (strTextToPrint,bodyX,bodyY)

// now add some more text directly after on the same line in a different colour
g.ForeColor = &cff0000
and ?

why don’t you use a StyledTextPrinter ? with the DrawBlock method, this would be handled for you.
and you could print in color, bold, italic…