Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12169 > unrolled thread

Text scaling in Windows

Started byFranz Rachbauer <office@rachbauer.org>
First post2019-01-18 06:59 +0100
Last post2019-01-18 10:23 -0800
Articles 6 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Text scaling in Windows Franz Rachbauer <office@rachbauer.org> - 2019-01-18 06:59 +0100
    Re: Text scaling in Windows Sherlock <sherlock@sherlock.com.au> - 2019-01-18 01:41 -0800
      Re: Text scaling in Windows Franz Rachbauer <office@rachbauer.org> - 2019-01-21 09:57 +0100
        Re: Text scaling in Windows Franz Rachbauer <office@rachbauer.org> - 2019-01-21 13:02 +0100
          Re: Text scaling in Windows Sherlock <sherlock@sherlock.com.au> - 2019-01-21 06:07 -0800
    Re: Text scaling in Windows "Jean3Riv@gmail.com" <jean3riv@gmail.com> - 2019-01-18 10:23 -0800

#12169 — Text scaling in Windows

FromFranz Rachbauer <office@rachbauer.org>
Date2019-01-18 06:59 +0100
SubjectText scaling in Windows
Message-ID<q1rq0t$1qpq$1@gioia.aioe.org>
Hi there,
does anyone know how to detect the users font size setting (100%, 125%, 
150%, ...) with VO 2.8?

Regards, Franz

[toc] | [next] | [standalone]


#12170

FromSherlock <sherlock@sherlock.com.au>
Date2019-01-18 01:41 -0800
Message-ID<f10bc54e-33fa-46cb-9a1c-8a3a2d618401@googlegroups.com>
In reply to#12169
METHOD PDBCheckWinFontDPI() AS LOGIC  PASCAL CLASS _DIAGNOSTIC_TESTS

	LOCAL iFontDPI 		AS INT
	LOCAL cMessage 	AS STRING
	LOCAL lOK := TRUE	AS LOGIC
	LOCAL hDC 			AS PTR

	// Check the FONT size and advise user..  Sherlock needs 96 DPI font settings.
	hDC := GetDC(NULL_PTR)
	iFontDPI := GetDeviceCaps(hDC, LOGPIXELSX)
	ReleaseDC(NULL_PTR, hDC)
	//
	IF iFontDPI != 96
		cMessage := "Your Windows font size IS NOT the standard 96 dpi (small fonts)." + CRLF
		cMessage += "'Sherlock' is not designed to be used with other large font settings." + CRLF
		cMessage += "The FONT setting is currently set for [" + AsString( iFontDPI ) + "] DPI" + CRLF
		cMessage += "Reset font size Windows-settings (Desktop properties) / Advanced button"
		InfoBox{SELF, "Warning", cMessage}:Show()
		lOK := FALSE           		// Not .. fontsize 96
	ELSE
		cMessage := "Your Windows font size is set for 96 dpi (small fonts)." + CRLF + ;
			"There is the standard setting and presents no problems."
		InfoBox{SELF, "Warning", cMessage}:Show()
	ENDIF
	//
	RETURN lOK

[toc] | [prev] | [next] | [standalone]


#12172

FromFranz Rachbauer <office@rachbauer.org>
Date2019-01-21 09:57 +0100
Message-ID<q241gu$1mka$1@gioia.aioe.org>
In reply to#12170
Hi Sherlock,
thank you very much, that is exactly what I need!
Regards, Franz

Am 18.01.2019 um 10:41 schrieb Sherlock:
> METHOD PDBCheckWinFontDPI() AS LOGIC  PASCAL CLASS _DIAGNOSTIC_TESTS
> 
> 	LOCAL iFontDPI 		AS INT
> 	LOCAL cMessage 	AS STRING
> 	LOCAL lOK := TRUE	AS LOGIC
> 	LOCAL hDC 			AS PTR
> 
> 	// Check the FONT size and advise user..  Sherlock needs 96 DPI font settings.
> 	hDC := GetDC(NULL_PTR)
> 	iFontDPI := GetDeviceCaps(hDC, LOGPIXELSX)
> 	ReleaseDC(NULL_PTR, hDC)
> 	//
> 	IF iFontDPI != 96
> 		cMessage := "Your Windows font size IS NOT the standard 96 dpi (small fonts)." + CRLF
> 		cMessage += "'Sherlock' is not designed to be used with other large font settings." + CRLF
> 		cMessage += "The FONT setting is currently set for [" + AsString( iFontDPI ) + "] DPI" + CRLF
> 		cMessage += "Reset font size Windows-settings (Desktop properties) / Advanced button"
> 		InfoBox{SELF, "Warning", cMessage}:Show()
> 		lOK := FALSE           		// Not .. fontsize 96
> 	ELSE
> 		cMessage := "Your Windows font size is set for 96 dpi (small fonts)." + CRLF + ;
> 			"There is the standard setting and presents no problems."
> 		InfoBox{SELF, "Warning", cMessage}:Show()
> 	ENDIF
> 	//
> 	RETURN lOK

