mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 15:25:58 +01:00
Use XftFontMatch in place of FcFontMatch.
git am -s didn't like your patch: From: Mark Edgar <medgar123@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
This commit is contained in:
parent
60aeb37edb
commit
528241aa38
1 changed files with 1 additions and 4 deletions
5
st.c
5
st.c
|
@ -3279,7 +3279,7 @@ xloadfont(Font *f, FcPattern *pattern)
|
||||||
FcResult result;
|
FcResult result;
|
||||||
XGlyphInfo extents;
|
XGlyphInfo extents;
|
||||||
|
|
||||||
match = FcFontMatch(NULL, pattern, &result);
|
match = XftFontMatch(xw.dpy, xw.scr, pattern, &result);
|
||||||
if (!match)
|
if (!match)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -3345,9 +3345,6 @@ xloadfonts(char *fontstr, double fontsize)
|
||||||
defaultfontsize = usedfontsize;
|
defaultfontsize = usedfontsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
FcConfigSubstitute(0, pattern, FcMatchPattern);
|
|
||||||
FcDefaultSubstitute(pattern);
|
|
||||||
|
|
||||||
if (xloadfont(&dc.font, pattern))
|
if (xloadfont(&dc.font, pattern))
|
||||||
die("st: can't open font %s\n", fontstr);
|
die("st: can't open font %s\n", fontstr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue