Skip to content
This repository was archived by the owner on Jan 15, 2020. It is now read-only.

Fontconfig never reports failure - with workable solution. #35

@Jemi

Description

@Jemi

So I emerged lemonbar-xft, and attempted to try out the last example on the arch linux lemonbar page:

https://wiki.archlinux.org/index.php/lemonbar#Font_Awesome_icons

Unfortunately, for some reason it's not working - the Font Awesome glyph won't display - and lemonbar-xft doesn't report failure or give me any information to help me debug this problem. Looking around the lemonbar-xft issues tracker, I found a link to this page, which explains why:

http://www.freedesktop.org/software/fontconfig/fontconfig-user.html

Fontconfig never fails to select a font, it always just selects a closest match. So fontconfig will never return an error if it can't give you the font you want. On the surface, this is pretty terrible behavior. Luckily, there's an easy fix. Every time lemonbar-xft loads a font, it should report the name of the font it loads on STDERR. Then, in sort of an inversion of the usual pattern on unix, not reporting anything on STDERR while attempting to load a font would ALWAYS indicate an error, whereas reporting something on STDERR while attempting to load a font COULD be an error (user error or program error) depending on whether the user got the font they want.

It might be a little weird, but I think this is the only real solution. Because failing to give the user their preferred font and also not giving them any sort of explanation at all is really unacceptable. The linked document seems to say that the environment variable FC_DEBUG controls this behavior, but unfortunately I can't seem to pass this variable to fontconfig via lemonbar-xft by way of the commandline. It seems like lemonbar-xft should set this to something sensible by default (like 1 or 2 perhaps), and also make it configurable with a verbosity switch, and also allow the internal variable to be set directly by passing a commandline variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions