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

Dark Text on Light Background is Rendered Weirdly #19100

Open
1 task done
SnoutBug opened this issue Oct 11, 2024 · 13 comments
Open
1 task done

Dark Text on Light Background is Rendered Weirdly #19100

SnoutBug opened this issue Oct 11, 2024 · 13 comments
Labels
bug [core label] design [core label] font Font feedback for readability, size, style, etc linux theme Feedback for theme configuration, accessibility, visual issues, etc

Comments

@SnoutBug
Copy link

SnoutBug commented Oct 11, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I wondered why all light themes look terrible in Zed. They look washed out, and in general have less contrast than their dark theme counter-part. I looked around in other editors and found that the fonts in zed seem to be rendered differently compared to elsewhere on my system.
The issue is best shown by the screenshots below.

Environment

System Details Report
## Report details
- **Date generated:**                              2024-10-11 23:12:17
## Hardware Information:
- **Hardware Model:**                              Micro-Star International Co., Ltd MS-7B86
- **Memory:**                                      16,0 GiB
- **Processor:**                                   AMD Ryzen™ 5 2600 × 12
- **Graphics:**                                    AMD Radeon™ RX 7900 XT
## Software Information:
- **OS Name:**                                     Fedora Linux 40 (Workstation Edition)
- **OS Type:**                                     64-bit
- **GNOME Version:**                               46
- **Windowing System:**                            Wayland
- **Kernel Version:**                              Linux 6.10.12-200.fc40.x86_64
Zed system specs
Zed: v0.156.1 (Zed)
OS: Linux Wayland fedora 40
Memory: 15.5 GiB
Architecture: x86_64
GPU: AMD Radeon RX 7900 XT (RADV NAVI31) || radv || Mesa 24.1.7

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

Zed Gnome Editor
image image
image image

Both Zed and the Gnome Editor use the same color scheme for dark and light mode. Notice how the light scheme in Zed looks drastically different (font appears thinner, more washed out and has seems to have less contrast) to the light theme in the Gnome Editor, or even the dark theme in Zed.

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

Zed.log
@SnoutBug SnoutBug added admin read bug [core label] labels Oct 11, 2024
@notpeter
Copy link
Member

notpeter commented Oct 12, 2024

This is similar to:

Can you see if the workaround suggested there improve things?

Also please paste your zed environment info into the description. (ctrl-shift-p, "zed: copy system specs to clipboard")

@notpeter notpeter added linux theme Feedback for theme configuration, accessibility, visual issues, etc font Font feedback for readability, size, style, etc and removed triage labels Oct 12, 2024
@SnoutBug
Copy link
Author

The issue itself does not seem to be related, though it seems yioannides has had the same issue I face. The mentioned fix with the environment variables did not help, however. Changing the font itself also did not work.

@yioannides
Copy link

Yeah, the environment variable trick improves some of GNOME-wide aliasing issues, but Zed (literally) renders the font "wrong" in dark mode and I think it also affects both UI and monospace fonts used in Zed.

@yioannides
Copy link

UPDATE: While working on another unrelated issue, I removed the TTF version of Jetbrains and installed the OTF version instead, and the font surprisingly renders correctly:

image
image

@SnoutBug
Copy link
Author

Interestingly this did not help in my case. The light theme font still looks way thinner than the dark theme counterpart.
For me a workaround would be to increase the font-weight for the light theme by 100 relative to the corresponding dark theme.

@nirfse
Copy link

nirfse commented Oct 29, 2024

I experience the same issue on Arch Linux with SwayWM, and zed-preview-bin with any monospace font (ttf-jetbrains-mono in my case). Dark mode themes have somewhat contrast font rendering, while light themes produce thin squishy font lines, as if there's some anti-aliasing or char thickness rendering issue. Manually increasing buffer_font_weight adds some contrast, but font rendering is still very off (OP's screenshots are on point).

@meocoder31099
Copy link

This is an issue that prevents me from using Zed for my daily work. The text display on Zed is very poor compared to other text editing tools. I believe that having a good text display is an important aspect that should be prioritized in any text editor. It's unfortunate that this problem has persisted for a long time and has not been addressed.

@notpeter notpeter added the design [core label] label Oct 30, 2024
@scottpashley
Copy link

scottpashley commented Nov 2, 2024

I'm using the JetBrains mono fonts, I removed them all and then re-installed only the Semibold variant, which is what I use everywhere anyway. I went with the OTF version as suggested by @yioannides and now it looks as it should.

Edit: after a while using this, "looks as it should" probably isn't quite accurate. It does look better, but actually, the same config with a dark theme does still look better somehow (the font appears slightly bolder)

@rijenkii
Copy link

rijenkii commented Nov 29, 2024

Same issue still exists, makes zed basically unusable for me:
image

specs
Zed: v0.163.2 (Zed)
OS: Linux Wayland fedora 41
Memory: 30.7 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 24.2.6

@donjan
Copy link

donjan commented Dec 3, 2024

Related to #13564 and #14175, it's just more noticeable on light backgrounds.
(might get fixed with #13951, but that one doesn't seem to be progressing much lately)

@iamnbutler
Copy link
Member

@as-cii has an experimental PR up for this – if someone who is familiar with running zed from source wants to try checking out this PR and see if it helps that could help us make some decisions around if it makes sense to merge it or not.

PR: #20506

@rijenkii
Copy link

Are you sure that PR will affect this issue? PR mentions specifically macOS in the title, but OP (and me) are running linux wayland.

@iamnbutler
Copy link
Member

Hmm... I'm not familiar enough with the mechanics of our text system to know if that PR will impact linux or not. I'll let @as-cii chime in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] design [core label] font Font feedback for readability, size, style, etc linux theme Feedback for theme configuration, accessibility, visual issues, etc
Projects
No open projects
Status: No status
Development

No branches or pull requests

9 participants