I would like to be able to center single lines of text within rectangular areas I can calculate. The one thing I have expected to do in 2D geometry on a canvas is to center
What you do is render your text off-screen using a negative text-indent, then grab the size.
text-indent: -9999px
See: hiding text using "text-indent"