John Whitney wrote:
> My Win32::GUI app has text in the window, and when run on Windows 7, versus
> 98 or XP, the size of the text in pixels changes. Is there a way to keep
> the text size consistant, pixel wise, across the different operating
> systems? Here is an image showing how it differs, Windows 7 vs Win98..
Your only hope is to have the DPI set correctly for each monitor and use
that value to set the character size in point, not pixels.
But starting in Win7, and HTML5, because programmers used pixels all the
time rather than points, the HTML5 designers redefined a pixel to be exactly
1/100th of an inch. To get at real hardware values you have to look at some
other setting in a browser.
Win7 has both types of magnification -- one that is XP compat which changes
the DPI number (which most apps ignored), and another which changes the size
of the pixel (which works for all apps, but may cause other problems --
app not fitting on the screen or such.
Providing your Win7 isn't using global magnification -- you might try
at the DPI value...
I grab it in a BASH script on windows with
dpi=$(regtool -d get '/HKLM/Software/Microsoft/Windows
# check for insane values
((dpi<50||dpi>>400)) && dpi=96
(I also added some sanity checking in case the number was really weird.
Another thing -- that looks different between the two -- one looks like
LCD font smoothing turned on, (Cleartype), the XP version looks like it
be using anti aliasing, or maybe not even that....
I don't know where you can poke at those settings programatically...