I'm using the classic DrawString method to output text in a WinForms app. A typical call look like this:
g.DrawString(text, font, brush, new Rectangle(x, y, width, height), stringFormat);
If stringFormat.Trimming equals StringTrimming.EllipsisCharacter, the text suddenly "jumps" 1 pixel up if it is clipped and the rectangle of the same left/top/height is used:
This happens for many standards fonts like MS Sans Serif or Courier New, but does not happen for others like Segoe UI. And what is more strange, we can avoid this effect if we specify StringFormatFlags.DirectionRightToLeft for stringFormat.FormatFlags.
Is it a known issue of GDI+, and is there a workaround for that?
P.S. Tested all this in Win 8.1 Pro 64-bit, in an app compiled for .NET 4.0.