fixes for pixel-sized fonts
authorStefan Vogel <sv@exept.de>
Tue, 17 Mar 2009 20:41:28 +0100
changeset 5225 d5786752d508
parent 5224 c783e3151cc3
child 5226 fa4660772f73
fixes for pixel-sized fonts
Font.st
--- a/Font.st	Tue Mar 17 20:40:46 2009 +0100
+++ b/Font.st	Tue Mar 17 20:41:28 2009 +0100
@@ -230,23 +230,9 @@
 
 !Font class methodsFor:'instance creation'!
 
-family:familyString face:faceString style:styleString size:sizeNum encoding:encodingSym
-    "returns a font for given family, face, style, size and encoding. 
-     The returned font is not associated to a specific device"
-
-    ^ self
-        family:familyString 
-        face:faceString 
-        style:styleString 
-        size:sizeNum
-        sizeUnit:#pt
-        encoding:encodingSym
-!
-
 family:familyString face:faceString style:styleString size:sizeArgOrNil sizeUnit:sizeUnitArg encoding:encodingSym
     "returns a font for given family, face, style, size and encoding. 
-     The returned font is not associated to a specific device.
-     Either size, or pixelSize must be non-nil (points vs. pixels)"
+     The returned font is not associated to a specific device."
 
     |family newFont|
 
@@ -449,7 +435,7 @@
 
     "try font with smaller size"
 
-    trySize := size - 1.
+    trySize := (size ? 0) - 1.
     [
         id := aDevice 
                 getFontWithFamily:family
@@ -465,7 +451,7 @@
     ] ifFalse:[
         alternative := Replacements at:family asLowercase ifAbsent:nil.
         alternative notNil ifTrue:[
-            trySize := size - 1.
+            trySize := (size ? 0) - 1.
             [
                 id := aDevice 
                         getFontWithFamily:alternative
@@ -1205,7 +1191,7 @@
 !Font class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.113 2009-03-17 16:01:08 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.114 2009-03-17 19:41:28 stefan Exp $'
 ! !
 
 Font initialize!