Font.st
changeset 6204 56abbbb55591
parent 6163 f5e0de280f35
child 6471 613282ad19f0
--- a/Font.st	Thu Jan 16 15:32:38 2014 +0100
+++ b/Font.st	Thu Jan 16 15:32:54 2014 +0100
@@ -448,11 +448,12 @@
      an image is restored on another type of display, or one which has
      a different set of fonts."
 
-    |id f trySize alternatives alternateFamilyName|
+    |id f trySize alternatives alternateFamilyName useEncoding|
 
     "try font with smaller size - 
      but do not try this on scaled fonts (they have size == 0)"
 
+    useEncoding := encoding ? #'iso10646-1'.
     alternateFamilyName := family.
     self isGenericFont ifFalse:[
         trySize := (sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) ? 0.
@@ -463,7 +464,7 @@
                     style:style 
                     size:trySize  
                     sizeUnit:sizeUnit  
-                    encoding:encoding.
+                    encoding:useEncoding.
         ].
     ].
 
@@ -481,7 +482,7 @@
                             style:style 
                             size:trySize  
                             sizeUnit:sizeUnit  
-                            encoding:encoding.
+                            encoding:useEncoding.
                 ] doWhile:[id isNil and:[trySize := trySize - 1. trySize > 4. false]].
                 alternateFamilyName := eachAlternateFamilyName.
                 id notNil.
@@ -490,7 +491,7 @@
         id notNil ifTrue:[
             ('Font [info]: use alternative: ', alternateFamilyName , ' for: ' , (self userFriendlyName)) infoPrintCR.
         ] ifFalse:[
-            encoding = #'iso10646-1' ifTrue:[
+            useEncoding = #'iso10646-1' ifTrue:[
                 "/ try latin1 (for osx-X11)
                 id := aDevice 
                         getFontWithFamily:family
@@ -504,7 +505,7 @@
                 ].
             ].
             id isNil ifTrue:[
-                id := aDevice getDefaultFontWithEncoding:encoding.
+                id := aDevice getDefaultFontWithEncoding:useEncoding.
                 ('Font [info]: use default for ' , (self userFriendlyName)) infoPrintCR.
             ].
         ].
@@ -525,7 +526,7 @@
 
     f := self class basicNew.
     f 
-        setFamily:alternateFamilyName face:face style:style size:trySize sizeUnit:sizeUnit encoding:encoding device:aDevice;
+        setFamily:alternateFamilyName face:face style:style size:trySize sizeUnit:sizeUnit encoding:useEncoding device:aDevice;
         setDevice:aDevice fontId:id;
         getFontInfos.
 
@@ -1312,11 +1313,11 @@
 !Font class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.135 2013-11-25 16:44:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.136 2014-01-16 14:32:54 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.135 2013-11-25 16:44:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.136 2014-01-16 14:32:54 stefan Exp $'
 ! !