Open Bug 1547743 Opened 6 years ago Updated 1 year ago

Helvetica matches to "DejaVu Sans" instead of "Liberation Sans" on Ubuntu 18.04

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

People

(Reporter: jrmuizel, Unassigned, NeedInfo)

Details

Attachments

(1 file)

Attached file test.html

Running fc-match Helvetica correctly gives "Liberation Sans" so it seems like there's something that Firefox is doing wrong. Chrome also correctly uses "Liberation Sans".

Any thoughts as to why this would be happening Jonathan?

Flags: needinfo?(jfkthame)

More information needed: we'd need to look at the fontconfig rules that are present on the system. What specifies that Liberation Sans should be used to satisfy a request for Helvetica?

Flags: needinfo?(jfkthame) → needinfo?(jmuizelaar)

It looks like it's the following rules:

        <alias>
          <family>Helvetica</family>
          <default>
          <family>Arial</family>
          </default>
        </alias>

        <alias binding="same">
          <family>Arial</family>
          <accept>
            <family>Arimo</family>
            <family>Liberation Sans</family>
            <family>Albany</family>
            <family>Albany AMT</family>
          </accept>
        </alias>

from https://github.com/behdad/fontconfig/blob/master/conf.d/30-metric-aliases.conf

Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jfkthame)

Huh, interesting. Looks like maybe we don't follow the multiple levels of aliasing properly. Has it always behaved like this, or is this a regression?

Flags: needinfo?(jfkthame)

I have no idea if this is a regression or not.

We'll need to re-implement some of the fontconfig integration stuff anyhow to work with the cross-process font list from bug 1514869, so maybe we can handle this better there.

Priority: -- → P3

This specific case might not be an issue anymore... If I'm reading correctly, it looks to me like https://github.com/behdad/fontconfig/blob/master/conf.d/30-metric-aliases.conf now maps Helvetica to Nimbus Sans, and that's indeed the font that our devtools report us using with the attached testcase. (And that's what fc-match Helvetica gives me as well.)

jrmuizel/jfkthame: perhaps we should close this as WFM?

Flags: needinfo?(jmuizelaar)
Severity: normal → S3

I've filed bug 1794822 with a similar issue regarding the picking and rendering of fonts on Ubuntu 22.04. The new demonstrates that Firefox picks "Nimbus Sans" incorrectly, and also renders it poorly, which causes layout issues.

(In reply to Brian Peiris from comment #8)

bug 1794822 [...] demonstrates that Firefox picks "Nimbus Sans" incorrectly, and also renders it poorly, which causes layout issues.

Two clarifications after some discussion on that bug:

  • fc-match Helvetica still returns Nimbus Sans on stock Ubuntu 22.04 (for me at least). Brian Peiris notes over there that he's made some local font config file edits which result in fc-match returning Liberation Sans instead, but Firefox still uses Nimbus Sans for him, and that's the issue.
  • Firefox isn't actually rendering the font poorly; the minor layout issues are just characteristics of the font, and they happen regardless of browser, as long as the text is rendered with this particular font.

I'm experiencing this problem on NixOS – Helvetica is getting mapped to my "default font" as set in about:preferences (which defaults to DejaVu Sans). fc-match Helvetica returns Liberation Sans.

The relevant file in my case looks like /etc/fonts/conf.d/30-metric-aliases.conf, which seems similar to/the same as https://github.com/behdad/fontconfig/blob/master/conf.d/30-metric-aliases.conf mentioned previously.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: