You are not logged in.

#1 2020-05-30 07:04:05

SadPotato
Member
Registered: 2020-05-30
Posts: 1

Question about setting different system fonts for different scripts.

I have recently installed Arch with the xfce desktop, and I am having problem with the fonts that bothers me, the font for latin script looks fine, but when there is for example Arabic text somewhere, it looks awful, I have different fonts installed for the different languages, but I don't know how to change that. I am able to change the font in firefox, but the application tabs on the bottom, and the text in system apps is still the same ugly font. Is there a way to have a different font set for a different language, because the default ones are trash.

Offline

#2 2020-05-30 09:00:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: Question about setting different system fonts for different scripts.

There are no default fonts in archlinux, but you can define them: https://wiki.archlinux.org/index.php/Font_configuration
I'd first figure which font bothers you and either remove it or lower it in the substitution preference.

Offline

#3 2020-05-30 09:40:41

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

Re: Question about setting different system fonts for different scripts.

Yes, you can customize the order that fonts are used for fallback.

First, you can research how the fallback currently works for you like this:

fc-match -s 'font name here' | head -n20

You can then try to put a certain font high up on the list. You do that with a "fontconfig" config file like this:

<?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>

      <family>IPAMincho</family>
      <family>IPAPMincho</family>
      
  </alias>

</fontconfig>

Here's another example that's using the name of an actual font instead of those generic "sans-serif" etc. names:

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

  <!-- Font fallbacks for Fantasque Sans Mono -->
  <alias>
    <family>Fantasque Sans Mono</family>
    <prefer>
      <family>Fantasque Sans Mono</family>
      <family>Iosevka Term</family>
      <family>DejaVu Sans Mono</family>
      <!-- <family>M+ 2m</family> -->
      <family>Droid Sans Fallback</family>
    </prefer>
  </alias>

</fontconfig>

Here's how "fc-match -s" for that font now looks like for me:

$ fc-match -s fantasquesansmono | head
FantasqueSansMono-Regular.otf: "Fantasque Sans Mono" "Regular"
FantasqueSansMono-Bold.otf: "Fantasque Sans Mono" "Bold"
FantasqueSansMono-Italic.otf: "Fantasque Sans Mono" "Italic"
iosevka-term-regular.ttf: "Iosevka Term" "Regular"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DroidSans.ttf: "Droid Sans" "Regular"
...

Offline

Board footer

Powered by FluxBB