[snap] New Ubuntu font with normal weight displayed as bold in Google Docs in Chromium after upgrading to Lunar

Bug #2019045 reported by Andrea Ieri
58
This bug affects 9 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Triaged
Low
Unassigned
fonts-ubuntu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I am experiencing a rendering regression after upgrading from Kinetic to Lunar.
Google Docs using the Ubuntu font family are displayed incorrectly in Chromium: the normal weight font is rendered identically to the bold weight one, instead of being thicker than light and thinner than medium.

Printing is also affected, unless I use Google Docs' download to PDF function, although that probably triggers a server-side rendering.

This issue does not occur in Firefox or Google Chrome.

One thing that may be relevant: if I force-refresh my test Google Doc I see all four Ubuntu font lines initially being rendered as bold. The light and medium lines are then re-rendered with the correct weight. It's as if bold was the default weight and the normal variant disappeared.

As far as I can tell I was already running Chromium 112.0.5615.49 in Kinetic, and with Chromium being a snap I don't quite understand why the Ubuntu series would matter.

I have also tried version 114.0.5735.16 (in latest/beta at the moment); the symptoms are identical.

The attachments show the rendering error.

Tags: lunar
Revision history for this message
Andrea Ieri (aieri) wrote :
Revision history for this message
Andrea Ieri (aieri) wrote :
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I can confirm this with the new font 0.863-0ubuntu3, though not with the 0.83-6ubuntu1.

