Hacker News new | ask | show | jobs
by abcd_f 1 day ago
They should be opt-in.
2 comments

I agree, but FWIW it is pretty easy to disable ligatures system-wide with font config. Just drop this into ~/.config/fontconfig/conf.d/99-disable-ligatures.conf:

  <?xml version="1.0"?>
  <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
  <fontconfig>
    <description>Disable ligatures</description>
    <match target="font">
      <edit name="fontfeatures" mode="append">
        <string>liga off</string>
        <string>dlig off</string>
        <string>rlig off</string>
      </edit>
    </match>
  </fontconfig>
(this naturally assumes you're using Linux. I have no idea what the closed source world uses for configuring fonts.)
Won't that disable the real ligatures in non-monospaced fonts?
Yeah, you can change the block to filter to specific fonts or font families if you want. For example, in my configs I only apply that setting to the Cascadia Code font by doing:

  <match target="font">
    <test name="family" compare="eq" ignore-blanks="true">
      <string>Cascadia Code</string>
    </test>
    <edit name="fontfeatures" mode="append">
      <string>liga off</string>
      <string>dlig off</string>
      <string>rlig off</string>
    </edit>
  </match>
If your client does not allow to enable or disable ligatures, you should really pick a better program
Terminals are often the place ligatures are most frustrating. In a text editor (vim, micro, etc.) or coding agent, ligatures can be nice. But general terminal use makes it annoying (hexdump output collapsing `..` into a multi-character ligature almost always looks wrong.)
in what world is it preferable to have != look like ≠ (but still be != under the hood)?

if you want ≠ then type ≠

This is subjective. When writing code, I generally find ≠ more readable and my brain still automatically parses that it's actually !=. I've never had any problem with that. But I can see why others would feel differently. This is why code editors generally allow enabling / disabling ligatures.
i much rather be able to compose symbols with regular characters than to remember escape sequences for everything.
You can configure Compose in Linux (sadly not supported in all environments). For example, I can press AltGr and type -> and I get →. Just one extra keypress.
In Windows, you can use WinCompose, which takes X11-style compose files. You can do something the same in MacOS, using a script called compose2keybindings, and using Karabiner to rebind a Compose key. I do not know of similar solutions for Android and iOS.
abcd_f is complaining that, with this font, you have to enable or disable “no ligatures”. That, in their and my opinion, is the wrong way around, especially for a monospaced font.
Sheee-it, I'd rather pick a better font, instead.
It's not a client/viewer capability thing, it's an ambiguity & consistency thing. For any data, code, commandlines, there should be a glyph and a cell for every byte and the same for every byte.

Ligatures are only reasonable in places where proportional fonts would be or full latex math formulas, and that is not in code or terminals, nor data like password managers.