zed icon indicating copy to clipboard operation
zed copied to clipboard

Better text rendering

Open sihayas opened this issue 11 months ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the feature

i mainly use WebStorm/JetBrains' products for one reason, the text-rendering especially on Mac is unparalleled. In these 2 photos the red text is from WebStorm and the blue text is from Zed. as you can see, text from Zed is a lot more pixelated/jagged giving it a rougher look on Retina displays especially, and given that Zed is only a Mac editor, that seems like an odd choice to me. whereas on Webstorm (red text), the colors blend more gradually at the edges of the characters giving it a much cleaner look.

im curious, is this a byproduct of the GPUI framework Zed is built on? A tradeoff for the ridiculous speed Zed runs on?

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

Screenshot 2024-03-15 at 12 20 56 PM Screenshot 2024-03-15 at 12 20 44 PM

sihayas avatar Mar 15 '24 16:03 sihayas

Looks like different font hinting? The glyphs in the red image seem much better aligned to the pixel grid.

jansol avatar Mar 15 '24 16:03 jansol

some more examples with different typefaces, the OP is Commit Mono. apple's native xCode also has similar rendering to JetBrains/Webstorm in this case...

zed is red

sf mono: sfw sf

berkeley mono: berkkw berkk

sihayas avatar Mar 15 '24 17:03 sihayas

I wonder if this is actually caused by incorrect blending. While investigating transparent windows I found that MoltenVK - and I assume by extension MtlLayer - only supports post-multiplied alpha for blending transparent windows.

However it seems that the blending mode of the renderer pipelines in Zed is set up for pre-multiplied blending! At least in the blade renderer this appears to be the case -- I have not double-checked whether it also applies to the Metal renderer.

I would expect that blending within an opaque window would work be independent of what the compositor does/can do but since font rasterization is offloaded to CoreText, it does not sound too far fetched that it would be generating glyphs for post-multiplied alpha blending.

jansol avatar Apr 23 '24 07:04 jansol

BUMP

This is by far the worst part about Zed at the moment. Can someone PLEASE look into this?

FYI - I had similar issues trying to get WezTerm to look as good as Alacritty on my Macbook when using an external monitor. It was finally resolved when I changed the "front end" to use WebGpu.

jliverman avatar Aug 30 '24 15:08 jliverman

BUMP!

I've decided to try Zed because of the aesthetics and I'm not using it on a daily basis because of this.

mateozaratefw avatar Sep 10 '24 03:09 mateozaratefw