3

I would like to have HelveticaLTStd-Bold substituted with LiberationSans-Bold font. It is already installed in many places:

enter image description here

but DejaVu Sans is chosen instead:

paul@desktop:~$ fc-match "HelveticaLTStd-Bold"
DejaVuSans.ttf: "DejaVu Sans" "Book"

I followed the advice from PDF font falls back to DejaVu Sans, need a monospace replacement, but it didn't work. What is the solution?


I use Ubuntu 22.04.2 LTS x86_64. I checked that fonts-urw-base35 is installed. I created ~/.config/fontconfig/conf.d/10-pdf-aliases.conf file with this contents:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "/etc/fonts/conf.d/fonts.dtd">
<fontconfig>

<alias binding="same"> <family>CourierStd</family> <accept> <family>Courier</family> </accept> </alias>

<alias> <family>CourierStd</family> <default><family>monospace</family></default> </alias>

</fontconfig>

I've run fc-cache and I'm still getting:

paul@desktop:~$ fc-match "HelveticaLTStd-Bold"
DejaVuSans.ttf: "DejaVu Sans" "Book"

I didn't notice a different font name in that configuration file. I edited it, and it solves my problem with Document Viewer. Unfortunately, Okular (installed with Flatpak) still uses DejaVu Sans and produces this misformed kerning:

enter image description here

Here are the fonts used in this document:

enter image description here

Paul Jurczak
  • 1,237

1 Answers1

3

Well, the other question helped deal with the Courier Std font while awaiting a fix upstream.

To start with, try replacing this section:

<alias binding="same">
<family>CourierStd</family>
<accept>
<family>Courier</family>
</accept>
</alias>

with:

<alias binding="same">
<family>HelveticaLTStd</family>
<accept>
<family>Liberation Sans</family>
</accept>
</alias>

Result on my machine:

$ fc-match "HelveticaLTStd: bold"
LiberationSans-Bold.ttf: "Liberation Sans" "Bold"