Call XftConfigSubstitute() & XftDefaultSubstitute() before matching fonts.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 03 Jan 2014 01:45:14 +0100
changeset 6191 86ef1e69ffc1
parent 6190 d651313d4044
child 6192 d79a5e546361
Call XftConfigSubstitute() & XftDefaultSubstitute() before matching fonts.
XftFontDescription.st
--- a/XftFontDescription.st	Thu Jan 02 23:54:56 2014 +0100
+++ b/XftFontDescription.st	Fri Jan 03 01:45:14 2014 +0100
@@ -349,7 +349,7 @@
     ] ifFalse:[
         self xftDrawChange: drawId drawable: aGC id
     ].
-    self xftDrawSetClip: drawId rectangle: aGC clippingBounds.  
+    self xftDrawSetClip: drawId rectangle: aGC clippingBounds.
     extents :=  self xftTextExtents: device displayId font: fontId string: aString from: index1 to: index2.
 
     opaque ifTrue:[
@@ -448,7 +448,7 @@
             aGraphicsDevice deviceFonts do:[:aFont |
                 ((self class == aFont class) and:[ newFontId = aFont getFontId ]) ifTrue:[
                     closestFont := aFont.
-                    ^ closestFont 
+                    ^ closestFont
                 ].
             ].
 
@@ -644,7 +644,7 @@
     ].
 %{
 #ifdef XFT
-    XRectangle r;      
+    XRectangle r;
     if ( ! __isExternalAddressLike(drawIdArg) ) {
         error = @symbol(BadArg1);
         goto err;
@@ -653,7 +653,7 @@
         r.x = __intVal(xObj);
         r.y = __intVal(yObj);
         r.width = __intVal(wObj);
-        r.height = __intVal(hObj);    
+        r.height = __intVal(hObj);
         XftDrawSetClipRectangles( XFT_DRAW(drawIdArg) , 0, 0, &r, 1);
     } else {
         XftDrawSetClipRectangles( XFT_DRAW(drawIdArg) , 0, 0, (XRectangle*)NULL, 0);
@@ -876,6 +876,8 @@
         goto err;
     }
 
+    XftConfigSubstitute(FC_PATTERN( patternId ));
+    XftDefaultSubstitute(DISPLAY(displayId) , SCREEN( screen ), FC_PATTERN( patternId ));
     p = XftFontMatch( DISPLAY(displayId) , SCREEN( screen ), FC_PATTERN( patternId ), &r );
     if (r == XftResultMatch) {
         RETURN ( FC_PATTERN_HANDLE_NEW ( p ) );
@@ -1262,11 +1264,11 @@
 !XftFontDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.12 2014-01-02 22:54:56 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.13 2014-01-03 00:45:14 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.12 2014-01-02 22:54:56 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.13 2014-01-03 00:45:14 vrany Exp $'
 ! !