Changing the display font size

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How can I change, within my code, the display font size from 96 DPI to 120
DPI? I would like to do it using either MFC or the Win32 SDK.

Thanks,
Eitan
 
How can I change, within my code, the display font size from 96 DPI to 120
DPI? I would like to do it using either MFC or the Win32 SDK.
I don't think that a font contains dpi information since you have no idea
how big the destination monitor will be.
It might be 14 Inch, 15 Inch 19 Inch? Who knows? You might have a width of
800x600 on a 19 Inch and 1024x768 on, a 17 Inch machine.

Just take a bigger font, and let people decide for themselves what is the
best font size.
 
The problem is that if the user select his DPI to be 120 (under
Destop/properties/setting/advanced/display) and I develop the dialog boxes
under 96 DPI, then the dialog boxes cannot contain all the controls
originally designed for.....
Eitan
 
Hello,

How can I change, within my code, the display font size from 96 DPI to 120
DPI? I would like to do it using either MFC or the Win32 SDK.

In anything you DrawText or TextOut yourself, this is simple: just
create a larger font.

For dialog boxes and property sheets pages, you can specify a larger
font size in the resource editor.

Other built-in UI elements, and dialogs displayed by Windows, will
continue to use 96dpi.

However, recent O/Ses have the ability to set "Large Fonts" for all
application, which switches them to 120DPI. This is a user-selectable
setting from Control Panel - Display - Settings - Advanced, and
affects everything as long as it is properly coded.
 
The problem is that if the user select his DPI to be 120 (under
Destop/properties/setting/advanced/display) and I develop the dialog boxes
under 96 DPI, then the dialog boxes cannot contain all the controls
originally designed for.....

All of my dialogs work fine at 96 or 120 dpi. For best results,
especially when using property sheets, specify "MS Shell Dlg" as the
font for your dialogs.

<snip>
 
Hello,

Thanks for your answer.

My question is if it is possible to switch between Small Fonts to Large
Fonts within my application?

Regards,
Eitan
 
Hello,

Thanks for your answer.

My question is if it is possible to switch between Small Fonts to Large
Fonts within my application?

Kind of, if you're willing to reposition and resize all controls on
any dialog based on the new font size. Property sheets and wizards are
a bit harder, but still possible I believe.
 
Hello,

Since your last reply, somebody pointed me to this undocumented function:
SetupChangeFontSize().

I'll test it and it should do what I am looking for.

Eitan
 
Eitan said:
Hello,

Since your last reply, somebody pointed me to this undocumented function:
SetupChangeFontSize().

I'll test it and it should do what I am looking for.

Eitan

I would _personally_ not use any software that changed a setting like
this on my machine. I want to be in control over something that has such
a global effect. And I am quite certain that I am not the only person
holding this opinion.

Ronald
 
I would _personally_ not use any software that changed a setting like
this on my machine. I want to be in control over something that has such
a global effect. And I am quite certain that I am not the only person
holding this opinion.

Me too!
 
I wanted it for my development system, the production system will be at the
right Font size. But it irritating during development to switch back and
forth.....
Thanks, Eitan
 
Back
Top