CRicheditctrl: Get line height from font size

abc abc 351 Reputation points
2020-09-30T12:42:18.863+00:00

Hi,

when placing the cursor in the cricheditctrl, I am able to get char index charfrompos and am able to get line number linefromchar.
I know the font size from GetDefaultCharFormat() which gives CHARFORMAT yHeight value as 165.
Now how to get exact font height from font size and get the line height from font height?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,451 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 110.1K Reputation points
    2020-09-30T12:57:00.787+00:00

    According to documentation, 165 is about 0.115 inches or 3 mm. (Not all monitors show exactly this height). I think that this height represents the default interval between lines of current font.

    Do you need the height in pixels?