Currently, we truncate white space at the end of lines when the text is centered.
Correct behavior should be that the white space still adds metrics but does not contribute to the centering or width of the text. This way, when spaces are typed, they still appear and the centering is not skewed.
This is extracted from #25312