class: Font
authorStefan Vogel <sv@exept.de>
Thu, 08 May 2014 10:05:00 +0200
changeset 6471 613282ad19f0
parent 6470 cdcc01e0ce13
child 6473 4b415e9216c2
class: Font added: #displayString:from:to:x:y:in:opaque:maxWidth:
Font.st
--- a/Font.st	Thu May 08 02:22:16 2014 +0200
+++ b/Font.st	Thu May 08 10:05:00 2014 +0200
@@ -344,6 +344,30 @@
     aGC basicFont:prevFont.
 
     "Modified: 10.1.1997 / 17:51:17 / cg"
+!
+
+displayString:aString from:index1 to:index2 x:x y:y in:aGC opaque:opaque maxWidth:maxWindowWidth
+    "this is only called for fonts which have a nil fontId,
+     and therefore use the replacementFont. Should never be called
+     for non-replacement fonts."
+
+    |prevFont|
+
+    prevFont := aGC font.
+    replacementFont isNil ifTrue:[
+        fontId notNil ifTrue:[
+            aGC basicFont:self.
+            aGC displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWindowWidth.
+        ] ifFalse:[
+            'Font: [warning]: no replacementFont. should not happen' errorPrintCR.
+        ].
+    ] ifFalse:[
+        aGC basicFont:replacementFont.
+        aGC displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWindowWidth.
+    ].
+    aGC basicFont:prevFont.
+
+    "Modified: 10.1.1997 / 17:51:17 / cg"
 ! !
 
 !Font methodsFor:'getting a device font'!
@@ -1313,11 +1337,11 @@
 !Font class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.136 2014-01-16 14:32:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.137 2014-05-08 08:05:00 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.136 2014-01-16 14:32:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.137 2014-05-08 08:05:00 stefan Exp $'
 ! !