You are not logged in.

#1 2021-12-18 08:48:00

k395
Member
Registered: 2020-01-29
Posts: 37

Firefox does not use fallback font?

I view this HTML file in the browser (Firefox) (using file:///path/to/file.html):

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<pre style="font-family: Consolas">
iiiii
wwwww
</pre>
<pre style="font-family: DejaVu Sans Mono">
iiiii
wwwww
</pre>
</body>
</html>

The first block is rendered (according to inspector tool → fonts → "Fonts used") in "DejaVu Serif" font, while the second is in monospace as expected.

Running fc-match in the terminal:

$ fc-match "Consolas"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$ fc-match "DejaVu Sans Mono"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

All extensions are disabled in Firefox. I did not make any font changes recently. There's no /etc/fonts/local.conf. Firefox version: "Version 92.0.1 (64-bit)".

I checked some pages https://bbs.archlinux.org/viewtopic.php?id=123470 and https://bbs.archlinux.org/viewtopic.php?id=241589 and https://bbs.archlinux.org/viewtopic.php?id=229987, there's no other suggestions.

Any idea what could be wrong?


---

Adding an explicit replacement entry to /etc/fonts/local.conf helps, but why doesn't Firefox use the correct one by default given fc-match can?

Last edited by k395 (2021-12-18 14:04:43)

Offline

#2 2021-12-18 15:24:39

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

Re: Firefox does not use fallback font?

/usr/share/fontconfig/conf.avail/45-latin.conf

        <alias>
                <family>Consolas</family>
                <default><family>monospace</family></default>
        </alias>
fc-match monospace

Offline

#3 2021-12-26 08:39:47

k395
Member
Registered: 2020-01-29
Posts: 37

Re: Firefox does not use fallback font?

These 4 lines are present in the file /usr/share/fontconfig/conf.avail/45-latin.conf, I haven't made any modification.

(Without local.conf,)

$ fc-match "Consolas"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

as expected.

Offline

#4 2021-12-26 09:04:27

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

Re: Firefox does not use fallback font?

The browser settings allow you to configure fonts, https://support.mozilla.org/en-US/kb/ch … bsites-use
What's configured for monospace fonts there?

Offline

Board footer

Powered by FluxBB