Width of each character in a font?

How can I determine the width of a particular character within a font

I'm not wanting to use the measureString method as it doesn't seem to return the actual width of the character but rather a padded version of it. Or is there something I'm doing wrong For instance, the character 'i' should be much skinnier then the character 'O' but the measure string seams to be returning roughly the same size.

-Devin



Answer this question

Width of each character in a font?

  • 12R

    Cool. That worked super :) thanks so much. I was looking for a long time for something that would do that.

    -Devin


  • seercase

    Devin,

    Pass StringFormat.GenericTypographic to an overload of MeasureString, this will give a better representation of the real size of the character.

    For more information, see the following page: http://windowsforms.net/articles/gdiptext.aspx.

    Regards

    David



  • Width of each character in a font?