wxPdfDocument Calculating Text Height Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
Everydaydiesel
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Oct 28, 2015 9:48 pm

wxPdfDocument Calculating Text Height

Post by Everydaydiesel »

Hello,

I see a GetStringWidth but I do not see one for height? Am I missing it?


Thanks again!
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument Calculating Text Height

Post by utelle »

Everydaydiesel wrote:I see a GetStringWidth but I do not see one for height? Am I missing it?
The method you are seeking for is GetFontSize. This method returns the size of the currently selected font in points, where 1 point equals 1/72 inch. It is not necessary to calculate the text height of a text string, because it is determined by the font size.

For readable text output the line height should typically be about 25 % higher than the font size.

If you need more details about the currently selected font, you can use method GetDescription of the wxPdfFont class, which returns a wxPdfFontDescription object.

Regards,

Ulrich
Post Reply