Score:3

How to redefine font substitution?

pe flag

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

Gunnar Hjalmarsson avatar
uz flag
Which Ubuntu version do you use? Can you please edit your question and show us how exactly you applied the advice from the other question?
Paul Jurczak avatar
pe flag
@GunnarHjalmarsson I added the details you requested.
xiota avatar
cn flag
Can you provide a link to a PDF that demonstrates the issue? What program generated it? (Wondering whether HelveticaLTStd needs to be added to default config files, like CourierStd was.)
Paul Jurczak avatar
pe flag
@xiota I added more info. Let me know if you still need the PDF - I would have to remove a few fields.
Gunnar Hjalmarsson avatar
uz flag
Since the *Helvetica LT Std* font is used in some official American form, @xiota seems to have been right about his suspicion. OTOH, unlike Courier Std (which is a monospace font) this one is sans-serif. And preferring Liberation Sans over DejaVu Sans is merely a matter of personal preferences, isn't it? So there does not seem to be a need to propose a change to the default config files in this case.
Paul Jurczak avatar
pe flag
@GunnarHjalmarsson *preferring Liberation Sans over DejaVu Sans is merely a matter of personal preferences* - I don't care specifically about Liberation Sans, I just want to have a right kerning with whatever font can accomplish that. DejaVu doesn't.
xiota avatar
cn flag
I found a blank W9 form that demonstrates the issue. The PDF would be needed to open up an issue so that the upstream project can update the default font configs.
Score:3
uz flag

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"
Paul Jurczak avatar
pe flag
Thank you. Do you know how to handle the Flatpak (Okular) issue?
Gunnar Hjalmarsson avatar
uz flag
@PaulJurczak: No. Probably the Flatpak font configuration is sandboxed, as is the case with snaps. For some snaps I know how handle it.
xiota avatar
cn flag
Merge request to update configs: [fontconfig/282](https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/282)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.