News for hackers. Stuff that matters.
Re:Google Logo Ligature Bug by sublinear on Sunday May 18, 2025 @11:13AM (#44021974)
> Fonts can include "ligatures", which let font designers special-case specific combinations of letters ... but the feature has been (ab)used for many other things

Same reason to not use ligatures in your IDE, terminal, etc.

Did that trend finally die off?

Re:Google Logo Ligature Bug by nine_k on Sunday May 18, 2025 @11:24AM (#44022047)
Ligatures that give slightly stylized rendering to stuff like <!-- or even replace a >= with a ≥ in your source code view are much less prone to exploitation than a "ligature" that replaces a 18-letter sequence with the word "Google" in your browser's address bar. It's like comparing the hazardousness levels of a safety pin and of a chainsaw.
Re:Google Logo Ligature Bug by kstrauser on Sunday May 18, 2025 @11:44AM (#44022186)
Fortunately, no. They’re increasingly well supported for the user base who think they look nice… like me.

I love the way my code looks in Berkeley Mono on any modern editor version. Seeing `>=` render similar to `≥` makes me smile. It’s a tiny visual tweak that doesn’t even cause anything to move on the screen, because that font’s ligatures are the same width as the characters they replace. I see no downside to it for me.

Re:Google Logo Ligature Bug by layer8 on Sunday May 18, 2025 @01:15PM (#44022839)
Personally, I find an extra-wide “≥” more ugly and jarring than “>=“. If anything, I would prefer programming languages to understand the actual Unicode “≥”, and people learning how type that (Compose key, dedicated IDE support, or whatever). It would be nice for more people to appreciate that the characters one can type aren’t limited to the symbols printed on the keyboard.
Re:Google Logo Ligature Bug by kstrauser on Sunday May 18, 2025 @01:38PM (#44023016)
Every editor and language I use is fine with Unicode in files, but I don’t know if that’s true for everyone I collaborate with. Sure, I can type all those symbols, but can they? Does a screen reader pronounce them reasonably? Do they render correctly in GitHub’s web source code viewers? Will I ever get as fast typing composed characters as just pressing `>=`? Does everyone use a font that supports those codepoints? I don’t know. Probably, but who can tell? I tend to limit non-ASCII text to inside quoted strings and use exclusively ASCII-compatible codes for all identifiers.

But the great part about ligatures is that I can use fonts that support them and enable them in my editors because I think they look pretty. Anyone who doesn’t like their appearance can just not use them. We can both have editors that look nice to ourselves without making the other’s editors look worse. How often can we say that?

Re:Google Logo Ligature Bug by layer8 on Sunday May 18, 2025 @02:37PM (#44023429)
This is sort of my point: I would wish for the world to move towards typing Unicode symbols being a normal thing. That would also imply screen readers properly handling those (if they don’t already). What I don’t like is source code being rendered as something different than the actual printable characters it consists of.

I’m not disputing your preference, I was just stating mine. I do prefer “≥” over “>=“, but not in the form of a double-width ligature that is still “>=“ under the hood.

> Will I ever get as fast typing composed characters as just pressing `>=`?

Typing “>=” usually involves pressing three keys. The same can be true with Compose.

That’s not to say that there isn’t some trade-off in some cases. But the frequently used symbols can be prioritized, and it opens up a vastly larger repertoire of characters you can type. I routinely type foreign languages with accents and other non-ASCII letters using Compose, and it has become muscle memory.

Re:Google Logo Ligature Bug by cubefox on Sunday May 18, 2025 @06:07PM (#44024654)
The IDE could also do an automated ASCII to Unicode replacement for certain strings of characters if they are supported in a language, similar to how Microsoft Word automatically replaces (R) with ®, or the like.
Re:Google Logo Ligature Bug by em-bee on Sunday May 18, 2025 @06:53PM (#44024908)
in vim i can define abbreviations like this:

    :iabbr >= ≥
then, when typing ">=" it will automatically be converted to "≥" as soon as i hit space.
Re:Google Logo Ligature Bug by cubefox on Monday May 19, 2025 @12:54PM (#44031832)
Exactly. Though in an IDE it should only be done depending on whether the current language supports the Unicode operators in question. And ideally the replacement shouldn't happen when editing string literals. Though perhaps that is asking for too much.
Re:Google Logo Ligature Bug by em-bee on Monday May 19, 2025 @07:49PM (#44036245)
in vim you can make these definitions dependent on the file type, which is also used to detect languages for eg syntax highlighting. so it's certainly possibly to define these only for a specific language. it should even be possible to define it based on the syntax detected: https://superuser.com/questions/487603/abbreviations-overrid...
Re:Google Logo Ligature Bug by AStonesThrow on Sunday May 18, 2025 @02:02PM (#44023191)
> Does a screen reader pronounce them reasonably?

I've been pushing the limits of emoji/Unicode recognition where I try to input it in an app or while communicating with others, and see what happens.

It's especially fun to use Emoji in the "favorite lists" for rideshare apps. In particular, each of my Favorite Waymo Destinations is accompanied by 3-5 Emoji which identify the unique spot or its category.

The really amusing part is that the Waymo car itself verbally reads off the destination when it gets underway. So the Emojis are translated into English and rattled off uncritically, but accurately, including incidentals like which skin-tones were chosen. It makes me giggle; I haven't found any unpronounceable glyphs yet!

Re:Google Logo Ligature Bug by jasonthorsness on Sunday May 18, 2025 @11:33AM (#44022114)
My great fear is they will become so popular that the option to disable them will be forgotten. I can’t stand the ligatures that noticeably change and merge the glyphs.
Re:Google Logo Ligature Bug by wbl on Sunday May 18, 2025 @11:49AM (#44022228)
Have you ever read a book typeset without them? Imagine a dot in fig where the loop of the f conflicts.
Re:Google Logo Ligature Bug by toast0 on Sunday May 18, 2025 @12:07PM (#44022337)
I like the dotted i in fig, thank you. Not a big fan of underlines that don't cross descendeds either.
Re:Google Logo Ligature Bug by jasonthorsness on Sunday May 18, 2025 @11:55AM (#44022254)
Those historical use cases are fine and important, the problem ones are the ones in monospace fonts that change <= to ≤ and that sort of thing, or even crazier abuses like shown here.
Re:Google Logo Ligature Bug by immibis on Sunday May 18, 2025 @02:45PM (#44023468)
Ligatures should not be used in monospaced fonts, for obvious reasons.
Re:Google Logo Ligature Bug by jefftk on Sunday May 18, 2025 @10:53PM (#44026184)
I would be ok with the equivalent of the "fi" ligature, where two letters would be drawn slightly differently when next to each other.
Re:Google Logo Ligature Bug by immibis on Monday May 19, 2025 @12:54AM (#44026603)
Why? Monospaced characters fit in their separate cells.
Re:Google Logo Ligature Bug by Hasnep on Monday May 19, 2025 @06:26AM (#44028244)
If the ligature takes up the same horizontal space as the characters it represents, then I don't see why not.
Re:Google Logo Ligature Bug by underrun on Monday May 19, 2025 @01:12PM (#44032090)
hard disagree. i use monospace fonts with ligatures for programming. primarily i get things like -> rendered as a full arrow or == connected or ... as an actual ellipsis. it's subtle but it's nice.

I've also seen nice use of ligature for markdown formatting.

the idea that ligatures shouldn't be used with monospace fonts would also break monospace in multiple languages as some languages require ligatures to display single characters correctly.