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

UI and buffer fonts vary in size #4292

Closed
1 task done
JosephTLyons opened this issue Jan 5, 2024 · 7 comments
Closed
1 task done

UI and buffer fonts vary in size #4292

JosephTLyons opened this issue Jan 5, 2024 · 7 comments
Labels
bug [core label] font Font feedback for readability, size, style, etc

Comments

@JosephTLyons
Copy link
Collaborator

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

A user reported that having identical settings between UI and buffer fonts (size and family) resulted in text of different sizes.

Environment

Zed: v0.119.2 (Zed Preview)
OS: macOS 14.1.2
Memory: 64 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

@JosephTLyons JosephTLyons added bug [core label] font Font feedback for readability, size, style, etc labels Jan 5, 2024
@maxdeviant
Copy link
Member

One thing to note is that the ui_font_size sets the base font size for the editor, but some UI text may be larger/smaller depending on the relative scale.

So I think this may be working as intended.

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@maxdeviant
Copy link
Member

Closing this out, as the font sizes are working as intended.

@korkje
Copy link

korkje commented Feb 22, 2024

Just noticed this myself. I think setting them equal should at least make the file tree have the same font size as the buffer. That's the biggest eye sore for me, that the file tree font isn't the same size as the buffer.

@korkje
Copy link

korkje commented Feb 22, 2024

In fact, I can't seem to find any UI text that is of the same font size as the buffer, when setting them equal. I get that there is a base, and that some UI would need to have a smaller/bigger size, but in this case it seems everything is different (smaller) than base.

@lukejanicke
Copy link

Came here to report this. How is this closed? It is clearly not working as intended. Out of the box, the code font size looks to be almost double the UI font size. I went to change this in settings, and they are both set exactly the same: 16 pt. The UI is clearly not 16pt. I couldn't find any UI text that is 16 pt. It looks about 13 pt.

@neromaverick
Copy link

I also think this should not be closed.

I can confirm the UI font & buffer font sizes don't appear to follow the same font scaling. I use pixel perfect fonts throughout my system. I can get a pixel perfect look with both "Departure Mono" & "Terminess Nerd Font Mono" on the buffer. On the UI however, the fonts appear to be about 87.3% the size of the buffer's font.

This was found by incrementally changing the font size until the fonts finally fell into pixel perfect alignment.

This was set with "ui_font_size": 12.6, "buffer_font_size": 11, "ui_font_family": "Departure Mono", & "buffer_font_family": "Departure Mono". I also have font weights set to the minimum 100 for both UI & buffer.

I'm not using any scaling on my OS. Regardless, if I were using scaling on my OS, the buffer & UI font sizes should still scale together.

@neromaverick
Copy link

font_size: rems(0.875).into(),

This might not specifically be it. But I see that 0.875 is referenced quite a bit. When I changed the font size to 12.571428571 = (11 / 0.875) the appearance of the font was slightly sharper than the previous 12.6 I had used.

In many applications I see it a lot where the choice of font size with UI is given to us in pt/px format, but it's essentially overridden by various UI elements that scale fonts for various reasons (headings, titles, context menus, etc.). IMO the ui_font_size setting in this case would be better off using a 1-10 scale since using a pt/px format is misleading with the various font scaling applied across the UI. Either that, or keep with using pt/px for the setting, but allow the user to disable or adjust all font scaling with an additional setting (Also panel font size & buffer font size should always be 1:1 with the font size chosen IMO).

For now applying the ui_font_size = buffer_font_size / 0.875 works well enough for most situations for me. There are some UI elements that are too small/large for my liking. But this gives me the best look for daily use.

Hope this helps someone!

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

No branches or pull requests

5 participants