Skip to content

Commit c314fc8

Browse files
committed
additional code ligature planning & thinking
1 parent 2cc3251 commit c314fc8

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

docs/code-ligatures--planning/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Ligatures to add to betas as early as possible – even just in the Upright A–
5454
| ligature | name | usecase |
5555
| -------- | ------------------ | ------------------ |
5656
| => | equal_greater.code | JS arrow functions |
57+
| -> | hyphen_greater.code | Haskell |
58+
| <- | less_hyphen.code | Haskell |
5759

5860
#### comments and others
5961

@@ -90,14 +92,15 @@ Including these because they should be relatively simple, and will be seen very
9092

9193
| ligature | name | note |
9294
| -------- | ---------------------------------------- | ------- |
93-
| \_\_ | underscore_underscore.code |
95+
| \_\_ | underscore_underscore.code | keep the separation but move these together slightly |
9496
| /\* | slash_asterix.code | C#, CSS |
9597
| \*/ | asterix_slash.code | C#, CSS |
9698
| /// | slash_slash_slash.code | JS |
9799
| ''' | quotesingle_quotesingle_quotesingle.code | maybe? |
98100
| """ | quotedbl_quotedbl_quotedbl.code | maybe? |
99101
| \`\`\` | grave_grave_grave.code | maybe? |
100102
| <!\-\- | less_exclam_hyphen_hyphen.code | HTML |
103+
101104
| --> | hyphen_hyphen_greater.code | HTML |
102105

103106
#### more logic operators
@@ -137,9 +140,7 @@ Including these because they should be relatively simple, and will be seen very
137140
| ------------ | ---------------------------------- | ---------------- |
138141
| &&& | ampersand_ampersand_ampersand.code | Haskell |
139142
| &#124;&#124; | bar_bar_bar.code | Haskell |
140-
| -> | hyphen_greater.code | Haskell |
141143
| >- | greater_hyphen.code | Haskell |
142-
| <- | less_hyphen.code | Haskell |
143144
| -< | hyphen_less.code | Haskell |
144145
| :: | colon_colon.code | Haskell |
145146
| >> | greater_greater.code | Haskell |
@@ -270,6 +271,10 @@ We could create the stylistic set that "emulates" mark down behaviour. With liga
270271
| **iter** | |
271272
| **repr** | |
272273

274+
#### Other Programming Languages
275+
276+
- [Coq](https://en.wikipedia.org/wiki/Coq)
277+
273278
## Syntax examples for testing
274279

275280
### Python
@@ -348,3 +353,16 @@ We could create the stylistic set that "emulates" mark down behaviour. With liga
348353

349354
- https://wiki.haskell.org/Arrow_tutorial
350355
- https://en.wikibooks.org/wiki/Haskell/Understanding_arrows
356+
357+
358+
## Arguments against code ligatures (useful to answer)
359+
360+
- ["LIGATURES IN PROGRAMMING FONTS: HELL NO"](https://practicaltypography.com/ligatures-in-programming-fonts-hell-no.html)
361+
- **General response:** There is a tendency by type designers to reject the idea of code ligatures, and it's nice to see an essay that articulates some of the reasoning, even if it is a tad bit aggressive. Generally, I think this rejection has a few root causes:
362+
- Type designers have to trust their knowledge and vision above trends and user requests, or they probably wouldn't make type that is good or interesting. However, this can lead type designers to ignore actual user desires.
363+
- Type designers are (rightly) very concerned with typographic clarity, but haven't usually thought through *why* code ligatures are so popular (namely, positive reinforment from a "syntax-highlighting" type of mechanism).
364+
- So far, code ligatures have appeared in fonts as something of a hack, using default ligature features (especially *contextual alternates*, or `calt`) which are not meant to make large visual transformations. It is my hope that Recursive can follow the OpenType spec more closely, to make more people happy.
365+
- **Assertion:** "They contradict Unicode ... in a source file that uses Unicode characters, how would you know if you’re looking at a => ligature that’s shaped like ⇒ vs. Unicode character 0x21D2, which also looks like ⇒?
366+
- **Response:** Code ligatures don't affect the actual unicode values of your code. Visually, the take up multiple with units, so I find them to present little ambiguity. That said, if you have three types of ⇒ in your javascript file, consider turning off code ligatures temporarily. If you are presenting code to a general audience (especially to beginners) who are likely to be retyping from sight, please *don't* use code ligatures – they can be difficult for the uninitiated to interpret.
367+
- **Assertion:** "They’re guaranteed to be wrong sometimes. There are a lot of ways for a given sequence of characters, like “=>”, to end up in a source file. Depending on context, it doesn’t always mean the same thing."
368+
- **Response:** How often would this appear, and how often would that be confusing? Further, how often would it appear without a `=` to the left, or a `>` to the right – scenarios that are ignored by the OpenType ligature code in both Fira Code and now Recursive. Seriously, if there are examples where you see some ambiguity, please file an issue, and it can most likely be resolved with an update. :)

0 commit comments

Comments
 (0)