dbTalk Databases Forums  

VFP 6: Large and Small Fonts

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 6: Large and Small Fonts in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default 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
scaling factor?

Sincerely,

Gene Wirchenko


Reply With Quote
  #2  
Old   
Rick Bean
 
Posts: n/a

Default Re: VFP 6: Large and Small Fonts - 01-07-2005 , 01:50 PM






Gene,
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!

Rick

"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote

Quote:
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
scaling factor?

Sincerely,

Gene Wirchenko


Reply With Quote
  #3  
Old   
Cy Welch
 
Posts: n/a

Default Re: VFP 6: Large and Small Fonts - 01-07-2005 , 04:45 PM



Rick Bean wrote:
Quote:
Gene,
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!

Rick

"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote


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
scaling factor?

Sincerely,

Gene Wirchenko

Also using a bitmap font may cause a problem like that. I found that
for me the cure is to use Arial for the font unless I need monospace in
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
displays.

--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com


Reply With Quote
  #4  
Old   
Gene Wirchenko
 
Posts: n/a

Default 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:

Quote:
"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote

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
scaling factor?

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!

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.

Sincerely,

Gene Wirchenko



Reply With Quote
  #5  
Old   
Rick Bean
 
Posts: n/a

Default Re: VFP 6: Large and Small Fonts - 01-07-2005 , 06:48 PM



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 = 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()

*** 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)
ELSE
lcRetVal = "(Error)"
ENDIF

RELEASE oReg
RELEASE PROC (m.lcRegfile)

RETURN lcRetVal

Rick

"Gene Wirchenko" <genew (AT) ucantrade (DOT) com.NOTHERE> wrote

Quote:
[reordered to chronological]

On Fri, 7 Jan 2005 14:50:38 -0500, "Rick Bean"
rgbean (AT) unrealmelange-inc (DOT) com> wrote:

"Gene Wirchenko >" <Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote

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
scaling factor?

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!

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.

Sincerely,

Gene Wirchenko


Reply With Quote
  #6  
Old   
David Frankenbach
 
Posts: n/a

Default Re: VFP 6: Large and Small Fonts - 01-09-2005 , 07:53 PM



Gene,

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...
Quote:
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
scaling factor?



Reply With Quote
  #7  
Old   
Techo Guy
 
Posts: n/a

Default 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.
ENDIF

And have all affected items resized if lLgFont = true

BTW - I set lLgFont global.

Techo Guy

On Sun, 9 Jan 2005 19:53:02 -0600, "David Frankenbach"
<sendnospam (AT) sendnospam (DOT) net> wrote:

Quote:
Gene,

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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.