[dev] [dmenu] are those two calls in drw.c really necessary?

From: Phillip Bushee <phillbush_AT_cock.li>
Date: Sun, 17 Jan 2021 19:19:01 +0000

Hi.

On drw.c, in line #356[1], before we do the font matching, we
call FcConfigSubstitute(3) to (if I understand Xft correctly)
fill system configuration values into our search pattern, and
we call FcDefaultSubstitute(3) to fill some default configuration
it has for things we haven't set yet in the search pattern.
Then we call XftFontMatch(3) to do the actual font matching.

But, after checking the code for XftFontMatch(3), I noticed that it
already calls FcConfigSubstitute(3) and FcDefaultSubstitute(3) on a
pattern it duplicates before doing the actual matching.

So calling those two functions in drw.c is really necessary as
XftFontMatch(3) will call them again? Is there any reason for
those two calls?

If there isn't any reason for that, I see two solutions:
• Remove those two calls.
• Replace the call to XftFontMatch(3) with FcFontMatch(3).

[1] https://git.suckless.org/dmenu/file/drw.c.html#l356
[2]
https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/master/src/xftfont.c#L26

Philip Bushee.
Received on Sun Jan 17 2021 - 20:19:01 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 17 2021 - 20:24:09 CET