[hackers] [st] Use XftFontMatch in place of FcFontMatch. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Fri, 3 Jun 2016 15:03:51 +0200 (CEST)

commit 528241aa3835e2f1f052abeeaf891737712955a0
Author: Christoph Lohmann <20h_AT_r-36.net>
AuthorDate: Fri Jun 3 15:02:32 2016 +0200
Commit: Christoph Lohmann <20h_AT_r-36.net>
CommitDate: Fri Jun 3 15:02:32 2016 +0200

    Use XftFontMatch in place of FcFontMatch.
    
    git am -s didn't like your patch:
    
    From: Mark Edgar <medgar123_AT_gmail.com>
    
    XftFontMatch calls XftDefaultSubstitute which configures various match
    properties according to the user's configured Xft defaults (xrdb) as well as
    according to the current display and screen. Most importantly, the screen DPI
    is computed [1]. Without this, st uses a "default" DPI of 75 [2].
    
    [1]: https://cgit.freedesktop.org/xorg/lib/libXft/tree/src/xftdpy.c?id=libXft-2.3.2#n535
    [2]: https://cgit.freedesktop.org/fontconfig/tree/src/fcdefault.c?id=2.11.1#n255

diff --git a/st.c b/st.c
index 6736464..2594c65 100644
--- a/st.c
+++ b/st.c
_AT_@ -3279,7 +3279,7 @@ xloadfont(Font *f, FcPattern *pattern)
         FcResult result;
         XGlyphInfo extents;
 
- match = FcFontMatch(NULL, pattern, &result);
+ match = XftFontMatch(xw.dpy, xw.scr, pattern, &result);
         if (!match)
                 return 1;
 
_AT_@ -3345,9 +3345,6 @@ xloadfonts(char *fontstr, double fontsize)
                 defaultfontsize = usedfontsize;
         }
 
- FcConfigSubstitute(0, pattern, FcMatchPattern);
- FcDefaultSubstitute(pattern);
-
         if (xloadfont(&dc.font, pattern))
                 die("st: can't open font %s\n", fontstr);
 
Received on Fri Jun 03 2016 - 15:03:51 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 03 2016 - 15:12:21 CEST