--- a/WinWorkstation.st Fri Jan 30 10:58:33 2004 +0100
+++ b/WinWorkstation.st Fri Jan 30 11:34:54 2004 +0100
@@ -10877,24 +10877,24 @@
!
fontDescriptionFromLogicalFontInfoArray:anInfoArray
- | fntDescr family face style size encoding |
+ |fntDescr family face style logicalSize pointSize encoding|
family := anInfoArray at:14.
face := anInfoArray at:5.
style := anInfoArray at:16.
- size := anInfoArray at:1.
+ logicalSize := anInfoArray at:1.
encoding := anInfoArray at:15.
- size := size abs.
- "/ convert from device to point size.
- size := (size / 96 "self verticalPixelPerInch" * 72) ceiling.
+ logicalSize := logicalSize abs.
+ "/ convert from device to point size
+ pointSize := (logicalSize / self getLogicalPixelSizeY * 72) ceiling.
fntDescr := FontDescription
- family:family
- face:face
- style:style
- size:size
- encoding:encoding.
+ family:family
+ face:face
+ style:style
+ size:pointSize
+ encoding:encoding.
^ fntDescr.
!
@@ -11140,7 +11140,7 @@
%{
HGDIOBJ hFont;
- int nHeight, nWidth, nEscapement, nOrientation;
+ int pointSize, nHeight, nWidth, nEscapement, nOrientation;
char* work;
char* work2;
DWORD fnWeight;
@@ -11159,7 +11159,8 @@
strcpy( temp, " " );
lpszFace = &temp[0];
strcpy( (char *)lpszFace, "NULL" );
- nHeight = 0;
+ pointSize = 0;
+ nHeight = 0;
nWidth = 0;
nEscapement = 0;
nOrientation = 0;
@@ -11197,7 +11198,7 @@
}
if(__isSmallInteger( size )) {
- nHeight = __intVal( size );
+ pointSize = __intVal( size );
}
if (__isString(slant)) {
@@ -11225,7 +11226,7 @@
}
}
- nHeight = -MulDiv(nHeight, __logPixelSY, 72);
+ nHeight = -MulDiv(pointSize, __logPixelSY, 72);
DPRINTF(("CreateFont face:%s h=%d\n", lpszFace, nHeight));
hFont = CreateFont( nHeight,
@@ -11271,6 +11272,12 @@
"new NT Version: 20.2.1997 / 22:33:29 / dq"
!
+getLogicalPixelSizeY
+%{
+ RETURN( __MKSMALLINT(__logPixelSY) );
+%}
+!
+
listOfAvailableFonts
"return a list with all available fonts on this display.
Since this takes a long time, keep the result of the query for the
@@ -15588,7 +15595,7 @@
!WinWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.240 2004-01-30 09:58:33 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.241 2004-01-30 10:34:54 ca Exp $'
! !
WinWorkstation initialize!
--- a/styles/mswindows95.common Fri Jan 30 10:58:33 2004 +0100
+++ b/styles/mswindows95.common Fri Jan 30 11:34:54 2004 +0100
@@ -1,5 +1,5 @@
;
-; $Header: /cvs/stx/stx/libview/styles/mswindows95.common,v 1.4 2004-01-29 21:51:40 ca Exp $
+; $Header: /cvs/stx/stx/libview/styles/mswindows95.common,v 1.5 2004-01-30 10:34:54 ca Exp $
;
is3D true
@@ -51,6 +51,18 @@
; font Font name:'ANSI_VAR_FONT'
; #endif
+#if (Screen current platformName = 'WIN32')
+font ((Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS) at:#messageFont) onDevice:Screen current
+menu.font ((Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS) at:#menuFont) onDevice:Screen current
+activeHelp.font ((Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS) at:#statusFont) onDevice:Screen current
+#else
+font Font family:'helvetica' face:'medium' style:'roman' size:12
+menu.font =font
+activeHelp.font =font
+#endif
+
+button.font =font
+
focus.showBorder false
focus.takeOnClick true
@@ -85,7 +97,8 @@
menu.buttonPassiveLevel 0
menu.buttonActiveLevel -1
menu.buttonItemSpace 2
-menu.font =font
+
+menu.itemSpace 5
pullDownMenu.separatingLines false
;; pullDownMenu.level 0
@@ -223,7 +236,6 @@
activeHelp.backgroundColor Color yellow lightened lightened lightened
activeHelp.borderWidth 1
-activeHelp.font Font family:'helvetica' face:'medium' style:'roman' size:12
;
; if running under windows, use the systemColor settings
@@ -260,8 +272,3 @@
warningBox.iconFile 'bitmaps/Warning_w95.xpm'
requestBox.iconFile 'bitmaps/Request_w95.xpm'
errorBox.iconFile 'bitmaps/Error_w95.xpm'
-
-#if (Screen current platformName = 'WIN32')
-menu.font ((Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS) at:#menuFont) onDevice:Screen current
-activeHelp.font ((Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS) at:#statusFont) onDevice:Screen current
-#endif