In Ubuntu 18.04.3, Firefox does not render text in the fonts specified
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Tracking
()
People
(Reporter: yangfanli43+bugzilla.contact.only, Unassigned)
Details
Attachments
(1 file)
|
80.51 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
- Download the stock Lubuntu 18.04.2 (64-bit) ISO and open it in VirtualBox
- Disconnect the virtual machine from the Internet
- For the best effect, do a "full install" of Lubuntu 18.04.2 in simplified Chinese, but:
(1) Do not install updates.
(2) Do not connect the virtual machine to the internet.
(3) I did not install "additional language features." - When everything is done, boot up the virtual machine
- Go to design.ubuntu.com/font in private mode and observe the fonts in "Ubuntu condensed." It should look, as expected, condensed. (Firefox 65)
- Close Firefox completely.
- sudo apt update && sudo apt install firefox (Now firefox is 69.0)
- Go to design.ubuntu.com/font in private mode and observe the fonts in Ubuntu condensed. It should look, as expected, condensed. (Firefox 65)
- Close Firefox completely.
- sudo apt update && sudo apt upgrade (Now the whole system is upgraded to 18.04.3)
- Go to design.ubuntu.com/font in private mode and observe the fonts in Ubuntu condensed. It now looks like serif. (Bad)
- This abnormality can also be observed directly in a 18.04.3 live CD.
See also my question on launchpad:
https://answers.launchpad.net/ubuntu/+source/fonts-noto-cjk/+question/682214
Actual results:
Firefox 69 on Ubuntu 18.04.3 cannot render text in the fonts specified in stylesheets or Firefox preferences, even if the fonts are installed.
Expected results:
Firefox 69 on Ubuntu 18.04.3 should render text in the fonts specified in stylesheets or Firefox preferences, if the fonts are installed.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
So looks like this bug happens after 18.04.3 in VirtualBox? Is it possible to reproduce this in Firefox 65 in ubuntu(or lubuntu) 18.04.3?
BTW, it'd be great to attach the screenshots.
| Reporter | ||
Comment 2•6 years ago
|
||
Here is a screenshot. Firefox is at version 69.0.3. The other browser is Chromium 77.0.3865.90.
The fallback serif font in Firefox is "AR PL UMing CN" no matter how I change the font settings in about:preferences or specify it in a stylesheet, unless the font is a webfont.
Here is my fc-match output:
$ fc-match sans-serif
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"
$ fc-match serif
uming.ttc: "AR PL UMing CN" "Light"
$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$ fc-match "Liberation Sans"
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"
$ fc-match "Liberation Serif"
LiberationSerif-Regular.ttf: "Liberation Serif" "Regular"
Here is the test case:
<html>
<head>
<style>
.sans {
font-family: "Liberation Sans", "Ubuntu", "DejaVu Sans", sans-serif;
}
.serif {
font-family: "Liberation Serif", "DejaVu Serif", serif;
}
.monospace {
font-family: "Hack", "Liberation Mono", "Ubuntu Mono", monospace;
}
</style>
</head>
<body>
<p class="sans">Sans font test</p>
<p class="serif">Serif font test</p>
<p class="monospace">Monospace font test</p>
</body>
</html>
Comment 3•6 years ago
|
||
| Reporter | ||
Comment 4•6 years ago
|
||
Yes. The same behavior as in the screenshot is seen in Firefox 65.0.2 (downloaded from https://ftp.mozilla.org/pub/firefox/releases/65.0.2/linux-x86_64/en-US/firefox-65.0.2.tar.bz2)
Comment 5•6 years ago
|
||
Do the expected font families (such as Liberation Serif) all show up in the font menu in Preferences, so that they can be selected there?
I wonder if somehow content-process sandboxing is making them unavailable to the content. If you go to about:config and set security.sandbox.content.level to 0 (temporarily, for testing) and then quit and restart Firefox, does that make any difference? (You'll probably want to restore the default value after testing.)
| Reporter | ||
Comment 6•6 years ago
|
||
Liberation Serif do show up in the Preferences, and no, changing security.sandbox.content.level to 0 does not make any difference.
| Reporter | ||
Comment 7•6 years ago
|
||
This bug still exists in Firefox 72. I have a workaround: by changing the priority of fallback fonts, I can influence the font choice of Firefox. The config file below changes not only the web page font, but also the interface font in Firefox. For example, the menubar font changed to "Ubuntu" as well. However, for other GTK programs (Emacs, GIMP, Dr. Racket), the menubar font is not affected -- it still the default font specified in KDE Plasma settings.
Screenshot (note the "l" and "t" in each window)
$ cat ~/.config/fontconfig/conf.d/50_priority.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- https://forum.manjaro.org/t/how-to-resort-font-priority-matches-monospace/72167/4 -->
<match target="pattern">
<test name="family" qual="any">
<string>monospace</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Ubuntu Mono</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>sans-serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Ubuntu</string>
</edit>
</match>
</fontconfig>
Comment 8•5 years ago
|
||
(In reply to YF L from comment #7)
This bug still exists in Firefox 72. I have a workaround: by changing the priority of fallback fonts, I can influence the font choice of Firefox. The config file below changes not only the web page font, but also the interface font in Firefox. For example, the menubar font changed to "Ubuntu" as well. However, for other GTK programs (Emacs, GIMP, Dr. Racket), the menubar font is not affected -- it still the default font specified in KDE Plasma settings.
Screenshot (note the "l" and "t" in each window)
$ cat ~/.config/fontconfig/conf.d/50_priority.conf <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- https://forum.manjaro.org/t/how-to-resort-font-priority-matches-monospace/72167/4 --> <match target="pattern"> <test name="family" qual="any"> <string>monospace</string> </test> <edit binding="strong" mode="prepend" name="family"> <string>Ubuntu Mono</string> </edit> </match> <match target="pattern"> <test name="family" qual="any"> <string>serif</string> </test> <edit binding="strong" mode="prepend" name="family"> <string>DejaVu Serif</string> </edit> </match> <match target="pattern"> <test name="family" qual="any"> <string>sans-serif</string> </test> <edit binding="strong" mode="prepend" name="family"> <string>Ubuntu</string> </edit> </match> </fontconfig>
I can confirm that I encountered the same thing in Linux Mint 19.3 with the latest Firefox 77.0.1.
After applying the method proposed by YF L, the problem has gone away.
I use F12 in Firefox to open ``debug window'' and I found that the default font is "AR PL UMing CN". Before I use the 50_priority.conf, no matter how I change the font settings in about:preferences, Firefox will ignore all request and just use "AR PL UMing CN". Choosing allow website to choose its own fonts or not also has no effect.
Updated•3 years ago
|
Description
•