zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.86k stars 2.8k forks source link

Zed Mono Font: colon glyph vertical movement #13060

Open notpeter opened 3 months ago

notpeter commented 3 months ago

Discussed in https://github.com/zed-industries/zed/discussions/10527

Originally posted by notpeter April 14, 2024 While coding in Rust I observed an odd behavior where the colon glyphs dance as you type them.

To reproduce type out the following:

fn family() -> String {
    String::from(std::consts::FAMILY)
}

colon

The colon(s) move twice: First, when you type the second colon (horizontally) and then when you type a letter after (vertically). No idea why the vertical movement only happens inside parens.

The Iosevka customizer used to generate zed-fonts doesn't currently support defining variants for the ':' character, but I opened an issue to see if they might in the future. In writing that up I also discovered the :: sometimes dances up or dances down or just stays put depending on context. Fun! colon-colon2

someone13574 commented 3 months ago

Is it a ligature?

notpeter commented 3 months ago

Yes, multiple. I'm fine with the double colon :: ligature (first colon moves horizontally to make :: versus a solo :) the issue is that there are (at least) two distinct :: ligatures with different vertical heights. Which is used depends on the character that follows the :: so ::A or :: (end of line) is lower than ::< or ::).

Assuming a line where █ is the cursor position: