gdi+ - Graphics.MeasureString either too wide or too narrow
问题 I'm using the System.Drawing library in C# to measure a string's size: SizeF size = gfx.MeasureString("Hello", myFont); However, this returns a size with a bit of spacing around the text. Here's the text rendered with a red bounding box that represents the size MeasureString returned. The TopLeft corner of both the box and the text is exactly the same point. I stumbled upon this question on Stack Overflow that recommended using StringFormat.GenericTypographic to remove the spacing. So I