VFP 6: Large and Small Fonts - 01-07-2005 , 12:32 PM
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.
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.
How do I find out which font type is in use and the appropriate
Re: VFP 6: Large and Small Fonts - 01-07-2005 , 01:50 PM
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!
"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote
Re: VFP 6: Large and Small Fonts - 01-07-2005 , 04:45 PM
Rick Bean wrote:
which case I use courier new. That way the size always stays the same,
of course then you run into a problem with some of the new high res
Re: VFP 6: Large and Small Fonts - 01-07-2005 , 05:09 PM
[reordered to chronological]
On Fri, 7 Jan 2005 14:50:38 -0500, "Rick Bean"
<rgbean (AT) unrealmelange-inc (DOT) com> wrote:
doesn't have is undocumented as far as I can find!
That sounded like it might be it, but it was not. The font in
question is Courier New. That is on the trouble system.
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:
1) How do I programmatically detect which font size is in use?
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.
Re: VFP 6: Large and Small Fonts - 01-07-2005 , 06:48 PM
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 = 0.80 (or you reduce it by 120/96 = 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.PRG ***
#DEFINE HKEY_CURRENT_USER -2147483647 && BITSET(0,31)+1
LOCAL lnRegValue, lcRegfile, lnRetVal, lcRetVal, oReg
lnRegValue = 0
lcRegfile = _samples+"classes\"+"REGISTRY"
lnRetVal = 0
SET PROCEDURE TO (m.lcRegfile) ADDITIVE
oReg = CreateObject("Registry")
lnRetVal = oReg.GetRegKey("AppliedDPI",@lnRegValue,;
"Control Panel\Desktop\WindowMetrics", HKEY_CURRENT_USER)
IF lnRetVal = 0 && No problem
lcRetVal = TRANSFORM(lnRegValue)
lcRetVal = "(Error)"
RELEASE PROC (m.lcRegfile)
"Gene Wirchenko" <genew (AT) ucantrade (DOT) com.NOTHERE> wrote
Re: VFP 6: Large and Small Fonts - 01-09-2005 , 07:53 PM
You might also recommend the user just look at switching back to small fonts
and going through and increasing the font point sizes nder the Appearance
tab on the desktop properties.
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro
"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote in
message news:asjtt01rgpsn02vmm9u3b35p2eek1gi10i (AT) 4ax (DOT) com...
Re: VFP 6: Large and Small Fonts - 01-10-2005 , 12:59 PM
Try this in your startup code,
DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd
DECLARE INTEGER GetDeviceCaps IN gdi32 INTEGER hdc, INTEGER nIndex
DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
nHwnd = GetWindowDC(0)
nSize = getDeviceCaps( nHwnd, 88)
= ReleaseDC(0, nHwnd)
CLEAR DLLS "GetWindowDC","GetDeviceCaps","ReleaseDC"
lLgFont = .f.
IF nSize > 100
lLgFont = .t.
And have all affected items resized if lLgFont = true
BTW - I set lLgFont global.
On Sun, 9 Jan 2005 19:53:02 -0600, "David Frankenbach"
<sendnospam (AT) sendnospam (DOT) net> wrote: