Proper Measurement of Characters in Pixels
I'm writing a text box from scratch in order to optimize it for syntax highlighting. However, I need to get the width of characters in pixels, exactly, not the garbage Graphics::MeasureString gives me. I've found a lot of stuff on the web, specifially this , however, none of it seems to work, or does not account for tabs. I need the fastest way to measure the exact dimensions of a character in pixels, and tab spaces. I can't seem to figure this one out... Should mention I'm using C++, CLR/CLI, and GDI+ Here is my measuring function. In another function the RectangleF it returns is drawn to the