Page 1 of 1
Posted: Thu Sep 19, 2002 3:55 pm
by BackupUser
Restored from previous forum. Originally posted by horst.
What is the proper way to calculate yHeight for the RichEdit Font?
I have:
a = SelectedFontSize()
b = GetDeviceCaps_(hDC,#LOGPIXELSY) ; after GetDC_(RichHandle)
Horst
Posted: Thu Sep 19, 2002 4:47 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.
Code: Select all
a = cf\yHeight; selected font size in logical units (?)
b = GetDeviceCaps_(GetDC_(WindowID()),#LOGPIXELSY); system font metrics
result = (a*b)/1440
But I don't know exactly what you're looking for. If you're using the RichEdit library,
sizes are divided by 20. That is,
sets
to 200.
Hope this helps, bye,
El_Choni
Posted: Fri Sep 20, 2002 12:43 pm
by BackupUser
Restored from previous forum. Originally posted by horst.
> cf\yHeight sizes are divided by 20. ...
That means:
cf\yHeight = SelectedFontSize() * 20
I did not find that in the API docs. I actually didn't
expect it to be that simple, because I was confused by
that GetDeviceCaps_(hDC,#LOGPIXELSY) stuff (which obviously
is not necessary).
Factor 20 seems to work with all resolutions incl. "large fonts".
BTW: I do not use the library, just want to change font/size.
Thanks!
Horst