gnotclub / xst

st fork that uses Xresources and some pretty good patches
MIT License
537 stars 73 forks source link

Make it possible to specify multiple (fallback) fonts #41

Closed colingabr closed 2 years ago

colingabr commented 6 years ago

With URxvt you can configure your font:

URxvt.font: font1,font2

And font2 glyphs will be used as fallback if font1 doesn't provide them. This is useful for displaying icon fonts like https://github.com/stark/siji

It would be nice if xst could do this.

arkhan commented 5 years ago

any update...?

mustaqimM commented 4 years ago

@novcn @arkhan Put something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
  <!--
  Make FantasqueSansMono Nerd Font the fallback font for Iosevka Medium
  -->
<match>
    <test name="family"><string>Iosevka Medium</string></test>
    <edit name="family" mode="append" binding="strong">
      <string>FantasqueSansMono Nerd Font</string>
    </edit>
  </match>

in ~/.config/fontconfig/fonts.conf

Then run: fc-cache -fv

Before: https://i.imgur.com/d0JIsFg.png After: https://i.imgur.com/ogYvoJg.png

neeasade commented 4 years ago

note: we could do this with https://st.suckless.org/patches/font2/, then split on ',' for xresource loading

RaafatTurki commented 4 years ago

update?

actionless commented 4 years ago

@RaafatTurki PRs welcome ;)

BeyondMagic commented 3 years ago

Not sure how font2 loads the fonts, but I'll give it a look and see if it can be done by XResource easily.

BeyondMagic commented 3 years ago

It took longer than what I thought it would, but to be honest, it works just fine. The way I implemented it actually uses the font2's fonts of the config.h as well and add the ones from XResources with it.

I'll make a PR if @gnotclub members are willing to accept it.

actionless commented 3 years ago

thanks in advance!