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
49.04k stars 2.96k forks source link

Bad kerning in integrated terminal #16869

Open lixiaoyan opened 2 months ago

lixiaoyan commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

This issue is related to Zed's custom renderer for Alacritty. It is not reproducible in vanilla Alacritty.

image

⬆️ Alacritty ⬇️ Integrated terminal in Zed

Zed config:

{
  "buffer_font_family": "Iosevka Fixed",
  "buffer_font_size": 11
}

Alacritty config:

[font]
normal = { family = "Iosevka Fixed" }
size = 11

Environment

Zed: v0.149.5 (Zed) OS: macOS 13.6.9 Memory: 32 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

lixiaoyan commented 2 months ago

It appears to be related to non-integral character coordinates. The font in my screenshot, Iosevka, has an exact aspect ratio of 1:2. That is why characters are grouped in twos.

image

⬆️ When the font size is set to 11, the y positions for each character are 0, 5.5, 11, 16.5,...

image

⬆️ This problem does not occur when the font size is set to an even number.