zed icon indicating copy to clipboard operation
zed copied to clipboard

Bad kerning in integrated terminal

Open lixiaoyan opened this issue 1 year ago • 5 comments

Check for existing issues

  • [X] Completed

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 avatar Aug 26 '24 12:08 lixiaoyan

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.

lixiaoyan avatar Aug 26 '24 12:08 lixiaoyan

I can confirm this using Cascadia Code, which has an aspect ratio of 1200:2048 (75:128), at a font size of 16. This is very apparent when drawing box characters, such as when running dust: image

edwloef avatar Dec 10 '24 15:12 edwloef

Removing the design label here as this doesn't seem to be something we have room to change design-wise, but instead appears to be more a rendering, potentially even GPUI-related issue.

danilo-leal avatar Jan 30 '25 18:01 danilo-leal

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!

github-actions[bot] avatar Jun 04 '25 07:06 github-actions[bot]

This is still reproducible.

edwloef avatar Jun 04 '25 09:06 edwloef

Fixed by #33345 I think

ConradIrwin avatar Jul 08 '25 20:07 ConradIrwin

@ConradIrwin Unfortunately, there is still an issue with the character placement. Should I raise another issue?

https://github.com/user-attachments/assets/e36163ce-0614-4680-9fc1-72b0fb327aba

Zed Preview 0.195.0, Font: Iosevka, Size: 15

lixiaoyan avatar Jul 10 '25 08:07 lixiaoyan

@alisinabh do you know if we could use a single span for rebase in this case?

ConradIrwin avatar Jul 10 '25 14:07 ConradIrwin

@ConradIrwin I think this is the culprit. We should remove flooring that value.

I have removed it locally and this seems to be fixing the case @lixiaoyan mentioned.

alisinabh avatar Jul 10 '25 16:07 alisinabh