Link to home
Start Free TrialLog in
Avatar of DAE
DAE

asked on

Font size

How to konw the exact size of a font from the point size to implement in an IFont->put_size?

For example:

Point size 8 is actually 8.25
Point size 9 is actually 9
Point size 10 is actually 9.75
Point size 11 is actually 11.25
Point size 12 is actually 12
Point size 14 is actually 14.25

Thanks
Avatar of nonubik
nonubik

HRESULT put_Size(
  CY size  //Size of the font
);
size of the font expressed in a 64-bit CY variable. The upper 32-bits of this value contains the integer point size and the lower 32-bits contains the fractional point size.
ASKER CERTIFIED SOLUTION
Avatar of curero
curero

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DAE

ASKER

I need exactly the opposite.

I have the Height of the font, but I need to convert that Height in to PointSize (Not the rounded PointSize the exact PointSize). See my original post.
Well, not sure if I understood you, but if  ' height = f (point_size) ' and the function f  is bijective then you can calculate point_size=inverse_f( height).
   
 double  dPointSize = (double)(-lfHEight * 72)/GetDeviceCaps(hDC, LOGPIXELSY);

 Am I missing something?