[toc] | [prev] | [next] | [standalone]


#12173

FromFranz Rachbauer <office@rachbauer.org>
Date2019-01-21 13:02 +0100
Message-ID<q24cc8$18n8$1@gioia.aioe.org>
In reply to#12172
Hi Sherlock,
one last question: Is it reliable that 96dpi corresponds to 100% in alle 
Win versions from XP to W10?

Franz

[toc] | [prev] | [next] | [standalone]


#12174

FromSherlock <sherlock@sherlock.com.au>
Date2019-01-21 06:07 -0800
Message-ID<19272cd4-8533-453c-94b0-0db3cc1ac1d0@googlegroups.com>
In reply to#12173
On Monday, January 21, 2019 at 11:02:18 PM UTC+11, Franz Rachbauer wrote:
> Hi Sherlock,
> one last question: Is it reliable that 96dpi corresponds to 100% in alle 
> Win versions from XP to W10?
> 
> Franz

YES....  what I have seen consistently.
When they change the scaling messes up my menus

[toc] | [prev] | [next] | [standalone]


#12171

From"Jean3Riv@gmail.com" <jean3riv@gmail.com>
Date2019-01-18 10:23 -0800
Message-ID<44391243-5541-44d8-b047-af8bc75e1da2@googlegroups.com>
In reply to#12169
On Friday, January 18, 2019 at 12:59:58 AM UTC-5, Franz Rachbauer wrote:
> Hi there,
> does anyone know how to detect the users font size setting (100%, 125%, 
> 150%, ...) with VO 2.8?
> 
> Regards, Franz

The following may help you... I hope

This function retreives the default font name and size of the WINDOWS MENUS

Normally the default is "Segoe UI" with the size of 9pt ( I think )

From there you can tell your application to set the same font as windows
for browser display, dialogs, text etc...

Take a look at [Advanced System Font Changer]
https://www.wintools.info/index.php?start=10

I have set my windows 10 to 10pt (I am little blind)

Best regards

Jean Raymond
https://rayonline.com/cmVodbx32.html



//------------------------------------------------------------------
METHOD Start() CLASS cApp   //App for CAVO
local aFont  AS ARRAY

   aFont:= GetDefaultMenuWindowsSystFonts ()  
   cSystFontName:=aFont[1]   //this var as global
   fSystFontSize:= aFont[2]  //this var as global

return self

//-------------------------------------------------------------------
FUNCTION  GetDefaultMenuWindowsSystFonts () AS ARRAY PASCAL

	LOCAL  sWinFont IS _winNONCLIENTMETRICS 
	LOCAL aReturn:={} AS ARRAY    
	LOCAL hDeviceContext  AS PTR 
	LOCAL nPoints					AS FLOAT
	LOCAL cFontName AS STRING  
	//LOCAL oFont AS cFont
	
	             
   //Getting windows sys font default 
	sWinFont.cbSize:=_SIZEOF( _winNONCLIENTMETRICS)      
	SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0 , @sWinFont , 0 )  
	
	cFontName:=Psz2String(@sWinFont.lfMenuFont.lfFaceName[1])  
	AAdd(aReturn,cFontName)
	
   //Getting Size of font 
	hDeviceContext:=GetDC(NULL_PTR)   
 	nPoints := -MulDiv(sWinFont.lfMenuFont.lfHeight, 72, GetDeviceCaps(hDeviceContext,LOGPIXELSY) )    
	ReleaseDC(NULL_PTR,hDeviceContext)
	AAdd(aReturn,nPoints)
	
	//oFont:=cFont{,nPoints,cFontName}
	
	
	
	RETURN    aReturn
//---------------------------------------------------------------------------------

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web