the 'f' char is 82*164 pixel @ 96dpi. the '.' is 79*164pixel
[in each case using 100 point Times New Roman Italic]
Right. Thanks a lot. It looks as though the MeasureString method is
returning the height and width of the rectangular character cell including
the white space, otherwise the width of the italic "." character would be
very much less than the width of the italic "f" character. Also, because in
both cases the height is about right but the width is about twice what I
would have expected it looks as though the MeasureString method is adding
some extra pixels to account for the fact that some characters have a
considerable underhang and overhang and that it is adding those pixels
whether or not the actual character at either the beginning or the end of
the string you are measuring actually does have either underhang or
overhang. Also, since MeasureString is apparently suitable for your needs, I
think I can safely assume that your answer to my original question when I
asked whether by "without spacing" you meant that you wanted to measure just
the size of the glyph itself would be "No".
The bitmap generated it's for an embebbed sistem that draw a
bitmap for each char. I don't need any vectorial sistem.
When I said that you might like to use the GDI GetGlyphOutline function I
didn't actually mean that you should use it to obtain the vector graphic
"shape" of the character (although it is of course capable of performing
such a task). I meant that you might like to use it to return the width and
height of the "black box" that exactly encloses the drawn "glyph", which is
another use for the function, because I wasn't sure what you were after when
you said that you wanted the size of a character "without the space". As it
turns out, and something which I didn't know at the time, you are after the
character size purely to create a bitmap of a suitable size for drawing as a
bitmap in an embedded system, in which case the size of the glyph is very
definitely not what you want, and the character cell size is what you
require.
Thank you for the feedback.
Mike