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
RichEdit Font
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by El_Choni.
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
Code: Select all
a = cf\yHeight; selected font size in logical units (?)
b = GetDeviceCaps_(GetDC_(WindowID()),#LOGPIXELSY); system font metrics
result = (a*b)/1440
Code: Select all
cf\yHeightCode: Select all
RichEditFontSize(10)Code: Select all
cf\yHeightHope this helps, bye,
El_Choni
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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
> 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