Hi forums,
Is there a way to have XGraphics.MeasureString not ignore trailing spaces? This code:
Code:
text = "test: ";
graphics.DrawString(text, font, brush, drawpoint);
drawpoint.X += graphics.MeasureString(text, font).Width;
text = "stuff";
graphics.DrawString(text, font, brush, drawpoint);
drawpoint.X = 0;
drawpoint.Y += graphics.MeasureString(text, font).Height;
text = "test: stuff";
graphics.DrawString(text, font, brush, drawpoint);
drawpoint.X = 0;
drawpoint.Y += graphics.MeasureString(text, font).Height;
text = "test:";
graphics.DrawString(text, font, brush, drawpoint);
drawpoint.X += graphics.MeasureString(text, font).Width;
text = " stuff";
graphics.DrawString(text, font, brush, drawpoint);
draws:
test:stuff
test: stuff
test: stuff
The first test is ignoring the two trailing spaces at the end of "test", and the other two operate as expected. I need to be able to accomodate trailing spaces. Is there any way around this, or will I have to mess around with the source code?