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

Configurable Interface Font/Font Size #5286

Closed
dnjp opened this issue Jul 15, 2022 · 14 comments
Closed

Configurable Interface Font/Font Size #5286

dnjp opened this issue Jul 15, 2022 · 14 comments
Labels
design [core label] enhancement [core label]

Comments

@dnjp
Copy link

dnjp commented Jul 15, 2022

Describe the solution you'd like
I would like to be able to configure both the font and font size for the interface surrounding the editor window. Currently, the default font does not match the font or font size I'm using for the editor window.

image

@dnjp dnjp added enhancement [core label] triage Maintainer needs to classify the issue labels Jul 15, 2022
@JosephTLyons JosephTLyons removed the triage Maintainer needs to classify the issue label Jul 16, 2022
@alejandrovrojas
Copy link

Another suggestion could be to simply use the macOS system font for the UI. Iosevka looks great for the most part, but I find the double-story lowercase g, as well as the terminals of the lowercase t and f to be too distracting for UI use.

@jansol
Copy link
Contributor

jansol commented Jul 20, 2022

IIRC macOS does not expose the system UI font to applications directly, only through the Cocoa/UIKit widgets. It would of course be possible to hardcode a path to right file in the system directory but there are no guarantees that it won't change without a warning. And simply shipping a copy of the font file with applications is likely not allowed.

@mikayla-maki mikayla-maki added the design [core label] label Aug 5, 2022
@shot-codes
Copy link

Yes this is a great to have, not just the font size but the scale in general. I use a mbp16 and look how jarring the scale difference between zed and sublime is in my case.

Screen Shot 2022-08-16 at 12 43 15

@chriskrycho
Copy link

chriskrycho commented Aug 17, 2022

IIRC macOS does not expose the system UI font to applications directly, only through the Cocoa/UIKit widgets.

Apple actually supplies the fonts for direct download; the key would be checking the license for distribution.

@jansol
Copy link
Contributor

jansol commented Aug 24, 2022

The license page of the installer says no:

IMPORTANT NOTE: THE APPLE SF MONO FONT IS TO BE USED SOLELY FOR CREATING MOCK-UPS OF USER INTERFACES TO BE USED IN SOFTWARE PRODUCTS RUNNING ON APPLE’S iOS, iPadOS, macOS, tvOS OR watchOS OPERATING SYSTEMS, AS APPLICABLE.

@chriskrycho
Copy link

Ah, drat.

@jansol
Copy link
Contributor

jansol commented Aug 24, 2022

So far it seems the only official way to access those fonts is with CTFontCreateUIFontForLanguage(_:_:_:) and then I guess asking CoreText or CoreGraphics for a rasterized glyph bitmap or a CGPath from which it may be possible to extract the curve data.

If pre-rasterized glyphs are enough I guess this is fine although it requires an entire custom code path for a single font. Ultimately it seems like a lot of effort for relatively little gain.

However it looks like fetching the base metrics of the system font would be quite straightforward. Those could be used to pick a default size (at runtime) for the shipped font that is as close as possible to the configured system font size. This could then be reused to honor the system font size defaults on platforms that allow changing them. (Windows and Linux do, as do iOS and Android IIRC)

@sonereker
Copy link

How about Inter font? https://rsms.me/inter/

I think JetBrains uses this one by default now.

@trojanfoe
Copy link

Is it possible to simply add a setting for the UI font and size and let the user worry about supplying the actual font?

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

frou commented Jan 24, 2024

Woop woop. It's now possible:

  • Install Apple's SF Pro font in such a way that it's available to other applications:
brew install --cask homebrew/cask-fonts/font-sf-pro
  • Add to Zed's settings file:
"ui_font_family": "SF Pro",
"ui_font_size": 15,

Remember, in a macOS GUI application, the font used in parts other than the code-editing buffer shouldn't be monospaced. There's no need for terminal envy when already in a superior medium!

@bsiegel
Copy link

bsiegel commented Jan 24, 2024

SF Pro's internal font name seems to be simply "System Font". On a whim I tried adding "ui_font_family": "System Font", to my settings and it worked.

@maxbrunsfeld
Copy link
Collaborator

This is done.

@eproxus
Copy link

eproxus commented Jan 25, 2024

@bsiegel Can confirm this works. There's a tooltip that says "Value is not accepted" but it works anyway.

@eur2
Copy link

eur2 commented Feb 1, 2024

@dnjp love your settings on the screenshot.
How did you set the top bar thinner with the name of the repo inside?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design [core label] enhancement [core label]
Projects
None yet
Development

No branches or pull requests