News: TO REGISTER, contact tech support: http://cwsof.com/support.html
 
Pages: [1]   Go Down
  Print  
Author Topic: Depth of text  (Read 244 times)
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« on: March 26, 2012, 08:03:27 PM »

Is is possible to get the depth, in pixels, of the text in a RichTextBox?
An alternative would be to get the number of lines of text so one could calculate the depth in pixels.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« Reply #1 on: March 26, 2012, 09:45:57 PM »

Use EZ_GetRichFont to get the font type and size of the text.

Use EZ_DefFont to create a font using that font data.

use EZ_GetTextSize to determine the width and height of the text.

Use EZ_FreeFont to free the font you created.

Logged
Brian Reynolds
PreRelease 4.5
Sr. Member
*
Posts: 304


View Profile
« Reply #2 on: March 26, 2012, 11:56:45 PM »

Chris,
That wasn't what I meant.
What I would like to achieve is get the depth of all the text in a RichTextBox.
For instance, I want to know how far from the top of the first line of text to the bottom of the last line of text which would include all of the different sizes of text that may be in that block of text.
If there are 200 lines of text, how far from top to bottom?

Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1800


View Profile
« Reply #3 on: March 27, 2012, 07:04:24 AM »

I don't see any single message which will do what you want.

Are you just trying to just see what the total height is of all the lines of text combined ?

You would think it could do that, but I don't see how.

The SDK docs I am using though are not the latest though (good for Windows 95 to ME), so you may want to check MSDN to see if there are any messages I have missed.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: