FAQ : Platform Support (Linux, Windows) : Q: How can I find out the scaling factor of my User Interface Components?
Q: How can I find out the scaling factor of my User Interface Components?
HiDPI awareness was introduced in VAST 9.2. The standard VA Smalltalk User Interface Components were reworked to be scalable.
Note:
In VAST 10.0.0, the pertinent information about the scaling factors active in the image can be written to the Transcript by choosing the “System configuration Report: menu items in the Transcript Help menu.
The following Smalltalk expression prints to the Transcript all pertinent information about the scaling factors active in the image.
" HiDPI settings report script "
Transcript
cr; nextPutAll: '-------------------------------------';
cr; nextPutAll: 'HiDPI System Information Report:';
cr; nextPutAll: '-------------------------------------';
cr; nextPutAll: 'VA Smalltalk Version: ', System imageVersionDottedId;
cr; nextPutAll: 'OS Version: ', EsSystemInfo osVersion ;
cr; nextPutAll: 'Screen Resolution: ',
(PlatformGlobals::OS getSystemMetrics:
PlatformConstants::SmCxscreen) printString ,
' x ',
(PlatformGlobals::OS getSystemMetrics:
PlatformConstants::SmCyscreen) printString.
( CgDisplay class includesSelector: #widgetFontName )
ifTrue: [
Transcript
cr; nextPutAll: 'Active DPIScaler Class: ',
(Smalltalk classAt: #DPIScaler) instance class name asString ;
cr; nextPutAll: 'Active Scale Factor: ',
((Smalltalk classAt: #DPIScaler) getDeviceZoom: nil) printString ;
cr; nextPutAll: 'Device Scale Factor: ',
((Smalltalk classAt: #DPIScaler) getDeviceScaleFactor:
((Smalltalk classAt: #DPIScaler) defaultAutoScaleContext)) printString ;
cr; nextPutAll: 'CgDisplay Widget Font Name:';
cr; tab; tab; nextPutAll: CgDisplay widgetFontName.
( (System image subsystemType: #OS) = 'WIN32s' )
ifTrue: [
( CgDisplay widgetFontName = CgDisplay pre92SystemEquivalentFontName )
ifTrue: [
Transcript cr; tab; tab;
nextPutAll: '(Pre-9.2 scalable font name)' ]
ifFalse: [
( CgDisplay widgetFontName = CgDisplay getDefaultFontNameFromOS )
ifTrue: [ Transcript cr; tab; tab;
nextPutAll: '(New 9.2 default font name)'
]
]
]
]
ifFalse: [
Transcript
cr; nextPutAll: 'Active DPIScaler Class: n/a';
cr; nextPutAll: 'Active Scale Factor: n/a';
cr; nextPutAll: 'System default font: ';
cr; tab; tab;
nextPutAll:
((CgDisplay default defaultFont serverResource info props at: 1)
asString).
].
 
Here is sample output from the expression
 
-------------------------------------
HiDPI System Information Report:
-------------------------------------
VA Smalltalk Version: 9.2.1
OS Version: 10.0 build 18362
Screen Resolution: 1398 x 748
Active DPIScaler Class: DPIScalerWin10
Active Scale Factor: 100
Device Scale Factor: (96/96)
CgDisplay Widget Font Name:
-microsoft-segoe ui-medium-r-normal-sans serif-13-100-96-96-p-0-iso8859-1
(New 9.2 default font name)
If you want Instantiations to assist you in troubleshooting the display of your VA Smalltalk User Interface components, send this information along with the components which are inadequately displaying to Instantiations support.
Last modified date: 02/24/2021