Centering multiline text in canvas

I am able to center a line of text in a canvas when it is just one line, and I found how to make the text to be drawn multiline if the length of the text is longer than the width of the canvas, but is there an easy way to center multiline text? Or is pre-splitting the text and then centering both lines separately the best approach?

Unfortunately, you have to split the text into the lines.

I logged an enhancement request as the Xojo framework should do this for us:
<https://xojo.com/issue/64833>

You might be able to use the Styled Text Printer replacement class I created. See the following forum topic with the download link I posted on May 24th:

Thanks for the reply. Thought this would be the case. Thanks also for the sample project. Will take a look!