How to compute the correct width of a digit in pixels?
问题 I have a custom control that may have user customizable Font in future (the zoom is already implemented). I must fill a rectangle under two digits that form a base-10 number. I have different colors for zero, one or both of the digits. With the font {Name = Microsoft Sans Serif Size= 16 } and the following Graphics.MeasureString method calls: g.MeasureString("00", Font); g.MeasureString("0", Font); I get: The size of "00" is {Width = 31.5486088 Height = 26.8124962 } The size of "0" is {Width