wxPdfDocument Calculating Text Height  [SOLVED]

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Everydaydiesel
Experienced Solver
Experienced Solver
Posts: 90
Joined: Wed Oct 28, 2015 9:48 pm

wxPdfDocument Calculating Text Height

Postby Everydaydiesel » Sun Aug 19, 2018 1:25 am

Hello,

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


Thanks again!

utelle
Moderator
Moderator
Posts: 823
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument Calculating Text Height  [SOLVED]

Postby utelle » Sun Aug 19, 2018 2:53 am

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


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 1 guest