Bug 2021366 - Nimbus Mono PS font should not fc-match Courier, as certain letter combinations are not monospaced
Summary: Nimbus Mono PS font should not fc-match Courier, as certain letter combinatio...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: urw-base35-fonts
Version: 35
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Lescak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-09 01:28 UTC by skierpage
Modified: 2022-05-27 01:12 UTC (History)
4 users (show)

Fixed In Version: urw-base35-fonts-20200910-11.fc36 urw-base35-fonts-20200910-11.fc35
Clone Of:
Environment:
Last Closed: 2022-05-24 02:42:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
look at "affiliation" (47.57 KB, image/png)
2021-11-09 01:28 UTC, skierpage
no flags Details

Description skierpage 2021-11-09 01:28:03 UTC
Created attachment 1840789 [details]
look at "affiliation"

Description of problem:
I visited https://schema.org/Person in Firefox in Fedora 35 KDE spin and noticed the monospace text "affiliation" was not monospaced; the letters "ffi" were on top of each other as if replaced by the ligature ffi.

The page CSS is styling the <code> tag "font-family: Courier, monospace;", and in Fedora 35 KDE Spin `fc-match Courier` returns
   NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"
indeed, if I set font-family to "Nimbus Mono PS" in some simple HTML https://www.skierpage.com/bugs/nimbusmono_not_monospaced.html , other ff combinations are also "ligature-ized".

I tried these two URLs in the chromium-browser package and in the Epiphany and Konqueror browser flatpaks. These did not use "Nimbus Mono PS" as the fallback font for font-family "Courier" so did not display "affiliation" badly on the Person web page, but if you specify font-family "Nimbus Mono PS", you get the ligature.

Version-Release number of selected component (if applicable):
Mozilla Firefox 94.0
urw-base35-fonts-20200910-9.fc35.src.rpm

How reproducible:
Always. 

Steps to Reproduce:
1. Visit https://schema.org/Person and https://www.skierpage.com/bugs/nimbusmono_not_monospaced.html in Firefox and other browsers.
2. Note how "ffi" appears.

Actual results:
Firefox uses "Nimbus Mono PS" as the fallback for font-family Courier; all these browsers replace "ffi" and such with the ligature character in "Nimbus Mono PS", destroying the desired monospace effect.


Expected results:
Monospaced fonts should appear... monospaced, so every character should occupy the same amount of horizontal space. However, if a font provides ligature glyphs for "ffi" and such, then it's unclear if it's wrong for the browser to use them; (l33t developers now explicitly use monospaced coding fonts that do wacky substitutions.)

So the fix could be for Firefox and/or fc-match to _not_ use Nimbus Mono PS when  text handling requests Courier. The other browsers on my system don't, I'm not sure why. Another could be to remove the ligatures from Nimbus Mono PS.

Additional info:

The rendering of code on that page (see attachment) is pretty terrible, note the oversized 'd's in "address". Another reason to have Courier match some other monospaced font than Nimbus Mono PS.

You can use the Fontmatrix program to enable OpenType features; checking latn > dflt > liga changes the display of "ff" combinations.

Firefox using ligatures in monospaced fonts is https://bugzilla.mozilla.org/show_bug.cgi?id=384395 , was closed WONTFIX "We can't really do anything about it -- the underlying text system is doing the ligaturization, not us".

ArchLinux users discussed the problem in https://bbs.archlinux.org/viewtopic.php?id=238832

Comment 1 Akira TAGOH 2022-04-18 05:48:19 UTC
Simple test case is here:
$ pango-view --markup -t "<span font_desc=\"Nimbus Mono PS 24\"><span font_features=\"liga on\">ffl fi</span>
<span font_features=\"liga off\">ffl fi</span></span>"

> Firefox using ligatures in monospaced fonts is https://bugzilla.mozilla.org/show_bug.cgi?id=384395 , was closed WONTFIX "We can't really do anything about it -- the underlying text system is doing the ligaturization, not us".

That's true. and this isn't an issue in the text rendering library as well. the feature is provided by the font itself. the above test case demonstrates it.

Reassigning this to urw-base35-fonts.

Comment 2 Fedora Update System 2022-05-18 09:30:23 UTC
FEDORA-2022-a34b2d658d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a34b2d658d

Comment 3 Fedora Update System 2022-05-18 09:39:38 UTC
FEDORA-2022-81cf5ced22 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-81cf5ced22

Comment 4 Richard Lescak 2022-05-18 10:16:38 UTC
Hi,

thanks for the reproducer.

Unfortunately disabled ligatures won't work for Firefox.
I've substituted 'Courier/Nimbus Mono' with 'Dejavu Sans Mono' to fix the problem.

Comment 5 Fedora Update System 2022-05-19 15:37:19 UTC
FEDORA-2022-a34b2d658d has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-a34b2d658d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a34b2d658d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-05-19 15:43:08 UTC
FEDORA-2022-81cf5ced22 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-81cf5ced22`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-81cf5ced22

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-05-24 02:42:07 UTC
FEDORA-2022-a34b2d658d has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2022-05-27 01:12:15 UTC
FEDORA-2022-81cf5ced22 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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