#REFACTORING
authorStefan Vogel <sv@exept.de>
Tue, 02 Feb 2016 18:50:10 +0100
changeset 7119 ecda1d9eb5d6
parent 7118 7314cb86e7e2
child 7120 a13e27041519
#REFACTORING class: XWorkstation comment/format in: #destroyView:withId: #flushListOfAvailableFonts changed: #listOfAvailableFonts #supportsXFTFonts #supportsXftFonts rename #supportsXFTFonts to #supportsXftFonts
XWorkstation.st
--- a/XWorkstation.st	Tue Feb 02 18:45:53 2016 +0100
+++ b/XWorkstation.st	Tue Feb 02 18:50:10 2016 +0100
@@ -597,6 +597,21 @@
     "Modified: / 27.4.1999 / 17:21:30 / cg"
 ! !
 
+!XWorkstation class methodsFor:'accessing-display capabilities'!
+
+hasXftLibrary
+%{
+#ifdef XFT
+    RETURN(true);
+#else
+    RETURN(false);
+#endif
+%}
+    "
+     Display hasXftLibrary
+    "
+! !
+
 !XWorkstation class methodsFor:'error handling'!
 
 debug:aBoolean
@@ -1279,19 +1294,6 @@
     "
 !
 
-hasXftLibrary
-%{
-#ifdef XFT
-    RETURN(true);
-#else
-    RETURN(false);
-#endif
-%}
-    "
-     Display hasXftLibrary
-    "
-!
-
 iconSizes
     "Get the preferred/supported icon sizes. These are set by the window manager.
      We return nil (if not set) or an OrderedCollection of iconSize specs."
@@ -1649,15 +1651,13 @@
     ^ true
 !
 
-supportsXFTFonts
-    "return true, if this device supports xft (truetype) fonts."
-
-    ^ self hasRenderExtension and:[self hasXftLibrary]
-
-    "
-     Display supportsXFTFonts
+supportsXftFonts
+     ^ XftFontDescription notNil and:[self class hasXftLibrary and:[self hasRenderExtension]]
+
+    "
+     Display supportsXftFonts
      Display hasRenderExtension
-     Display hasXftLibrary
+     Display class hasXftLibrary
     "
 !
 
@@ -6998,7 +6998,7 @@
 
     listOfXFonts := nil.
     XftFontDescription notNil ifTrue:[
-	XftFontDescription flushListOfAvailableFonts.
+        XftFontDescription flushListOfAvailableFonts.
     ].
 
     "
@@ -7592,27 +7592,24 @@
     |names listOfXftFonts|
 
     listOfXFonts isNil ifTrue:[
-	names := self getAvailableFontsMatching:'*'.
-	names isNil ifTrue:[
-	    "no names returned ..."
-	    ^ nil
-	].
-	listOfXFonts := names collect:[:aName | self fontDescriptionFromXFontName:aName].
-	listOfXFonts := FontDescription genericFonts, listOfXFonts.
-    ].
-
-    (XftFontDescription notNil
-	    and:[ XftFontDescription isLoaded
-	    and:[ self supportsXFTFonts ]]
-    ) ifTrue:[
-	UserPreferences current useXFontsOnly ifFalse:[
-	    listOfXftFonts := XftFontDescription listOfAvailableFonts.
-
-	    UserPreferences current useXftFontsOnly ifTrue:[
-		^ listOfXftFonts
-	    ].
-	    ^ listOfXftFonts , listOfXFonts.
-	].
+        names := self getAvailableFontsMatching:'*'.
+        names isNil ifTrue:[
+            "no names returned ..."
+            ^ nil
+        ].
+        listOfXFonts := names collect:[:aName | self fontDescriptionFromXFontName:aName].
+        listOfXFonts := FontDescription genericFonts, listOfXFonts.
+    ].
+
+    self supportsXftFonts ifTrue:[
+        UserPreferences current useXFontsOnly ifFalse:[
+            listOfXftFonts := XftFontDescription listOfAvailableFonts.
+
+            UserPreferences current useXftFontsOnly ifTrue:[
+                ^ listOfXftFonts
+            ].
+            ^ listOfXftFonts , listOfXFonts.
+        ].
     ].
     ^ listOfXFonts