The documentation indicates this program is intended to center the text "Hello World". Noticing the off-center text, I was worried I had messed up some other configuration somewhere. The legacy implementation determined the offset by the number of characters in the string, but to center the text the offset should consider the rendered size of the characters.
Acknowledging this is supposed to be a simple example, I'm open to this change complicating it undesirably.
The documentation indicates this program is intended to center the text "Hello World". Noticing the off-center text, I was worried I had messed up some other configuration somewhere. The legacy implementation determined the offset by the number of characters in the string, but to center the text the offset should consider the rendered size of the characters.
Acknowledging this is supposed to be a simple example, I'm open to this change complicating it undesirably.
Before
After