Create a font that is always the same size, regardless of the video settings

I create fonts usign the following method :

int pts = 12;
int height = -((pDC->GetDeviceCaps(LOGPIXELSY) * pts) / 72);
CFont font;
font.CreateFont(height, 0, 0, 0, (bBold ? FW_BOLD : FW_NORMAL), (char)bItalic, (char)bUnderline, 0,
DEFAULT_CHARSET, OUT_CHARACTER_PRECIS,
CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH |
FF_DONTCARE, fontName);

This is fine in the normal case, but if I go in my video settings (Start~Settings~Control Panel~Display~Settings). There is an option for Font Size, which will let you select "Large fonts". Also, with some video card drivers, it is possible to select a ratio of the normal size for a font (120% of normal, for example).  So when I create a font with a given number of points, I end up with many different possible font sizes...

What I need is a way to create a font that wont be affected by this setting (ie the font will alway be the same number of pixels high for a given pts setting).  Is there a way I can go around that setting ???

Thanx
yletourAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
snoeglerConnect With a Mentor Commented:
Use GetDeviceCaps(LOGPIXELSX)/GetDeviceCaps(LOGPIXELSY) on the display dc.
It will return the DPI settings - which are equal to the DPI selected in the 'Display Properties'.
So 120 DPI = 125% of usual size, ...
Hope this is still of interest :)
0
 
Answers2000Commented:
Try DRAFT_QUALITY and stick to true type
0
 
wyy_cqCommented:
you create two font types, one for 640*480,one for 800*600, you can select the proper font according to the video setting.


0
 
yletourAuthor Commented:
This solution does not answer to the question.  How can I know if the user has Large Fonts or not enabled ?
0
All Courses

From novice to tech pro — start learning today.