Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font rendering on LoDPI displays #7992

Open
1 task done
rev4324 opened this issue Feb 18, 2024 · 35 comments
Open
1 task done

Font rendering on LoDPI displays #7992

rev4324 opened this issue Feb 18, 2024 · 35 comments
Labels
defect [core label] font Font feedback for readability, size, style, etc

Comments

@rev4324
Copy link

rev4324 commented Feb 18, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Text rendered in Zed is noticeably more blurry than other editors when using a LoDPI monitor, e.g. an external 1440p monitor like mine, or a (really) old MacBook. I'm well aware that macOS generally sucks at font rendering on non-retina screens, so to make sure my eyes aren't lying to me, I made a little comparison.

I took screenshots of the same code snippet in Zed, VSCode and Xcode and pasted them into Figma, which doesn't apply a bilinear filter when zooming images, so you can zoom in and see the per-pixel difference. Here's the comparison.

To my eyes VSCode is the sharpest, then there's XCode (which is as sharp as every other AppKit/SwiftUI app), then there's Zed with a weird 1px 50% alpha border around the text that made it really blurry. It seems like some sort of AA that doesn't work particularly well on a LoDPI display.

Environment

Zed: v0.123.2 (Zed Preview)
OS: macOS 14.3.1
Memory: 8 GiB
Architecture: aarch64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

@rev4324 rev4324 added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Feb 18, 2024
@JosephTLyons JosephTLyons added font Font feedback for readability, size, style, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Feb 20, 2024
@rubnogueira
Copy link

I second this. Using Zed with a 1080p LoDPI is very uncomfortable due to the blurriness of the font. This doesn't happen with Sublime, VSCode, or XCode.

@leftbones
Copy link

Seconding this as well. Zed looks great on my MacBook screen, but looks bad when I dock to my 1080p monitor. No other editor has that problem for some reason.

@AlexDaniel
Copy link

AlexDaniel commented Jun 18, 2024

Another side-by-side with the same font (Zed on the left, VS Code on the right):
image

Open that image at 100% zoom to see the difference.

If that image is too small at 100% zoom on your screen, I'm providing this one which is upscaled 2x.

@leftbones
Copy link

leftbones commented Jun 18, 2024 via email

@ogau
Copy link

ogau commented Jul 2, 2024

I also came across a significantly worse font display compared to the vscode editor:

Снимок экрана от 2024-07-02 14-56-08

although there are no strong distortions in the enlarged image, visible distortions appear when changing the font size

@JackNWhite
Copy link

I want to mention this here (because I mentioned it also on the OTB request), but could this difference in rendering be related to scaling of the fonts? For me, Fira Code at size 15 is much smaller in Zed than in Sublime Text.
image

@chf0x
Copy link

chf0x commented Jul 12, 2024

I am having the same issue on a HighDPI screen (Linux). Please let me know if screenshots are needed

@Tiedye
Copy link

Tiedye commented Jul 15, 2024

Same issue as @JackNWhite but in vscode
image

@jsnjack
Copy link

jsnjack commented Jul 17, 2024

I tried few dark and light themes and the issue is much more noticeable on the light themes

@Rid1FZ
Copy link

Rid1FZ commented Jul 25, 2024

Same issue here in LoDPI LCD screen(Laptop). I'm using Fedora 40, and installed Zed from the installation script.

@mentalhub
Copy link

Is there any quick dirty fix without recompile app from scratch? (tried font weigh more than 500, but still eyecracking)

@leftbones
Copy link

Is there any quick dirty fix without recompile app from scratch? (tried font weigh more than 500, but still eyecracking)

I don't think there's any fix, period, unless I missed something? It's a shame, I've been following this issue for quite awhile now and it's really the only thing stopping me from using Zed as my main editor. I spend a lot of time with my laptop docked, and my main monitor is only 1080p so Zed looks like garbage compared to VS Code.

@AlexDaniel
Copy link

Is there any quick dirty fix without recompile app from scratch? (tried font weigh more than 500, but still eyecracking)

