Large Fonts

vprex
vprex used Ask the Experts™
on
How can I tell if a user has large fonts turned on?    Is there a way to specifically use normal 96 point fonts?  I have a skinned application and users with large fonts enabled are getting a very poor experience.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use GetFont() in your main window and "GetLogFont ". That gives you LOGFONT structure, from that you can identify the height, and alert the user for the size, if it is not normal...

Rosh :)
see large font is 120 dpi(dot per inch)125% then normal(96 dpi)
so you can detect it like


int sx = pdc->GetDeviceCaps(LOGPIXELSX);
if(sx == 96)
 //normal
else
  if(sx == 120)
   //large font

Author

Commented:
Any answer to the 2nd part of the question?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Setting large fonts using "Windows Settings" itself makes distorted....

Or you can restrict the font size in your application, using SetFont

Rosh
I had this problem our project we have solved it like


int sx = pdc->GetDeviceCaps(LOGPIXELSX);
if(sx == 96)
//normal
else
 if(sx == 120)
    //do mapping of cooridnates of controls according to 96 dpi



 
Commented:
Check out my article.

Detecting the Display Font Size
http://www.codeproject.com/gdi/detectfontsize.asp

Author

Commented:
So far I can detect the font, great.   I can even set the font in OnInitDialog so that the text is correct but the CEdit boxes / Comboboxes are too long now.  They are the right height but too long.

Commented:
Then set the ES_AUTOHSCROLL or CBS_AUTOHSCROLL style to the controls.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial