--- a/XWorkstation.st Thu Jun 28 11:00:19 2001 +0200
+++ b/XWorkstation.st Wed Jul 18 14:47:54 2001 +0200
@@ -7436,7 +7436,7 @@
!
getFontWithFamily:familyString face:faceString
- style:styleArgString size:sizeArg encoding:encoding
+ style:styleArgString size:sizeArg encoding:encoding
"try to get the specified font, if not available, try next smaller
font. Access to X-fonts by name is possible, by passing the X font name
@@ -7450,22 +7450,22 @@
"special: if face is nil, allow access to X-fonts"
faceString isNil ifTrue:[
- sizeArg notNil ifTrue:[
- theName := familyString , '-' , sizeArg printString
- ] ifFalse:[
- theName := familyString
- ].
- theName isNil ifTrue:[
- "
- mhmh - fall back to the default font
- "
- theName := 'fixed'
- ].
- theId := self createFontFor:theName.
- theId isNil ifTrue:[
- theId := self getDefaultFont
- ].
- ^ theId
+ sizeArg notNil ifTrue:[
+ theName := familyString , '-' , sizeArg printString
+ ] ifFalse:[
+ theName := familyString
+ ].
+ theName isNil ifTrue:[
+ "
+ mhmh - fall back to the default font
+ "
+ theName := 'fixed'
+ ].
+ theId := self createFontFor:theName.
+ theId isNil ifTrue:[
+ theId := self getDefaultFont
+ ].
+ ^ theId
].
"/ spacing other than 'normal' is contained as last component
@@ -7473,71 +7473,72 @@
(styleString notNil
and:[(styleString endsWith:'-narrow')
- or:[styleString endsWith:'-semicondensed']]) ifTrue:[
- |i|
- i := styleString lastIndexOf:$-.
- spacing := styleString copyFrom:(i+1).
- styleString := styleString copyTo:(i-1).
+ or:[styleString endsWith:'-semicondensed']]) ifTrue:[
+ |i|
+ i := styleString lastIndexOf:$-.
+ spacing := styleString copyFrom:(i+1).
+ styleString := styleString copyTo:(i-1).
] ifFalse:[
- spacing := 'normal'.
+ spacing := 'normal'.
].
xlatedStyle := styleString.
xlatedStyle notNil ifTrue:[
- xlatedStyle := xlatedStyle first asString
- ].
-
- encodingMatch := encoding.
+ xlatedStyle := xlatedStyle first asString
+ ].
+
registryMatch := '*'.
encoding isNil ifTrue:[
- encodingMatch := '*'.
+ encodingMatch := '*'.
] ifFalse:[
- idx := encoding indexOf:$-.
- idx ~~ 0 ifTrue:[
- encodingMatch := encoding copyTo:idx - 1.
- registryMatch := encoding copyFrom:idx + 1
- ].
+ idx := encoding indexOf:$-.
+ idx ~~ 0 ifTrue:[
+ registryMatch := encoding copyTo:idx - 1.
+ encodingMatch := encoding copyFrom:idx + 1
+ ] ifFalse:[
+ registryMatch := encoding.
+ ].
].
id := self
- getFontWithFoundry:'*'
- family:familyString asLowercase
- weight:faceString
- slant:xlatedStyle
- spacing:spacing
- pixelSize:nil
- size:sizeArg
- registry:encodingMatch
- encoding:registryMatch.
+ getFontWithFoundry:'*'
+ family:familyString asLowercase
+ weight:faceString
+ slant:xlatedStyle
+ spacing:spacing
+ pixelSize:nil
+ size:sizeArg
+ registry:registryMatch
+ encoding:encodingMatch.
id isNil ifTrue:[
- (encodingMatch notNil and:[encodingMatch ~= '*']) ifTrue:[
- "/ too stupid: encodings come in both cases
- "/ and X does not ignore case
- "/
- id := self
- getFontWithFoundry:'*'
- family:familyString asLowercase
- weight:faceString
- slant:xlatedStyle
- spacing:spacing
- pixelSize:nil
- size:sizeArg
- registry:encodingMatch asUppercase
- encoding:registryMatch.
- id isNil ifTrue:[
- id := self
- getFontWithFoundry:'*'
- family:familyString asLowercase
- weight:faceString
- slant:xlatedStyle
- spacing:spacing
- pixelSize:nil
- size:sizeArg
- registry:encodingMatch asLowercase
- encoding:registryMatch.
- ]
- ]
+ (registryMatch notNil and:[registryMatch ~= '*']) ifTrue:[
+ "/ too stupid: registries come in both cases
+ "/ and X does not ignore case
+ "/
+ id := self
+ getFontWithFoundry:'*'
+ family:familyString asLowercase
+ weight:faceString
+ slant:xlatedStyle
+ spacing:spacing
+ pixelSize:nil
+ size:sizeArg
+ registry:registryMatch asUppercase
+ encoding:encodingMatch.
+ id isNil ifTrue:[
+ id := self
+ getFontWithFoundry:'*'
+ family:familyString asLowercase
+ weight:faceString
+ slant:xlatedStyle
+ spacing:spacing
+ pixelSize:nil
+ size:sizeArg
+ registry:registryMatch asLowercase
+ encoding:encodingMatch.
+ ]
+ ]
].
^ id
@@ -11569,6 +11570,6 @@
!XWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.388 2001-05-08 09:23:41 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.389 2001-07-18 12:47:54 stefan Exp $'
! !
XWorkstation initialize!