be5invis / Iosevka

Versatile typeface for code, from code.
http://be5invis.github.io/Iosevka
SIL Open Font License 1.1
19.11k stars 567 forks source link

Variant: colon vertically centered #2321

Closed notpeter closed 2 months ago

notpeter commented 5 months ago

The vertical placement of : (and related ligatures: ::, :::, etc) varies depending on context:

  1. Colon sits on the baseline or
  2. Colon sits vertically centered on the median

Specifically typing ::< character-by-character (used for the turbo fish operator in rust) results in the three distinct positions of the colon. The horizontal movement when making the :: (expected ligature behavior) and vertical movement when typing the subsequent character. I find the vertical movement extremely distracting. It occurs when a : is followed by any of <>=-+ (not just <).

Depending on context, the colon(s) move up or down when the next character is typed. Here is an animated example demonstrating these behaviors:

colon-colon2

Proposal: add variants for the colon character : so a vertically centered placement can be enabled as a default. This currently possible with the * character, but not for :. Such a variant would also make it possible to avoid two successive :: within a single call being displayed at different heights (see: mem::size_of::<u8> in the gif above.)

I observed this behavior in the Zed editor which includes an Iosevka customization Zed Mono. Here is the associated custom build config.

glepnir commented 4 months ago

I got same problem . reprocue can by simply using a rust code like std::O

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

notpeter commented 2 months ago

Zed switched their default font from 'Zed Mono' (an Iosevka derivative) to 'Zed Plex Mono' (an IBM Plex Mono derivative) so this is not longer a major concern.

I really like all the other ligatures in Iosevka, but having dancing colons made it unsuitable for Rust programming so in the absence of this variant I've moved elsewhere.

be5invis commented 2 months ago

Well, well, in current C-like ligation set we already prohibit : from centering.

image

I think maybe you can simply change your font feature settings to CLIK (and turn off calt)? In VSCode you could do this:

    "[rust]": {
        "editor.fontLigatures": "'calt' 0, 'CLIK' 1"
    },