Recently many programming typefaces provides ligatures for operators, i.e., `!=` will be look like `≠`. However some operators may have different meaning in different languages, for example, `/=`, the meaning of this symbol in Haskell differs from that in JavaScript.
So consider a similar situation that the same letter has different shapein different langauges, is it possible to provide different ligarues for different programming languages using `locl` feature?
0
Comments
Really? Is it just me, or is this terrible practice? Usually the idea is to not have OT features mess with the underlying data stream, i.e. not to substitute anything by other encoded characters (just glyph variants are fine). In your example, ≠ is not just a prettier representation but actually a distinct character from typing the != sequence — and ≠ is not part of the programming syntax. Which could cause problems on a data level (think searching or copy-pasting your code) if that ≠ is actually encoded as ≠, but even if it isn’t, I also find it problematic on a recognition level: You read a character that as such is not part of the syntax. Which, imagine learning programming that way and then having to code in a different font where the ≠ won’t do anything.
I may well be missing something (in which case please enlighten me) but personally I would get rid of a programming font with such inbuilt magic — and/or confusion — very quickly.
I am considering about creating some "quasi-ligatures" like `->` with the slash enlonged. However I do not think that providing `≠`-like or `≤`-like symbols is a good idea.
This is a terrible idea to switch '-->' to an arrow in a code environment. Because '-->' means the end to a comment block in a lot different languages – the arrow on the other hand does not mean anything. The code will still work but will confuse people quite bit. Coding fonts should never do anything like this (≠, --> ...).
Staring at valid code patterns has a funny effect of burning itself into the brain, so substituting something as essential as a "!=" might actually be confusing. Scanning the code, using search & replace patterns, syntax highlighting... There's situations where you might be programming patterns that include the "!=" combination, but not as an "not equal", but as part of some string or other pattern. For example search all occurrences of "foo" followed by a space, followed by a "!=" followed by a space, followed by "bar" you might write as a regular expression like "/^foo\s\!=\sbar$/- your OT substitution is not context aware and will horribly distort the meaning and readability of a string like that.
It's great typographers turn their attention to coding, but substitutions seem like a very bad idea to me (as someone with a programmer's background). You are talking about an activity where mistaking "'" for "’" can crash your business' servers, or the difference between "!=" and "|=" makes traffic lights switch from red to green - don't mess with what people are reading and writing and leave them with their ascii.