Link to home
Start Free TrialLog in
Avatar of vprex
vprex

asked on

Large Fonts

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.
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

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 :)
Avatar of vijay_visana
vijay_visana

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

ASKER

Any answer to the 2nd part of the question?
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



 
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

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

ASKER

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.
Then set the ES_AUTOHSCROLL or CBS_AUTOHSCROLL style to the controls.