I don't think there's any fix, period, unless I missed something? It's a shame, I've been following this issue for quite awhile now and it's really the only thing stopping me from using Zed as my main editor. I spend a lot of time with my laptop docked, and my main monitor is only 1080p so Zed looks like garbage compared to VS Code.

I switched to Zed even though the text, indeed, looks like garbage. I hope this gets fixed eventually. 🙏🏼

@pauschuu
Copy link

pauschuu commented Aug 5, 2024

When Zed was officially released for Linux I showed it to some colleagues of mine. Some tried it out and almost all of those made a statement about the bad font rendering on Linux. They use different Linux Distros, some Wayland, some X, so there is no specific "environment" here that seems to be the problem but rather something in Zed itself?

I experimented with all the different aliasing and hinting settings but no success.

There is no way on Linux to get the same font/same size/same weight/same everything as readable as it would be in other applications like VSCode or my terminal, or basically most other applications.

@Rid1FZ
Copy link

Rid1FZ commented Aug 6, 2024

@pauschuu zed is currently under heavy development. If you look at the release, you'll find that there is a new release almost everyday. The vim mode is not even perfect yet. The plugin system is not great. Currently it only support syntax highlighting for shell scripts. I can make a list of issues. Be patience. Obviously this issue will be fixed soon. But currently there are many major issues on linux like some panics, crashes, etc.

@jliverman
Copy link

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.

@JackNWhite
Copy link

I would like to second this request. I know not everyone is as optically sensitive as some, but for those who are, it makes such a big difference that we cannot seriously consider doing work in Zed until it is fixed.

@rdanilin
Copy link

Switched back to SublimeText due to this issue.

@leftbones
Copy link

It would be nice if someone working on the project could at least acknowledge that this is a problem, it seems like it's largely being ignored right now. I know they're focusing on macOS right now, but this isn't even a matter of trying to make things work properly on other OSes, I use a Mac but have blurry font rendering because I don't use a high DPI display.

@insilications
Copy link

insilications commented Sep 11, 2024

I tried Zed. It looks very promising, but the fonts on Linux with a LoDPI display are looking very bad.

@crisdegraciadev
Copy link

Any update on this? I'm thinking about switching from neovim to zed, but this issue is really making me avoid the change.

@gmr458
Copy link

gmr458 commented Sep 21, 2024

Could the solution to this be similar to Neovide's? neovide/neovide#2510

@louis77
Copy link

louis77 commented Sep 23, 2024

macOS with external LoDPI monitor, fonts (I tried many) are blurry especially on dark themes for me. I have to go all up to 16pt. Doesn't happen with VSCode.

@jansol
Copy link
Contributor

jansol commented Sep 25, 2024

Another side-by-side with the same font (Zed on the left, VS Code on the right): image

Open that image at 100% zoom to see the difference.

If that image is too small at 100% zoom on your screen, I'm providing this one which is upscaled 2x.

This particular example looks a lot like vscode is either using an embedded size-specific bitmap version of the font or has antialiasing disabled while zed uses the usual antialiased vector font.

@VorpalBlade
Copy link

VorpalBlade commented Sep 25, 2024

Another side-by-side with the same font (Zed on the left, VS Code on the right): image
Open that image at 100% zoom to see the difference.
If that image is too small at 100% zoom on your screen, I'm providing this one which is upscaled 2x.

This particular example looks a lot like vscode is either using an embedded size-specific bitmap version of the font or has antialiasing disabled while zed uses the usual antialiased vector font.

I'm fairly sure zed doesn't correctly handle embedded bitmaps (Terminus (TTF) has that and it looks unusable in zed). But even fonts that do not use that (Dejavu Mono Sans) don't render the same.

Perhaps zed is ignoring system font hinting and antialising settings that vscode respects? That also seems to be part of it. I use full hinting greyscale AA in my fontconfig settings on Linux and it is pretty obvious that this is getting ignored completely by zed (again making the text unreadable and literally headache inducing for me).

@jansol
Copy link
Contributor

jansol commented Sep 25, 2024

I use full hinting greyscale AA in my fontconfig settings on Linux and it is pretty obvious that this is getting ignored completely by zed

