News for hackers. Stuff that matters.
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @04:23AM (#35926624)
Just was wondering if today anyone is still using them, so I guess that does not need to be asked.

All right, oh my captain, keep the indents and spacing tight on the monospace and sail along!

Btw., anyone still using monospaced fonts in their editors?

Re:Ligatures in programming fonts: hell no by lionkor on Saturday May 13, 2023 @04:34AM (#35926667)
i program in wingdings
Re:Ligatures in programming fonts: hell no by teo_zero on Saturday May 13, 2023 @05:17AM (#35926834)
> anyone still using monospaced fonts in their editors?

The question is aren't you?

Re:Ligatures in programming fonts: hell no by vonseel on Saturday May 13, 2023 @07:02AM (#35927250)
Doesn't everyone? I can't stand not using monospaced fonts when coding
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:11AM (#35927289)
Just checking ... my current IDE ... not for all parts of the source-code any longer.

I'm not so sure if I want that, maybe I get dumb by it?!

Re:Ligatures in programming fonts: hell no by xupybd on Saturday May 13, 2023 @07:46AM (#35927460)
I tried coding in a variable font. It was horrible. I couldn't read the code. I was shocked at how much my brain made use of the spacing to parse code.
Re:Ligatures in programming fonts: hell no by lucumo on Saturday May 13, 2023 @11:32AM (#35929343)
Yes, same.

It's weird in a way, because there isn't all that much alignment going on in my code[1]. There's indentation, but that still works with a proportional font. And yet, it still looks wrong and hard to read. I can't really figure out why.

[1] I know some people align assignments in multiple lines, or comments at the end of the line, or similar things. I've been working under code style directives that prohibited those because lines changed more often because of whitespace than because of content. Since my work requires me not to do that, I don't have the habit at home either.

Re:Ligatures in programming fonts: hell no by marssaxman on Saturday May 13, 2023 @02:43PM (#35931362)
Code really is not prose! We use so many skinny punctuation marks that have big structural significance, and variable-width fonts de-emphasize them. I want my commas and brackets made clear and obvious, please.

I did actually spend a year or two coding in a variable-width font, back in the '90s, but I switched back after the novelty wore off.

Re:Ligatures in programming fonts: hell no by Zecc on Saturday May 13, 2023 @05:33AM (#35926897)
I don't use ASCII-art often in source code, but when I do (or when I'm reading code from someone who has), I prefer if the characters align correctly.
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:13AM (#35927297)
And then pixel-perfect bitmap fonts.
Re:Ligatures in programming fonts: hell no by loup-vaillant on Saturday May 13, 2023 @07:10AM (#35927285)
> Btw., anyone still using monospaced fonts in their editors?

Tell me you've never programmed without telling me you've never programmed… Almost all code editors and IDEs in current use are set with a monospaced font by default, and the overwhelming majority of programmers keep it that way.

Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @07:15AM (#35927311)
Which brings us back to the point of ligatures which are combining so make a single of what is a double or triple and hence no monospace any longer.

No judgement if that is good or bad or at all. Just a reminder that it ain't monospace any longer.

> Your code is still monospaced in all the ways that matter.

Just it ain't monospace any longer. (reminder)

Re:Ligatures in programming fonts: hell no by MadcapJake on Saturday May 13, 2023 @07:26AM (#35927373)
All coding fonts that do this ensure that the ligatures still fit the same width as the characters that are being combined.
Re:Ligatures in programming fonts: hell no by Izkata on Saturday May 13, 2023 @03:41PM (#35931966)
Nope, the one a co-worker uses combines >= into the space of 1 character.
Re:Ligatures in programming fonts: hell no by xupybd on Saturday May 13, 2023 @07:35AM (#35927407)
Can't it still be mono space if the ligatures take up the same space as their components?
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @10:36AM (#35928818)
I think that is a stylistic decision to make it appear as if, but again, this ain't monospace any longer.

In monospace one letter/symbol (printable character) has constant width.

The ligature is one letter/symbol. so while the stylistic decision retains the monospace style of the replaced symbols, the ligature itself is double (or triple) sized compared with other symbols.

IIRC this is commonly called "monospaced ligatures" ref https://github.com/tonsky/FiraCode/issues/712

Re:Ligatures in programming fonts: hell no by MadcapJake on Saturday May 13, 2023 @11:42AM (#35929459)
Fixed width is what monospace is intended for and ligatures maintain that feature. Nobody would use them if they caused code typesetting issues.
Re:Ligatures in programming fonts: hell no by hakre on Saturday May 13, 2023 @01:11PM (#35930394)
Whether that is considered an issue or not is merely in the eye of the beholder.

E.g. a compacting ligature for "www" seems to be welcome in some typefaces for coding. But again, only to stress the reminder: It ain't monospace any longer.

We do still may prefer for the typesetting pleasantry that it still is styled as monospace (or fixed width). but those ligatures aren't fixed width any longer as with the letter A, that's all.

This is the difference between what it looks like (two or three glyphs) and what it is (a single glyph). So we break monospace to keep it appearing fixed-width even with the ligatures.

Would be interesting if there is more typesetting theory about the width of ligatures in a monospace font.

Re:Ligatures in programming fonts: hell no by loup-vaillant on Sunday May 14, 2023 @01:46PM (#35939785)
Here's how monospace ligatures work in real life: the width of a glyph is strictly proportional to how many ASCII bytes it represents. A 1-byte glyph like `m` gets 1 cell. A 2-byte glyph like `->` gets 2 cells. A 3-byte glyph like `===` gets 3 cells.

1 ASCII byte, 1 cell. That way ligatures don't change the width of the original text. If a line used to require 42 columns, it still requires 42 columns. That's why we call them "monospace": each ASCII byte requires the exact same width, even when it's part of a ligature.

> a compacting ligature for "www" —

Is obviously out of scope. We're discussing monospace ligatures here, not compacting ones.

Re:Ligatures in programming fonts: hell no by dylanowen on Saturday May 13, 2023 @07:21AM (#35927346)
Ligatures don't change the spacing. Those 2 monospaced characters still take up 2 spaces but are rendered as 1 glyph. Your code is still monospaced in all the ways that matter.
Re:Ligatures in programming fonts: hell no by amake on Saturday May 13, 2023 @08:59AM (#35927946)
Tell me you've never actually used programming ligatures without telling me etc. etc.
Re:Ligatures in programming fonts: hell no by George83728 on Saturday May 13, 2023 @08:01AM (#35927545)
The only people I've ever seen or heard of using proportional fonts for programming were utterly clueless freshmen newbs who mistook MS Word for a text editor...
Re:Ligatures in programming fonts: hell no by tnzk on Saturday May 13, 2023 @08:18AM (#35927656)
Flash also come with a proportional font by default in the ActionScript editor if I remember correctly. I believe Adobe has changed its mind for other products with scripting support.
Re:Ligatures in programming fonts: hell no by f1shy on Saturday May 13, 2023 @10:09AM (#35928549)
Caution: Stroustrup uses proportional fonts for snippets in the book
Re:Ligatures in programming fonts: hell no by aendruk on Saturday May 13, 2023 @02:24PM (#35931145)
I use proportional Iosevka for most text editing, and just make exceptions per-language, e.g. for popular Ruby coding styles or Markdown tables.