DeviceWorkstation.st
changeset 1014 6be12d5937f5
parent 1011 260a986c9b00
child 1022 e41ea5762606
--- a/DeviceWorkstation.st	Fri Aug 02 21:07:46 1996 +0200
+++ b/DeviceWorkstation.st	Fri Aug 02 22:39:59 1996 +0200
@@ -2065,7 +2065,9 @@
 displayLineFromX:x0 y:y0 toX:x1 y:y1 in:aDrawableId with:aGCId
     "draw a line"
 
-    "could add a bresenham line drawer here ..."
+    "
+     could add a bresenham line drawer here ...
+    "
     ^ self subclassResponsibility
 !
 
@@ -2105,7 +2107,7 @@
     "draw a polygon"
 
     "
-     should draw the lines here
+     could draw the lines here
      but then, we have to reimplement all line and join styles here
     "
     ^ self subclassResponsibility
@@ -2115,7 +2117,7 @@
     "draw a rectangle"
 
     "
-     should draw four lines here
+     could draw four lines here
      but then, we have to reimplement all line and join styles here
     "
     ^ self subclassResponsibility
@@ -2139,16 +2141,7 @@
 displayString:aString from:i1 to:i2 x:x y:y in:aDrawableId with:aGCId opaque:opaque
     "draw part of a string"
 
-    "
-     should be redefined in concrete subclasses
-     to avoid creation of throw-away string
-    "
-    self displayString:(aString copyFrom:i1 to:i2)
-		     x:x 
-		     y:y 
-		     in:aDrawableId 
-		     with:aGCId
-		     opaque:opaque
+    ^ self subclassResponsibility
 !
 
 displayString:aString x:x y:y in:aDrawableId with:aGCId
@@ -2167,7 +2160,14 @@
 displayString:aString x:x y:y in:aDrawableId with:aGCId opaque:opaque
     "draw a string"
 
-    ^ self subclassResponsibility
+    self displayString:aString
+		  from:1
+		    to:aString size
+		     x:x 
+		     y:y 
+		     in:aDrawableId 
+		     with:aGCId
+		     opaque:opaque
 !
 
 drawBits:imageBits depth:imageDepth width:imageWidth height:imageHeight
@@ -2867,7 +2867,7 @@
     "Modified: 18.7.1996 / 17:12:50 / cg"
 ! !
 
-!DeviceWorkstation methodsFor:'font stuff'!
+!DeviceWorkstation methodsFor:'font helpers'!
 
 ascentOf:aFontId
     "return the number of pixels above the base line of a font"
@@ -2890,6 +2890,34 @@
     "Created: 23.2.1996 / 00:39:06 / cg"
 !
 
+maxAscentOf:aFontId
+    "return the number of pixels above the base line of the tallest character
+     in a font"
+
+    ^ self subclassResponsibility
+!
+
+maxDescentOf:aFontId
+    "return the number of pixels below the base line of the tallest character
+     in a font"
+
+    ^ self subclassResponsibility
+!
+
+maxWidthOfFont:aFontId
+    "return the width in pixels of the widest character a specific font"
+
+    ^ self subclassResponsibility
+!
+
+minWidthOfFont:aFontId
+    "return the width in pixels of the smallest character a specific font"
+
+    ^ self subclassResponsibility
+! !
+
+!DeviceWorkstation methodsFor:'font stuff'!
+
 facesInFamily:aFamilyName
     "return a set of all available font faces in aFamily on this display"
 
@@ -3132,18 +3160,6 @@
     ^ self subclassResponsibility
 !
 
-maxWidthOfFont:aFontId
-    "return the width in pixels of the widest character a specific font"
-
-    ^ self subclassResponsibility
-!
-
-minWidthOfFont:aFontId
-    "return the width in pixels of the smallest character a specific font"
-
-    ^ self subclassResponsibility
-!
-
 releaseFont:aFontId
     "free a font"
 
@@ -3226,7 +3242,7 @@
 widthOf:aString inFont:aFontId
     "return the width in pixels of a string in a specific font"
 
-    ^ self subclassResponsibility
+    ^ self widthOf:aString from:1 to:(aString size) inFont:aFontId
 ! !
 
 !DeviceWorkstation methodsFor:'grabbing '!
@@ -4614,6 +4630,6 @@
 !DeviceWorkstation  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.128 1996-08-01 16:11:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.129 1996-08-02 20:39:59 cg Exp $'
 ! !
 DeviceWorkstation initialize!