This project has moved and is read-only. For the latest updates, please go here.

Space characters in SpriteFont:: MeasureSting

Oct 18, 2014 at 6:49 PM
I notice here Chuck states "The root of the issue is that SpriteFont skips drawing of characters that are iswspace as a performance optimization. In most cases, that is the preferred behavior"
However the code is also used for MeasureString which has the effect of misstating the width of strings, assuming that a space character has some width. I think space characters should have some width, even if other white space like /t are ignored.
Oct 18, 2014 at 9:30 PM
Space characters do have width. They are not drawn themselves (being empty), but they offset the location of whatever other characters are positioned to their right.
Oct 20, 2014 at 6:05 AM
Spaces in the beginning and middle of a string are rendered and included in MeasureString. As to why 'trailing spaces' are ignored, see workitem 674.
Marked as answer by walbourn on 10/19/2014 at 10:05 PM