Changing the display font size

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
 
O

Olaf Baeyens

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.
 
G

Guest

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
 
S

Severian [MVP]

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.
 
S

Severian [MVP]

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>
 
G

Guest

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
 
S

Severian [MVP]

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.
 
G

Guest

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
 
R

Ronald Laeremans [MSFT]

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
 
S

Severian [MVP]

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!
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top