bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.15k stars 232 forks source link

Fallback fonts not sized properly #296

Open UtkarshVerma opened 2 years ago

UtkarshVerma commented 2 years ago

I have an alias in my ~/.config/fontconfig/fonts.xml like this:

    <alias>
        <family>monospace</family>
        <prefer>
            <family>Comic Code Ligatures</family>
            <family>Symbols Nerd Font</family>
        </prefer>
    </alias>

This is simply setting Nerd Font symbols as a fallback in case the glyphs aren't found in my main monospace font, i.e. Comic Code Ligatures.

This works properly in st, however, dwm fails to size the fallback font properly and the glyphs are rendered very small.

Here are a few screenshots.

static const char *fonts[] = { "monospace-12", "Symbols Nerd Font-14" }; image

static const char *fonts[] = { "monospace-12" }; image

These is the output of st using the same font family without FONT2 patch: image

If you want to test this quickly, you can use my builds of st, dwm and my fontconfig:

bakkeby commented 2 years ago

I don't think that this would be the responsibility of dwm to figure out. If it needs to look up additional fonts then it will just use the same size as for the primary font, and not all fonts are created alike, like some fonts have space around the characters while other does not. Specifying the font size using pixel size rather than size may also make a difference.

There is also #255 where the monospaced version of the nerd font has small icons compared to the non-monospaced version of the font.

UtkarshVerma commented 2 years ago

Yeah, using pixelsize did make a difference, but the vertical alignment got messed up.

static const char *fonts[] = { "monospace:pixelsize=20" }; image

This seems really weird.