Changed in chromium-browser (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
summary: - [snap] Ubuntu font with normal weight displayed incorrectly in Google
- Docs after upgrading to Lunar
+ [snap] New Ubuntu font with normal weight displayed as bold in Google
+ Docs in Chromium after upgrading to Lunar
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in fonts-ubuntu (Ubuntu):
status: New → Confirmed
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

> One thing that may be relevant: if I force-refresh my test Google Doc I see all four Ubuntu font lines initially being rendered as bold. The light and medium lines are then re-rendered with the correct weight. It's as if bold was the default weight and the normal variant disappeared.

Interesting observation, I can reproduce that.

> As far as I can tell I was already running Chromium 112.0.5615.49 in Kinetic, and with Chromium being a snap I don't quite understand why the Ubuntu series would matter.

Because Ubuntu Lunar uses the 0.83-6ubuntu1 while older releases are currently on the older 0.863-0ubuntu3.

description: updated
tags: added: lunar
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Andreas noticed in the duplicate report that

> The chromium console log also shows a lot of these 404 errors for *.woff2 fonts:
>
> GET filesystem:https://docs.google.com/persistent/docs/fonts/KFO8CneDtsqEr0keqCMhbCc_Mn33tY0.woff2 net::ERR_FILE_NOT_FOUND

Revision history for this message
Andrea Ieri (aieri) wrote :

I can confirm this is still happening in mantic, using the following versions:

chromium 118.0.5993.88
fonts-ubuntu 0.869-0ubuntu1

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Workaround:

  apt install fonts-ubuntu- fonts-ubuntu-classic

Revision history for this message
Nathan Teodosio (nteodosio) wrote (last edit ):

The new font relies on some different mechanism to determine the style of a given typeface, as each different style points to a same file. The old font doesn't do that. Maybe that could be tripping the resolution.

--->
# ubuntu-fonts
lrwxrwxrwx 1 root root 20 jun 21 10:35 UbuntuMono-B.ttf -> 'UbuntuMono[wght].ttf'
lrwxrwxrwx 1 root root 27 jun 21 10:35 UbuntuMono-BI.ttf -> 'UbuntuMono-Italic[wght].ttf'
-rw-r--r-- 1 root root 169K mar 24 2023 'UbuntuMono-Italic[wght].ttf'
lrwxrwxrwx 1 root root 20 jun 21 10:35 UbuntuMono-R.ttf -> 'UbuntuMono[wght].ttf'
lrwxrwxrwx 1 root root 27 jun 21 10:35 UbuntuMono-RI.ttf -> 'UbuntuMono-Italic[wght].ttf'
-rw-r--r-- 1 root root 169K mar 24 2023 'UbuntuMono[wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-B.ttf -> 'Ubuntu[wdth,wght].ttf'
lrwxrwxrwx 1 root root 28 jun 21 10:35 Ubuntu-BI.ttf -> 'Ubuntu-Italic[wdth,wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-C.ttf -> 'Ubuntu[wdth,wght].ttf'
-rw-r--r-- 1 root root 664K jun 21 10:34 'Ubuntu-Italic[wdth,wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-L.ttf -> 'Ubuntu[wdth,wght].ttf'
lrwxrwxrwx 1 root root 28 jun 21 10:35 Ubuntu-LI.ttf -> 'Ubuntu-Italic[wdth,wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-M.ttf -> 'Ubuntu[wdth,wght].ttf'
lrwxrwxrwx 1 root root 28 jun 21 10:35 Ubuntu-MI.ttf -> 'Ubuntu-Italic[wdth,wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-R.ttf -> 'Ubuntu[wdth,wght].ttf'
lrwxrwxrwx 1 root root 28 jun 21 10:35 Ubuntu-RI.ttf -> 'Ubuntu-Italic[wdth,wght].ttf'
lrwxrwxrwx 1 root root 21 jun 21 10:35 Ubuntu-Th.ttf -> 'Ubuntu[wdth,wght].ttf'
-rw-r--r-- 1 root root 1,1M jun 21 10:34 'Ubuntu[wdth,wght].ttf'

# ubuntu-fonts-classic
-rw-r--r-- 1 root root 187K set 26 2011 UbuntuMono-B.ttf
-rw-r--r-- 1 root root 212K set 26 2011 UbuntuMono-BI.ttf
-rw-r--r-- 1 root root 201K set 26 2011 UbuntuMono-R.ttf
-rw-r--r-- 1 root root 206K set 26 2011 UbuntuMono-RI.ttf
-rw-r--r-- 1 root root 326K jul 10 2015 Ubuntu-B.ttf
-rw-r--r-- 1 root root 349K jul 10 2015 Ubuntu-BI.ttf
-rw-r--r-- 1 root root 343K jul 10 2015 Ubuntu-C.ttf
-rw-r--r-- 1 root root 406K jul 10 2015 Ubuntu-L.ttf
-rw-r--r-- 1 root root 401K jul 10 2015 Ubuntu-LI.ttf
-rw-r--r-- 1 root root 334K jul 10 2015 Ubuntu-M.ttf
-rw-r--r-- 1 root root 359K jul 10 2015 Ubuntu-MI.ttf
-rw-r--r-- 1 root root 346K jul 10 2015 Ubuntu-R.ttf
-rw-r--r-- 1 root root 378K jul 10 2015 Ubuntu-RI.ttf
-rw-r--r-- 1 root root 235K fev 18 2022 Ubuntu-Th.ttf
<---

Edit: The symlinks can be deleted, they are meant just for a smooth upgrade mechanism, and have no effect in the problem here described.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Bold renders fine given simple CSS:

<html>
  <p style="font-family:ubuntu">Ubuntu.</p>
  <p style="font-family:ubuntu"><b>Ubuntu bold.</b></p>
</html>

This looks specific to Google Docs.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I installed ubuntu-fonts-classic from mantic on my lunar desktop (it's not available for lunar). It removed ubuntu-fonts, but the fonts look ok now in google docs. Got some differences in my desktop too, but still looks ok.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

More information dump:

* It's easier to see the error Andreas mentioned with --enable-logging=stderr:

--->
[246126:246235:1023/123348.818876:WARNING:obfuscated_file_util.cc(1323)] Failed to get origin+type directory: { uri: filesystem:https://docs.google.com/persistent/docs/fonts/4iCv6KVjbNBYlgoCxCvTsg.woff2, storage key: { origin: https://docs.google.com, top-level site: https://google.com, nonce: <null>, ancestor chain bit: Same-Site } } error:-4
[246126:246235:1023/123348.818941:WARNING:obfuscated_file_util.cc(1323)] Failed to get origin+type directory: { uri: filesystem:https://docs.google.com/persistent/docs/fonts/4iCp6KVjbNBYlgoKejZPsmyN.woff2, storage key: { origin: https://docs.google.com, top-level site: https://google.com, nonce: <null>, ancestor chain bit: Same-Site } } error:-4
<---

I don't quite understand the process there, an uneducated guess: It is trying to fetch a font and then storing it using the filesystem API — which would save it in snap/chromium/common/chromium/Default/File\ Systems but that directory doesn't even exist. Maybe Firefox's implementation differs from Chromium's critically enough to hit this bug. Disabling that with --disable-file-system has no effect.

* Docs uses a remote font instead of a system font because --disable-remote-fonts prevents the Ubuntu font from loading despite it still being listed (the 't' character is a giveaway). This is in line with the error message.

* Since we don't get the problem in Firefox, I tried switching the user agent to Firefox just to see if behavior changed; it didn't.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I doubt this is relevant — it was long ago and before any snap was used by default — but I recall that when we started to use Noto fonts for CJK languages in Xenial, there was initially an issue in Chrome/Chromium where it used the wrong weight if the font file included multiple weights (bug #1575555). The Debian/Ubuntu resolution to that issue was to switch to another font packaging model, where one font file per weight was used.

We also reported it as a font issue, but that didn't lead to anything:
https://github.com/notofonts/noto-cjk/issues/65

This Ubuntu font issue is also about Chromium and font files with multiple weights...

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Thanks for your input Gunnar, that might be really playing a role in the problem.

After all, it turns out the error Andreas reported is also present when the behavior is correct, i.e. with ubuntu-fonts-classic I get

--->
Failed to get origin+type directory: { uri: filesystem:https://docs.google.com/persistent/docs/fonts/4iCs6KVjbNBYlgo6fQ.woff2, storage key: { origin: https://docs.google.com, top-level site: https://google.com, nonce: <null>, ancestor chain bit: Same-Site } } error:-4
<---

Changed in chromium-browser (Ubuntu):
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.