zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.89k stars 2.69k forks source link

Unable to use fonts with hyphens in their name #14854

Closed astatide closed 1 month ago

astatide commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Hello! On a recent Linux build, I attempted to set the buffer_font_family to a font name that has a dash hyphen-minus in it; while the autocompletion and validation works, there's no actual change in the font used, instead reverting to what is the default font. Using another font without a hyphen (even one with a space) seems to work fine.

Please let me know if I can provide any more details or help!

EDIT: It's not super easy to tell the fonts are different in the screenshots, so I added a non mono font to really make it clear.

EDIT2: based on a little trial+error/searching, it looks like the actual character is the "hyphen-minus", not one of the various flavors of dash: https://www.compart.com/en/unicode/U+002D

Environment

Zed: v0.144.4 (Zed) OS: Linux Wayland fedora 40 Memory: 62.7 GiB Architecture: x86_64

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

Default (I think) font: image

Font with dash with no change in appearance: image

Font without dash, with expected changes: image

Non monospaced font without dash (to emphasize the visual difference): image

Non monospaced font with dash (Inter-Bold is not a fixed width font) to help show that it is not working as expected: image

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

Zed.log


astatide commented 1 month ago

Ah, I think I should have searched for "buffer_font_family", as I suspect this is related to the following bug report:

https://github.com/zed-industries/zed/issues/14096

JunkuiZhang commented 1 month ago

Generally speaking, font names should not include a char like -.

JosephTLyons commented 1 month ago

Thanks @astatide - I think you're right in that this is a dupe of:

I'll close this one out. Feel free to 👍 the aforementioned issue.