The cell ascent of a character does not accurately include the actual height
of the glyphs within the font. To get this information exactly, as the OP
requires, one would have to examine the font tables. Interestingly, it's
also not against the rules for a glyph to extand past the declared
boundaries of the EM square either.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
[quoted text, click to view] "bhavin" <bh@somecom.com> wrote in message
news:439EF660.1090903@somecom.com...
> FontFamily.GetCellAscent() method should do the job.
>
> Ofcourse it gives you the measurement in DesignUnits, which you can easily
> convert to pixels using your font size and the FontFamily.GetEmHeight()
> value.
>
> hth
> -bhavin
>
> Hans Peter Gerdes wrote:
>> I´m trying to get the exact heigh of a string ("X").
>> I try Graphics.Measurestring() or Font.GetHeight() but all function give
>> me the Height with ascent and descent of the font. I need exactly the
>> Height of the Character "X".
>>
>> Thanks in advance
>>
>> Hans Peter