FontDescription.st
changeset 3996 9ed3e413700c
parent 3993 7fc0939208e2
child 4005 cbe56ccc85fa
--- a/FontDescription.st	Fri Feb 06 18:11:59 2004 +0100
+++ b/FontDescription.st	Fri Feb 06 18:42:55 2004 +0100
@@ -152,14 +152,14 @@
 
 family:familyString
     "returns a font for given family and default (12pt) size 
-     with unspecified encoding.
+     with default encoding.
      The new fonts face defaults `medium', its style to `roman'.
      The returned font is not associated to a specific device"
 
     ^ self family:familyString
-           face:'medium' 
-           style:'roman' 
-           size:12 
+           face:(self defaultFace) 
+           style:(self defaultStyle) 
+           size:(self defaultSize) 
            encoding:(self defaultEncoding)
 
     "
@@ -171,13 +171,13 @@
 !
 
 family:familyString face:faceString size:sizeNum
-    "returns a font for given family and size with unspecified encoding.
+    "returns a font for given family and size with default encoding.
      The new fonts style defaults to `roman'.
      The returned font is not associated to a specific device"
 
     ^ self family:familyString
            face:faceString 
-           style:'roman' 
+           style:(self defaultStyle)
            size:sizeNum
            encoding:(self defaultEncoding)
 
@@ -191,8 +191,7 @@
 !
 
 family:familyString face:faceString style:styleString size:sizeNum
-    "returns a font for given family, face, style and size with
-     unspecified encoding. 
+    "returns a font for given family, face, style and size with default encoding. 
      The returned font is not associated to a specific device"
 
     ^ self family:familyString
@@ -210,8 +209,7 @@
 !
 
 family:familyString face:faceString style:styleString size:sizeNum encoding:encoding
-    "returns a font for given family, face, style, size and
-     the specified encoding. 
+    "returns a font for given family, face, style, size and the specified encoding. 
      The returned font is not associated to a specific device"
 
     ^ self new
@@ -225,13 +223,13 @@
 !
 
 family:familyString size:sizeNum
-    "returns a font for given family and size with unspecified encoding.
+    "returns a font for given family and size with default encoding.
      The new fonts face defaults to `medium', its style to `roman'.
      The returned font is not associated to a specific device"
 
     ^ self family:familyString
-           face:'medium' 
-           style:'roman' 
+           face:(self defaultFace)
+           style:(self defaultStyle)
            size:sizeNum
            encoding:(self defaultEncoding)
 
@@ -244,12 +242,12 @@
 !
 
 family:familyString style:aStyle size:sizeNum
-    "returns a font for given family and size with unspecified encoding.
+    "returns a font for given family and size with default encoding.
      The new fonts face defaults to `medium', its style to `roman'.
      The returned font is not associated to a specific device"
 
     ^ self family:familyString
-           face:'medium' 
+           face:(self defaultFace)
            style:aStyle 
            size:sizeNum
            encoding:(self defaultEncoding)
@@ -295,6 +293,18 @@
 
 defaultEncoding
     ^ #'iso8859-1'
+!
+
+defaultFace
+    ^ 'medium'
+!
+
+defaultSize
+    ^ 12
+!
+
+defaultStyle
+    ^ 'roman' 
 ! !
 
 !FontDescription class methodsFor:'queries'!
@@ -1080,7 +1090,7 @@
 !FontDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.50 2004-02-06 15:09:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.51 2004-02-06 17:42:55 ca Exp $'
 ! !
 
 FontDescription initialize!