Link to home
Start Free TrialLog in
Avatar of yletour
yletour

asked on

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
Avatar of Answers2000
Answers2000

Try DRAFT_QUALITY and stick to true type
you create two font types, one for 640*480,one for 800*600, you can select the proper font according to the video setting.


Avatar of yletour

ASKER

This solution does not answer to the question.  How can I know if the user has Large Fonts or not enabled ?
ASKER CERTIFIED SOLUTION
Avatar of snoegler
snoegler

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