I have a WinForms user control and I'm trying to obtain the exact horizontal character spacing for the current font, which is expected to be mono-spaced.
Looks like the font's Size
property provides this information but is apparently in points and I'm working in pixels.
var fontWidth = this.Font.Size; // Returns em-size in points--not pixels
If I create the font myself, I can specify that it uses Pixel units. But in my case the font is set through a property of my user control and I can't determine how the font is created. Unfortunately, the font's Unit
property is read-only.
How can I make an existing font return metrics in pixels?