You are not logged in.

#1 2020-04-03 02:18:36

ktechmidas
Member
Registered: 2017-10-07
Posts: 5

Fonts issue in terminal (not the usual smushed together letters)

Hey!

Was wondering if I could get a few pointers - I have the dejavu font installed, it comes up when I type fc-match monospace however all characters seem to have a space between them on all terminals and it looks pretty terrible. It was fine until I booted the laptop today, last thing I did was install yay. I suspect something broke somewhere but I'm not entirely sure where or what....

Any advice? There's a screenshot here: https://imgur.com/oNwuBaX.png

Edit: Removing ttf-dejavu appeared to fix it, it's now using notosans... not sure what went wrong

Last edited by ktechmidas (2020-04-03 02:34:23)

Offline

#2 2020-04-03 03:02:30

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Fonts issue in terminal (not the usual smushed together letters)

Do you maybe have zero monospace fonts installed? Make sure you have a monospace font installed. I would recommend ttf-dejavu that you just removed because something was wrong. I guess that means there's something else broken for you? There's maybe a config file in "/etc/fonts/conf.d/" or "~/.config/fontconfig/" that breaks things.

The "fontconfig" library returns a list of sorted fonts when a program asks for something. You can see the full list for the "monospace" name by adding a "-s" to fc-match, like this:

fc-match -s monospace

Normally there should be something that's actually monospaced at the front, then later there can be other fonts that provide interesting characters like Chinese/Japanese/Korean or smileys etc.

You should perhaps think about writing your own config file where you manually configure the three generic names "monospace" and "sans-serif" and "serif". Your own config for those names would be good to have because things can randomly change when you add or remove font packages. Here's an example file:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <alias>
    <family>monospace</family>
    <prefer>
      <family>Liberation Mono</family>
      <family>DejaVu Sans Mono</family>

      <family>Droid Sans Fallback</family>
    </prefer>
  </alias>

  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Liberation Sans</family>
      <family>Noto Sans</family>
      <family>DejaVu Sans</family>
      <family>Droid Sans Fallback</family>
    </prefer>
  </alias>

  <alias>
    <family>serif</family>
    <prefer>
      <family>Liberation Serif</family>
      <family>Noto Serif</family>
      
      <family>Droid Serif</family>
      <family>DejaVu Serif</family>

      <family>DejaVu Sans</family>
    </prefer>
  </alias>

  <alias>
    <family>system-ui</family>
    <prefer>
      <family>Noto Sans</family>
      <family>Droid Sans Fallback</family>
    </prefer>
  </alias>

</fontconfig>

I save this kind of file as "/etc/fonts/conf.d/51-font-alias.conf". I don't know if that "51-..." is the best place in the file order.

In this example you can see there's several fonts listed for "monospace" etc., not just a single font. This is how you can change the order of what "fc-match -s ..." will return. It's how you can tweak what font gets used to draw missing characters from your first font.

Last edited by Ropid (2020-04-03 03:03:54)

Offline

Board footer

Powered by FluxBB