From 9d5447b61340038499ad74f37e9d1b012d3c720e Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Sun, 8 May 2016 14:24:39 +0200 Subject: [PATCH] Use XftFontMatch in place of FcFontMatch. 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 --- st.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git st.c st.c index 27536d2..6354a42 100644 --- st.c +++ st.c @@ -3280,7 +3280,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; @@ -3346,9 +3346,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); -- 2.7.4