zed icon indicating copy to clipboard operation
zed copied to clipboard

Blurry font rendering (on Linux at least)

Open VorpalBlade opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

So I tried the pre-alpha of Zed on Linux (I don't have a Mac), built it with cargo build --release) but it seems that font rendering doesn't work properly on low-DPI monitors (I only have a pair of old ~96 DPI monitors). Zed is ignoring my system wide font settings of full hinting, greyscale antialiasing which make such screens work. This results in very blurry rendering.

I tried a variety of fonts that work fine in other editors. For example "Terminus (TTF)" which is a bitmap font (converted to TTF) and should render with no anti-aliasing whatsoever. This works fine in VSCode.

Dejavu Sans Mono is better, but again Zed doesn't seem to be rendering like other programs on my system

Here is my ~/.config/fontconfig/fonts.conf (which i would expect to take effect for all programs on the system):

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit name="rgba" mode="assign">
   <const>none</const>
  </edit>
 </match>
 <match target="font">
  <edit name="hinting" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit name="hintstyle" mode="assign">
   <const>hintfull</const>
  </edit>
 </match>
 <match target="font">
  <edit name="antialias" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
 <alias>
  <family>Terminus (TTF)</family>
  <default>
   <family>monospace</family>
  </default>
 </alias>
 <match>
  <test compare="eq" name="family">
   <string>sans-serif</string>
  </test>
  <test compare="eq" name="family">
   <string>monospace</string>
  </test>
  <edit mode="delete" name="family"/>
 </match>
 <dir>~/.fonts</dir>
</fontconfig>

As is it is, on my monitor Zed is too blurry to be usable (I'm really sensitive to blurry fonts and get literal headaches from it). I could also not find a way to turn off antialiasing entirely (which might be an acceptable workaround) in https://zed.dev/docs/configuring-zed (there is no mention of "antialias" at all in the page.

Environment

Zed: v1.0.0 (Zed Dev df190ea84621837c44fa50c62837bdbea04b9e22) OS: Linux 1.0.0 (actually this is Arch Linux, I think this command is a bit broken?) Memory: 31 GiB Architecture: x86_64

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

Blurry font rendering in Zed (sharp in VSCode) when using "Terminus (TTF)" (both at size 18), which is a bitmap font, best viewed at 1:1 pixels on a 96 DPI screen, or at an exact scaling (e.g. 200%) on a higher DPI screen: Terminus TTF

When using "Dejavu Sans Mono" the difference is smaller, but Zed is still blurrier. Both are at font size 18 again: Dejavu Sans Mono

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

Apparently I don't have a log file:

image

VorpalBlade avatar May 10 '24 19:05 VorpalBlade

Related

  • #4334

Moshyfawn avatar May 11 '24 17:05 Moshyfawn

Possibly related:

  • https://github.com/zed-industries/zed/issues/7992

jamesgecko avatar Jun 03 '24 14:06 jamesgecko

You're right. Let's close this in favour of #7992 to keep the conversation in one place. Be sure to +👍 and follow the other thread.

Duplicate of:

  • #7992

Moshyfawn avatar Jun 10 '24 14:06 Moshyfawn