#BUGFIX
authorStefan Vogel <sv@exept.de>
Sun, 04 Oct 2015 23:45:34 +0200
changeset 6963 26d226d61d32
parent 6962 e310074c6d77
child 6964 a459b5a03d9c
#BUGFIX class: XftFontDescription::FCFontListParser fix outline parsing
XftFontDescription.st
--- a/XftFontDescription.st	Sun Oct 04 23:44:15 2015 +0200
+++ b/XftFontDescription.st	Sun Oct 04 23:45:34 2015 +0200
@@ -350,8 +350,7 @@
 !
 
 new
-"/    self halt.
-    ^ super new.
+    ^ self basicNew initialize.
 ! !
 
 !XftFontDescription class methodsFor:'change & update'!
@@ -467,10 +466,6 @@
 
 !XftFontDescription methodsFor:'accessing'!
 
-encoding
-    ^ encoding ? 'iso10646-1'
-!
-
 face
     ^ face ? ''
 !
@@ -993,6 +988,14 @@
 
 !XftFontDescription methodsFor:'initialization'!
 
+initialize
+    "Invoked when a new instance is created."
+
+    super initialize.
+    size := 0.
+    encoding := #'iso10646-1'.
+!
+
 setDevice: deviceArg patternId: patternIdArg fontId: fontIdArg
     device := deviceArg.
     fontId := fontIdArg.
@@ -1011,6 +1014,9 @@
     size isNil ifTrue:[
         size := 0.
     ].
+    encoding isNil ifTrue:[
+        encoding := #'iso10646-1'.
+    ].
 
     "Created: / 21-12-2013 / 00:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 30-12-2013 / 12:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1860,9 +1866,11 @@
 %{
 #ifdef XFT
     if ( __INST(sharedDrawId) != nil ) {
-	if (XftDrawDrawable(XFT_DRAW(__INST(sharedDrawId))) == DRAWABLE(drawableId)) {
+	XftDraw *xftDrawable = XFT_DRAW(__INST(sharedDrawId));
+
+	if (XftDrawDrawable(xftDrawable) == DRAWABLE(drawableId)) {
 	    __INST(sharedDrawId) = nil;
-	    XftDrawDestroy(DRAWABLE(drawableId));
+	    XftDrawDestroy(xftDrawable);
 	}
     }
     RETURN (self);
@@ -1937,7 +1945,7 @@
                 (
                     #('family:' 'style:' 'slant:' 'weight:' 'width:'
                       'pixelsize:' 'spacing:' 'foundry:' 'antialias:'
-                      'file:' 'outline' 'scalable:' 'charset:' 'lang:'
+                      'file:' 'outline:' 'scalable:' 'charset:' 'lang:'
                       'fontversion:' 'fontformat:' 'decorative:' 'index:'
                       'outline:' 'familylang:' 'stylelang:' 'fullname:'
                       'fullnamelang:' 'capability:' 'hash:' 'postscriptname:'
@@ -2191,6 +2199,11 @@
     lineStream skipSeparators.
     s := lineStream nextAlphaNumericWord.
     ^ (s indexOfSubCollection:'True') ~~ 0.     "/ match at least 'True' and 'FCTrue'
+
+    "
+        'xxFalse' indexOfSubCollection:'True'
+        'FcTrue' indexOfSubCollection:'True'
+    "
 !
 
 getInteger