Ligatures in monospace fonts hurt legibility of config keys
The choice of the font in app/assets/stylesheets/variables.scss for the rule:
$fixed-width-font-family: Courier, monospace;
can make it harder to read some of the text in the documentation. This is especially applicable to the names of the configuration keys and to mentions of the shell commands, which people would usually edit in a text editor or in a shell with a monospace font. Fonts used by <code> tags are also affected.
URL for broken page
Example: https://git-scm.com/docs/git-config
Problem
Ligatures in the fonts for the Courier in CSS make it harder to read parts of the website.
Operating system and browser
Operating System: KDE neon 5.27 (≈ Kubuntu 22.04)
Browser: Firefox 119.0
Steps to reproduce
- Look at mentions of
reflogin monospace font on page https://git-scm.com/docs/git-config#Documentation/git-config.txt-gcreflogExpireUnreachable
Other details
- Adding CSS code:
fixes the instances highlighted on the screenshot above:font-variant-ligatures: none; - Other examples:
- mention of
color.diff.new - mention of
git configThese styled via
<code>.
- mention of
- MDN documentation for
font-variant-ligatures - In my setup, these CSS rules for Courier actually end up using Nimbus Mono PS. This is caused by config file
/etc/fonts/conf.avail/30-metric-aliases.conf, quote:
See also Arch Linux wiki article about it.<alias binding="same"> <family>Nimbus Mono PS</family> <default> <family>Courier</family> </default> </alias>
https://github.com/ArtifexSoftware/urw-base35-fonts/issues/31
font-variant-ligatures: none; seems like a good fix, until various monospace fonts stop shipping this sort of ligature