Rick
Fri Jan 07 18:48:32 CST 2005
Gene,
I think I found the registry value that indicates this - it's at: =
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI. The =
Normal value is 96, and "Large" is 120. So I expect the scaling factor =
is 96/120 =3D 0.80 (or you reduce it by 120/96 =3D 1.25).
This routine will return the current value. Note: It requires my "fixed" =
version of the REGISTRY.PRG so you can read out DWORD values. (You can =
get it at
http://mmfudg.org/files/reg_up.zip. The registry.prg has been =
tested in VFP 5.0 -> 9.0.)
?testregfontdpi()
*** TestRegFontDpi.PRG ***
#DEFINE HKEY_CURRENT_USER -2147483647 && BITSET(0,31)+1
LOCAL lnRegValue, lcRegfile, lnRetVal, lcRetVal, oReg
lnRegValue =3D 0
lcRegfile =3D _samples+"classes\"+"REGISTRY"
lnRetVal =3D 0
SET PROCEDURE TO (m.lcRegfile) ADDITIVE
oReg =3D CreateObject("Registry")
lnRetVal =3D oReg.GetRegKey("AppliedDPI",@lnRegValue,;
"Control Panel\Desktop\WindowMetrics", HKEY_CURRENT_USER)
IF lnRetVal =3D 0 && No problem
lcRetVal =3D TRANSFORM(lnRegValue)
ELSE
lcRetVal =3D "(Error)"
ENDIF
RELEASE oReg
RELEASE PROC (m.lcRegfile)
RETURN lcRetVal
Rick
"Gene Wirchenko" <genew@ucantrade.com.NOTHERE> wrote in message =
news:2i5ut0da7tr3t2uekmlcrsr0g3797eau1j@4ax.com...
> [reordered to chronological]
>=20
> On Fri, 7 Jan 2005 14:50:38 -0500, "Rick Bean"
> <rgbean@unrealmelange-inc.com> wrote:
>=20
>>"Gene Wirchenko >" <Gene Wirchenko <genew@ucantrade.com.NOTHERE> wrote =
in message news:asjtt01rgpsn02vmm9u3b35p2eek1gi10i@4ax.com...
>>> I have read various posts about how large and small fonts affect
>>> Fox2 apps. How does it apply to VFP? I think I have a case of it.
>>>=20
>>> The symptoms: On one system, text is truncated in labels and
>>> command button captions. The form is the correct size, but the =
fonts
>>> are too big.
>>>=20
>>> How do I find out which font type is in use and the appropriate
>>> scaling factor?
>=20
>>This is usually due to using non-standard fonts. When Windows is asked
> to display a font that isn't installed on that system, "it picks a
> similar one". How Windows determines what's similar to one that it
> doesn't have is undocumented as far as I can find!
>=20
> That sounded like it might be it, but it was not. The font in
> question is Courier New. That is on the trouble system.
>=20
> It turns out to be in Display Properties - Settings - Advanced...
> - General - Display - Font size:. You can set Small fonts or large
> fonts (125% of normal). Questions arise:
>=20
> 1) How do I programmatically detect which font size is in use?
>=20
> 2) Other things are affected by this setting, so I want to know how
> and what to scale so that my displays work on either font size.
>=20
> Sincerely,
>=20
> Gene Wirchenko
>