Font.st
changeset 148 15c31ab7d8de
parent 144 cf645a1ebbb3
child 149 3389ebfe886f
--- a/Font.st	Fri May 19 00:55:49 1995 +0200
+++ b/Font.st	Fri May 19 15:39:33 1995 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Font.st,v 1.18 1995-05-16 17:12:57 claus Exp $
+$Header: /cvs/stx/stx/libview/Font.st,v 1.19 1995-05-19 13:39:33 claus Exp $
 '!
 
 !Font class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Font.st,v 1.18 1995-05-16 17:12:57 claus Exp $
+$Header: /cvs/stx/stx/libview/Font.st,v 1.19 1995-05-19 13:39:33 claus Exp $
 "
 !
 
@@ -411,6 +411,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont isFixedWidth
+    ].
     ^ isFixedWidth
 !
 
@@ -421,6 +424,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont height
+    ].
     ^ height
 !
 
@@ -432,6 +438,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont width
+    ].
     ^ width
 !
 
@@ -442,6 +451,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont minWidth
+    ].
     ^ minWidth
 !
 
@@ -452,6 +464,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont maxWidth
+    ].
     ^ maxWidth
 !
 
@@ -462,6 +477,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont ascent
+    ].
     ^ ascent
 !
 
@@ -472,6 +490,9 @@
     device isNil ifTrue:[
 	self errorNoDevice
     ].
+    replacementFont notNil ifTrue:[
+	^ replacementFont descent
+    ].
     ^ descent
 !
 
@@ -532,6 +553,32 @@
     ^ (stop - start + 1) * width
 ! !
 
+!Font methodsFor:'displaying'!
+
+displayString:aString x:x y:y in:aGC
+    "this is only called for fonts which have a nil fontId,
+     and therefore use the replacementFont"
+
+    replacementFont isNil ifTrue:[
+	'FONT: oops should not happen' errorPrintNL.
+	^ self
+    ].
+    aGC font:replacementFont.
+    aGC displayString:aString x:x y:y
+!
+
+displayString:aString from:index1 to:index2 x:x y:y in:aGC
+    "this is only called for fonts which have a nil fontId,
+     and therefore use the replacementFont"
+
+    replacementFont isNil ifTrue:[
+        'FONT: oops should not happen' errorPrintNL.
+        ^ self
+    ].
+    aGC font:replacementFont.
+    aGC displayString:aString from:index1 to:index2 x:x y:y
+! !
+
 !Font methodsFor:'st-80 queries'!
 
 fixedWidth