DeviceGraphicsContext.st
changeset 6108 6ecfb89408d2
parent 6107 afaac69e9310
child 6210 af0bf039ec07
--- a/DeviceGraphicsContext.st	Fri Jul 26 16:37:01 2013 +0200
+++ b/DeviceGraphicsContext.st	Fri Jul 26 17:38:47 2013 +0200
@@ -1683,7 +1683,7 @@
      the case where paint and/or bgPaint are dithered colors"
 
     |opaque index1 index2 easy w h savedPaint fgId bgId
-     id pX pY fontUsed fontsEncoding sz s
+     fontId pX pY fontUsed fontsEncoding sz s
      nSkipLeft nChars wString wSkipLeft wMax index2Guess|
 
     index1 := index1Arg.
@@ -1754,11 +1754,11 @@
         ].
     ].
 
-    id := fontUsed fontId.
-    id isNil ifTrue:[
-        "unknown font (probably non-existing font size)"
-        fontUsed := font replacementFontOnDevice:device.
-        id := fontUsed fontId.
+    fontId := fontUsed fontId.
+    fontId isNil ifTrue:[
+        "this should not happen, since #onDevice tries replacement fonts"
+        'STX[DeviceGraphicsContext] no font: ' errorPrint. fontUsed errorPrintCR.
+        ^ self
     ].
 
     "
@@ -1785,7 +1785,7 @@
     ].
 
     deviceFont ~~ fontUsed ifTrue:[
-        device setFont:id in:gcId.
+        device setFont:fontId in:gcId.
         deviceFont := fontUsed
     ].
 
@@ -2819,6 +2819,14 @@
         aString displayOpaqueOn:self x:x y:y from:index1 to:index2.
         ^ self
     ].
+    font isAlienFont ifTrue:[
+        "
+         hook for alien fonts
+         that 'font' should know how to display the string ...
+        "
+        font displayOpaqueString:s from:index1 to:index2 x:x y:y in:self.
+        ^ self
+    ].
 
     gcId isNil ifTrue:[
         self initGC
@@ -2842,11 +2850,8 @@
 
     id := fontUsed fontId.
     id isNil ifTrue:[
-        "
-         hook for alien fonts
-         that 'font' should know how to display the string ...
-        "
-        font displayOpaqueString:s from:index1 to:index2 x:x y:y in:self.
+        "this should not happen, since #onDevice tries replacement fonts"
+        'STX[DeviceGraphicsContext] no font: ' errorPrint. fontUsed errorPrintCR.
         ^ self
     ].
 
@@ -3105,6 +3110,14 @@
     or:[aString isText]) ifTrue:[
         ^ aString displayOn:self x:x y:y from:index1 to:index2
     ].
+    font isAlienFont ifTrue:[
+        "
+         hook for alien fonts
+         that 'font' should know how to display the string ...
+        "
+        font displayOpaqueString:s from:index1 to:index2 x:x y:y in:self.
+        ^ self
+    ].
 
     gcId isNil ifTrue:[
         self initGC
@@ -3128,8 +3141,9 @@
 
     id := fontUsed fontId.
     id isNil ifTrue:[
-        "hook for alien fonts"
-        font displayString:s from:index1 to:index2 x:x y:y in:self
+        "this should not happen, since #onDevice tries replacement fonts"
+        'STX[DeviceGraphicsContext] no font: ' errorPrint. fontUsed errorPrintCR.
+        ^ self
     ] ifFalse:[
         deviceFont ~~ fontUsed ifTrue:[
             device setFont:id in:gcId.
@@ -3805,11 +3819,11 @@
 !DeviceGraphicsContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.125 2013-07-26 14:37:01 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.126 2013-07-26 15:38:47 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.125 2013-07-26 14:37:01 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.126 2013-07-26 15:38:47 stefan Exp $'
 ! !