On Linux Zed uses cosmic-text for text rendering, and it does indeed appear that cosmic-text does not use fontconfig (at all!): pop-os/cosmic-text#282

@matagaralph
Copy link

Any update on this? I'm thinking about switching from neovim to zed, but this issue is really making me avoid the change.

Same here buddy. Will do switch from VS Code to Zed once font rendering is fixed. It's just painful to read stuff currently.

@mahkoh
Copy link

mahkoh commented Oct 4, 2024

When Zed was officially released for Linux I showed it to some colleagues of mine. Some tried it out and almost all of those made a statement about the bad font rendering on Linux. They use different Linux Distros, some Wayland, some X, so there is no specific "environment" here that seems to be the problem but rather something in Zed itself?

Almost all applications on linux use fontconfig and freetype both of which are very old and mature projects. Due to being old, a lot of work has gone into making them look good on the displays of the time which meant low DPI displays. The primary tool to make text look good on such displays is hinting which means slightly distorting the letters so that they fit the pixel grid.

Unfortunately many people working on fonts nowadays no longer care about fonts looking crisp on low DPI displays. As far as I know, cosmic-text doesn't even support horizontal hinting. Until that changes, no application using cosmic-text will ever look crisp on low DPI displays. Realistically, it won't look crisp unless it supports a freetype backend.

@VorpalBlade
Copy link

Unfortunately many people working on fonts nowadays no longer care about fonts looking crisp on low DPI displays.

Low DPI monitors will be around for many more years. Any project that doesn't realise that and handle it somewhat passible is effectively unusable by a significant number of users.

@maxhille
Copy link

maxhille commented Oct 7, 2024

@mahkoh I am not too much into font rendering as a subject, but just from their respective README.mds:

  • Cosmic-text claims to support hinting
  • Swash (which is used by Cosmix-text) supports Subpixel-Antialiasing

@mahkoh
Copy link

mahkoh commented Oct 7, 2024

Cosmic-text claims to support hinting

AIUI cosmic uses swash for rendering and swash does not perform the types of hinting supported by fontconfig + freetype. The second have three different levels of hinting that look very different from each other and swash only has a boolean setting.

Swash (which is used by Cosmix-text) supports Subpixel-Antialiasing

Anything subpixel cannot work on a modern system due to scaling and rotation. GTK4 has completely removed subpixel rendering for that reason AIUI.

@mahkoh
Copy link

mahkoh commented Oct 7, 2024

@VorpalBlade
Copy link

See this blog post RE GTK: https://blog.gtk.org/2024/03/07/on-fractional-scales-fonts-and-hinting/

GTK4 font rendering is a horror show by default on low DPI screens. However it is fixable by editing ~/.config/gtk-4.0/settings.ini and adding gtk-hint-font-metrics=true. Without that GTK 4 is just completely unusable.

So that blog post is, quite frankly, full of BS. Yes it works on high DPI screens. Not all of us want to invest in all new laptops and monitors just because of GTK, zed or Cosmic. I'll just not use those pieces of software that can't render text properly.

@zmanuel
Copy link

zmanuel commented Oct 15, 2024

Call me a weirdo, but I prefer non-antialiased fonts even on high DPI displays, at least for text editing where setting it up properly is a battle I can win (using the right font with embedded bitmaps or good hinting). It's not a big difference, I admit. I'll stop caring around 300 DPI, or in five years when my eyes have gotten sufficiently worse :)
Even on low-DPI displays, blurry fonts are not an automatic dealbreaker for me, it's not a hill I'm willing to die on, just one I'll defend while I can.

@rev4324
Copy link
Author

rev4324 commented Oct 16, 2024

On a HiDPI display the pixel density itself makes up for the blurriness you'd have on LoDPI. Actually it's better to disable aggressive font AA on HiDPI, since the font looks more like the artist intended. That's pretty much what macOS does anyway.
Yet on LoDPI I get dizzy from reading all of this blurry text, even if it looks more in line with the artist's intention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] font Font feedback for readability, size, style, etc
Projects
None yet
Development

No branches or pull requests