2

I've riced my Ubuntu Server using dwm and st, using LibreWolf as my web browser. It's a very minimal build, I installed the Roboto Mono font and the Linux Libertine and Biolinum fonts, and Ubuntu Server already comes with the Deja Vu fonts.

My web browser isn't correctly dispaying fonts, all fonts in the viewport are the same (I believe they're Deja Vu Sans). This gets clear when I visit Google Fonts (image below):

Fonts on Google Fonts displaying incorrectly

All fonts are displayed with the same font.

Do I need to install any packages or configure fontconfig in any way to make fonts work as intended in my browser?

Edit: as requested by @kanehekili, here it is my fc-list output: https://pastebin.com/raw/EZXjpZmu

os_user
  • 31
  • 2
  • How did you install the fonts you mention? – Gunnar Hjalmarsson Oct 20 '21 at 21:06
  • [List your fonts](https://askubuntu.com/q/552979/906933) and we might tell - use the [edit](https://askubuntu.com/posts/1370570/edit) button below your answer to add the missing infos – kanehekili Oct 20 '21 at 21:07
  • @GunnarHjalmarsson I downloaded the TTF files, moved them to `/usr/local/fonts`, and run `fc-cache -fv` to load them. @kanehekili I edited my post with the info you requested. – os_user Oct 20 '21 at 22:20
  • @os_user: `/usr/local/share/fonts` is probably better (not sure if fontconfig looks in the one you mentioned). Anyway, I wrote an answer. – Gunnar Hjalmarsson Oct 21 '21 at 06:16

1 Answers1

0

To make your browser use additional fonts, installing them and updating the cache is not sufficient. You also need to tell fontconfig to prefer them over other installed fonts.

An example file in your case may look like this:

$ cat ~/.config/fontconfig/conf.d/10-prefer-libertine.conf
<fontconfig>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Linux Libertine</family>
        </prefer>
    </alias>
</fontconfig>

With that file in place the fc-match command should result in:

$ fc-match
LinLibertine_R.ttf: "Linux Libertine" "Regular"

and you should notice a change when rendering web pages.

Gunnar Hjalmarsson
  • 32,938
  • 3
  • 63
  • 94