--- a/WinWorkstation.st Thu Feb 19 10:52:57 2009 +0100
+++ b/WinWorkstation.st Thu Feb 19 10:53:04 2009 +0100
@@ -12458,13 +12458,13 @@
pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
fntDescr := FontDescription
- family:family
- face:face
- style:style
- size:pointSize
- sizeUnit:#pt
- encoding:encoding.
- fntDescr pixelSize:logicalSize.
+ family:family
+ face:face
+ style:style
+ size:pointSize
+ sizeUnit:#pt
+ encoding:encoding.
+ fntDescr setPixelSize:logicalSize.
^ fntDescr.
!
@@ -12640,8 +12640,8 @@
!
getFontWithFoundry:foundry family:family weight:weight
- slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
- registry:registry encoding:encoding
+ slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
+ registry:registry encoding:encoding
"get the specified font, if not available, return nil.
For now, this is a poor (incomplete) emulation of the X code ...
@@ -12661,45 +12661,45 @@
"
Windows-NT/95 allows the creation of a font with the following parameters
- nHeight
- nWidth
- nEscapement
- nOrientation
- fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
- fdwItalic TRUE or FALSE
- fdwUnderline TRUE or FALSE
- fdwStrikeOut TRUE or FALSE
- fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
- fdwOutputPrecision DEFAULT, STRING, CHAR, ...
- fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ...
- fdwQuality DEFAULT, DRAFT, or PROOF.
- fdwPitchAndFamily
- DEFAULT, FIXED or VARIABLE pitch
- DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
- lpszFace
- Typeface Name
+ nHeight
+ nWidth
+ nEscapement
+ nOrientation
+ fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
+ fdwItalic TRUE or FALSE
+ fdwUnderline TRUE or FALSE
+ fdwStrikeOut TRUE or FALSE
+ fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
+ fdwOutputPrecision DEFAULT, STRING, CHAR, ...
+ fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ...
+ fdwQuality DEFAULT, DRAFT, or PROOF.
+ fdwPitchAndFamily
+ DEFAULT, FIXED or VARIABLE pitch
+ DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
+ lpszFace
+ Typeface Name
These two above descriptions will be matched as follows:
- foundry - ignored
- family - mapped to type face name.
- weight - mapped to fnWeight
- slant - used for style
- spacing - NOT USED INITIALLY
- pixelSize - NOT USED INITIALLY
- size - mapped to nHeight
- registry - NOT USED INITIALLY
- encoding - mapped to fdwCharSet
+ foundry - ignored
+ family - mapped to type face name.
+ weight - mapped to fnWeight
+ slant - used for style
+ spacing - NOT USED INITIALLY
+ pixelSize - NOT USED INITIALLY
+ size - mapped to nHeight
+ registry - NOT USED INITIALLY
+ encoding - mapped to fdwCharSet
"
|logSize heightIsCellHeight|
pixelSizeOrNil notNil ifTrue:[
- logSize := pixelSizeOrNil.
- heightIsCellHeight := true.
+ logSize := pixelSizeOrNil.
+ heightIsCellHeight := true.
] ifFalse:[
- logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
- heightIsCellHeight := false.
+ logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
+ heightIsCellHeight := false.
].
%{
HGDIOBJ hFont;
@@ -12734,154 +12734,154 @@
fdwCharSet = ANSI_CHARSET;
if ((encoding == @symbol('ms-ansi'))) {
- fdwCharSet = ANSI_CHARSET;
+ fdwCharSet = ANSI_CHARSET;
} else if (encoding == @symbol('ms-default')) {
- fdwCharSet = DEFAULT_CHARSET;
+ fdwCharSet = DEFAULT_CHARSET;
} else if ((encoding == @symbol('ms-symbol'))
- || (encoding == @symbol('misc-fontspecific'))) {
- fdwCharSet = SYMBOL_CHARSET;
+ || (encoding == @symbol('misc-fontspecific'))) {
+ fdwCharSet = SYMBOL_CHARSET;
} else if ((encoding == @symbol('ms-shiftjis'))
- || (encoding == @symbol('jisx0208.1983-0'))){
- fdwCharSet = SHIFTJIS_CHARSET;
+ || (encoding == @symbol('jisx0208.1983-0'))){
+ fdwCharSet = SHIFTJIS_CHARSET;
} else if ((encoding == @symbol('ms-gb2312'))
- || (encoding == @symbol('gb2312.1980-0'))) {
- fdwCharSet = GB2312_CHARSET;
+ || (encoding == @symbol('gb2312.1980-0'))) {
+ fdwCharSet = GB2312_CHARSET;
} else if ((encoding == @symbol('ms-hangeul'))
- || (encoding == @symbol('ksc5601.1987-0'))) {
- fdwCharSet = HANGEUL_CHARSET;
+ || (encoding == @symbol('ksc5601.1987-0'))) {
+ fdwCharSet = HANGEUL_CHARSET;
} else if ((encoding == @symbol('ms-chinesebig5'))
- || (encoding == @symbol('big5'))) {
- fdwCharSet = CHINESEBIG5_CHARSET;
+ || (encoding == @symbol('big5'))) {
+ fdwCharSet = CHINESEBIG5_CHARSET;
} else if (encoding == @symbol('ms-oem')) {
- fdwCharSet = OEM_CHARSET;
+ fdwCharSet = OEM_CHARSET;
} else if (encoding == @symbol('ms-johab')) {
- fdwCharSet = JOHAB_CHARSET;
+ fdwCharSet = JOHAB_CHARSET;
} else if ((encoding == @symbol('ms-hebrew'))
- || (encoding == @symbol('ms-cp1255'))) {
- fdwCharSet = HEBREW_CHARSET;
+ || (encoding == @symbol('ms-cp1255'))) {
+ fdwCharSet = HEBREW_CHARSET;
} else if ((encoding == @symbol('ms-arabic'))
- || (encoding == @symbol('ms-cp1256'))) {
- fdwCharSet = ARABIC_CHARSET;
+ || (encoding == @symbol('ms-cp1256'))) {
+ fdwCharSet = ARABIC_CHARSET;
} else if ((encoding == @symbol('ms-greek'))
- || (encoding == @symbol('ms-cp1253'))) {
- fdwCharSet = GREEK_CHARSET;
+ || (encoding == @symbol('ms-cp1253'))) {
+ fdwCharSet = GREEK_CHARSET;
} else if ((encoding == @symbol('ms-turkish'))
- || (encoding == @symbol('ms-cp1254'))) {
- fdwCharSet = TURKISH_CHARSET;
+ || (encoding == @symbol('ms-cp1254'))) {
+ fdwCharSet = TURKISH_CHARSET;
} else if ((encoding == @symbol('ms-russian'))
- || (encoding == @symbol('ms-cp1251'))) {
- fdwCharSet = RUSSIAN_CHARSET;
+ || (encoding == @symbol('ms-cp1251'))) {
+ fdwCharSet = RUSSIAN_CHARSET;
} else if ((encoding == @symbol('ms-easteurope'))
- || (encoding == @symbol('ms-cp1250'))) {
- fdwCharSet = EASTEUROPE_CHARSET;
+ || (encoding == @symbol('ms-cp1250'))) {
+ fdwCharSet = EASTEUROPE_CHARSET;
} else if ((encoding == @symbol('ms-baltic'))
- || (encoding == @symbol('ms-cp1257'))) {
- fdwCharSet = BALTIC_CHARSET;
+ || (encoding == @symbol('ms-cp1257'))) {
+ fdwCharSet = BALTIC_CHARSET;
} else if ((encoding == @symbol('ms-vietnamese'))) {
- fdwCharSet = VIETNAMESE_CHARSET;
+ fdwCharSet = VIETNAMESE_CHARSET;
} else if ((encoding == @symbol('ms-thai'))) {
- fdwCharSet = THAI_CHARSET;
+ fdwCharSet = THAI_CHARSET;
} else if ((encoding == @symbol('ms-mac'))) {
- fdwCharSet = MAC_CHARSET;
+ fdwCharSet = MAC_CHARSET;
#ifdef UNICODE_CHARSET
} else if ((encoding == @symbol('ms-unicode'))) {
- fdwCharSet = UNICODE_CHARSET;
+ fdwCharSet = UNICODE_CHARSET;
#endif
}
if ( __isString( family ) ) {
- work = __stringVal( family );
- if (strcmp( work, "nil" ) != 0 ) {
- strncpy( faceName, work, sizeof(faceName)-1 );
- }
+ work = __stringVal( family );
+ if (strcmp( work, "nil" ) != 0 ) {
+ strncpy( faceName, work, sizeof(faceName)-1 );
+ }
}
/* Q: should we allow those ? (they make ST/X programs less portable to X */
if( __isString( weight ) ) {
- work = __stringVal( weight );
- if (strcmp( work, "bold" ) == 0 ) {
- fnWeight = FW_BOLD;
- } else if (strcmp( work, "medium" ) == 0 ) {
- fnWeight = FW_MEDIUM;
- } else if (strcmp( work, "normal" ) == 0 ) {
- fnWeight = FW_NORMAL;
- } else if (strcmp( work, "light" ) == 0 ) {
- fnWeight = FW_LIGHT;
- } else if (strcmp( work, "demi" ) == 0 ) {
- fnWeight = FW_LIGHT;
- } else if (strcmp( work, "heavy" ) == 0 ) {
- fnWeight = FW_HEAVY;
- } else if (strcmp( work, "extraBold" ) == 0 ) {
- fnWeight = FW_EXTRABOLD;
- } else if (strcmp( work, "semiBold" ) == 0 ) {
- fnWeight = FW_SEMIBOLD;
- } else if (strcmp( work, "thin" ) == 0 ) {
- fnWeight = FW_THIN;
- } else if (strcmp( work, "extraLight" ) == 0 ) {
- fnWeight = FW_EXTRALIGHT;
- }
+ work = __stringVal( weight );
+ if (strcmp( work, "bold" ) == 0 ) {
+ fnWeight = FW_BOLD;
+ } else if (strcmp( work, "medium" ) == 0 ) {
+ fnWeight = FW_MEDIUM;
+ } else if (strcmp( work, "normal" ) == 0 ) {
+ fnWeight = FW_NORMAL;
+ } else if (strcmp( work, "light" ) == 0 ) {
+ fnWeight = FW_LIGHT;
+ } else if (strcmp( work, "demi" ) == 0 ) {
+ fnWeight = FW_LIGHT;
+ } else if (strcmp( work, "heavy" ) == 0 ) {
+ fnWeight = FW_HEAVY;
+ } else if (strcmp( work, "extraBold" ) == 0 ) {
+ fnWeight = FW_EXTRABOLD;
+ } else if (strcmp( work, "semiBold" ) == 0 ) {
+ fnWeight = FW_SEMIBOLD;
+ } else if (strcmp( work, "thin" ) == 0 ) {
+ fnWeight = FW_THIN;
+ } else if (strcmp( work, "extraLight" ) == 0 ) {
+ fnWeight = FW_EXTRALIGHT;
+ }
} else if (__isSmallInteger(weight)) {
- fnWeight = __intVal(weight);
+ fnWeight = __intVal(weight);
}
if(__isSmallInteger( logSize )) {
- nHeight = __intVal( logSize );
+ nHeight = __intVal( logSize );
}
if (__isString(slant)) {
- work2 = __stringVal( slant );
- work = __stringVal( slant );
-
- if (strncmp(work2, "italic", 6) == 0) {
- fdwItalic = TRUE;
- if ( work2[6] == '-' )
- strncpy( work, &work2[7], ( strlen( work2) - 7) );
- } else {
- if (strncmp(work2, "oblique", 7) == 0) {
- fdwItalic = TRUE;
- if ( work2[7] == '-' )
- strncpy( work, &work2[8], ( strlen( work2) - 8) );
- }
- }
- if (strncmp( work, "underline", 9 ) == 0 ) {
- fdwUnderline = TRUE;
- if( work[10] == '-' )
- strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
- }
- if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
- fdwStrikeOut = TRUE;
- }
+ work2 = __stringVal( slant );
+ work = __stringVal( slant );
+
+ if (strncmp(work2, "italic", 6) == 0) {
+ fdwItalic = TRUE;
+ if ( work2[6] == '-' )
+ strncpy( work, &work2[7], ( strlen( work2) - 7) );
+ } else {
+ if (strncmp(work2, "oblique", 7) == 0) {
+ fdwItalic = TRUE;
+ if ( work2[7] == '-' )
+ strncpy( work, &work2[8], ( strlen( work2) - 8) );
+ }
+ }
+ if (strncmp( work, "underline", 9 ) == 0 ) {
+ fdwUnderline = TRUE;
+ if( work[10] == '-' )
+ strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
+ }
+ if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
+ fdwStrikeOut = TRUE;
+ }
}
DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n",
- faceName, nHeight, nWidth, fnWeight));
+ faceName, nHeight, nWidth, fnWeight));
hFont = CreateFont(
- (
- (heightIsCellHeight == true) ?
- nHeight : -nHeight /* positive:cell height; negative:character height */
- ),
- nWidth,
- nEscapement,
- nOrientation,
- fnWeight,
- fdwItalic,
- fdwUnderline,
- fdwStrikeOut,
- fdwCharSet,
- fdwOutputPrecision,
- fdwClipPrecision,
- fdwQuality,
- fdwPitchAndFamily,
- faceName );
+ (
+ (heightIsCellHeight == true) ?
+ nHeight : -nHeight /* positive:cell height; negative:character height */
+ ),
+ nWidth,
+ nEscapement,
+ nOrientation,
+ fnWeight,
+ fdwItalic,
+ fdwUnderline,
+ fdwStrikeOut,
+ fdwCharSet,
+ fdwOutputPrecision,
+ fdwClipPrecision,
+ fdwQuality,
+ fdwPitchAndFamily,
+ faceName );
if (hFont != NULL) {
- DPRINTF(("createFont: %x\n", hFont));
+ DPRINTF(("createFont: %x\n", hFont));
#ifdef COUNT_RESOURCES
- __cnt_font++;
- RES1PRINTF(("CreateFont %d\n", __cnt_font));
-#endif
- RETURN ( __MKOBJ(hFont) );
+ __cnt_font++;
+ RES1PRINTF(("CreateFont %d\n", __cnt_font));
+#endif
+ RETURN ( __MKOBJ(hFont) );
}
DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
@@ -12890,14 +12890,14 @@
"
Display getFontWithFoundry:'*'
- family:'courier'
- weight:'medium'
- slant:'r'
- spacing:nil
- pixelSize:nil
- size:13
- registry:'iso8859'
- encoding:'*'
+ family:'courier'
+ weight:'medium'
+ slant:'r'
+ spacing:nil
+ pixelSize:nil
+ size:13
+ registry:'iso8859'
+ encoding:'*'
"
"new NT Version: 20.2.1997 / 22:33:29 / dq"
@@ -18187,7 +18187,7 @@
!WinWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.386 2009-02-18 18:05:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.387 2009-02-19 09:53:04 cg Exp $'
! !
WinWorkstation initialize!