-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Use JetBrains Mono as the editor's default code font #36198
Use JetBrains Mono as the editor's default code font #36198
Conversation
ee64e09
to
1fb6f13
Compare
Yes! No longer need to set it up myself. Very good change, sir! ;) |
I edited the post so that the images are lined up and you can open each image in a new tab and flip between them. Just flipping between the preview images:
I prefer Godot's existing font, it feels really easy to read. But take my opinion with a grain of salt, since I usually prefer larger fonts and sans-serif fonts and I know many people don't. |
I've been using Jetbrains Mono in Godot since the day they released it, so I can confirm it works very well 👍 Godot's code editor window is pretty small because of all the extra UI clutter at the top and bottom, so a more vertically condensed font is a lifesaver. |
Would be nice to have this, it's an objectively positive improvement, especially since the code editor has a narrower text editor than most IDEs, so the narrower characters have been a great improvement for the past few months. |
1fb6f13
to
b907b34
Compare
b907b34
to
b55e10b
Compare
b55e10b
to
a44aa8f
Compare
Rebased with JetBrains Mono 2.210. |
a44aa8f
to
4620f9c
Compare
72281ec
to
9c54ec8
Compare
Comment: Hack font | ||
Copyright: 2018, Source Foundry Authors | ||
2003, Bitstream Inc. | ||
License: Expat and Bitstream Vera Fonts Copyright |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also remove the now unused blurb for Bitstream Vera Fonts Copyright.
I have no strong opinion either way, but it seems all reactions are positive / nobody is against it, so I guess we can give this font a try for 4.0. |
For the record, I am somewhat against it (reasons here), but it's fine either way. |
Let's make a twitter poll :) |
I'd say that while Twitter is probably your largest community to probe, it's far from ideal for this particular comparison. You need to flip between different tabs to really compare the difference like Aaron himself suggested for this PR. Twitter makes it much harder to do, as it stretches pictures, adds compression, introduces animation when flipping between them, doesn't make it immediately obvious which one is left and which one is right, etc. |
Jetbrains Mono is objectively easier to parse for code, I've been using it since January in godot/vscode/terminal and the difference has been literally palpable. I've also recommended it to a half dozen others who have also praised it. Aaron complained that JM is more condensed, which is actually a good thing, since godot's vertical space is very limited on laptop screens, between the top bars and the bottom panels (which re-open themselves all the time). There is a reason that JM is more condensed, a very good reason. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am not personally convinced about the vertically-condensed argument, at the very least in the provided screenshots, with fixed line spacing. It might help if line spacing is decreased, though. It would be nice to have a comparison for numbers, capital O vs zero 0, and some other similar-looking characters (I, l, 1, i...). |
Unfortunately, if you decrease line spacing (even by 1 pixel), it starts looking really cramped. At this point, it seems there's no clear support in favor of JetBrains Mono. Looks like people stop liking it so much as soon as you don't mention its name in a poll? 👀 I think it's better to close this now rather than drag this discussion forever. |
It would be good to know what JetBrains Mono doesn't support compared to Hack. Aside from that, I'd be fine giving JetBrains Mono a try. I'm not sure however that having ligatures enabled by default is good for people who are learning programming and need to understand the syntax in detail. Is it possible to have an editor setting to toggle ligatures, so that users who want it can enable it themselves? |
So from a technical PoV, Jetbrains Mono Regular is 1/3 smaller at 200kb compared to Hack Regular's 303kb. The only notable ones I found that Hack has and Jetbrains doesn't are some cases for Cyrillic ("special" small and capital letters with symbols/graves? I.e. the range from Even with these, Jetbrains having +50% more chars at -30% size seems a lot, if this is accurate. According to This is for Jetbrains: Diffing that, both seem to support a few languages the other doesn't, I spotted nothing that heavily weighs this in one font's favor though if I haven't missed anything. Jetbrains seems more maintained: Overall both seem like good fonts. Hard for me to gauge whether Jetbrain's +50% more chars are accurate and matter enough, if they do, I think this is the largest point in its favor. |
Thanks for checking! Following our discussion in PR review and on chat, let's merge this for alpha 1 (with ligatures enabled) and see what feedback we get from users. |
Thanks! |
I'm very skeptical about this, especially in the last two cases, since the characters are visually replaced with dissimilar ones. I know that I can change the font back in the Editor Settings, but such a default font is not the best idea IMO. I don't mind pretty fonts, as long as it doesn't harm clarity and unambiguity. |
As pointed out in #36198 (comment), you can disable code ligatures with an editor settings, you don't have to change the font. |
My biggest gripe with ligatures is the way they interact with the caret, as it will somewhat awkwardly display somewhere across the ligature; I feel like it defeats the purpose of mono fonts. I don't know how many people use ligatures vs those who don't, but I would personally prefer they be disabled by default. |
I must say - I had similar opinion when it was first time introduced for JetBrains products. But I gave it a try. In result - I tried to revert to Consolas after some time (as I was quite lazy to change it back) or at least to remove ligatures :) And... it doesn't work, I've got used too much to jetbrains mono already and ligatures. It's really removing noize from the code, making it easier to read and etc. At least it's my case.
Just give it a try ) |
I would say give the font a shot with ligatures. It really does make the code easier to read, at least in my opinion. For some, it may be that it's just so new that it doesn't seem right, I dunno (at least not messing with ===, that one did take me some time to get used to for me). It just appeared to be easy on my aging eyes and I do like the ligatures as well, but it is personal preference. |
Prefer the Hack font more, just a personal opinion. |
It's probably to distinguish it from the lower case L better. In Hack they are very very close, which is a problem for people with poor eyesight, like myself. |
Thank you, I think I'll keep using the Hack font, even if it needs to be downloaded separately. |
JetBrains Mono is not a dyslexic-friendly font. An example of an accessible font would be Comic Code, which I use daily. On a less important note, I don't feel like JetBrains Mono fits Godot's image. To be clear, I am not suggesting that we use Comic Code. Even though I like it, I am not convinced it suits Godot's image. PreviewBeforeAfter |
@RolandMarchand I think that is valuable input, however I think JetBrains Mono is a good default for most users since it is just objectively better for reading code for most people. I do agree that we can ship with an alternative font for cases like the one you mentioned, and we can have it be enabled under some Accessibility settings. If you would like to open a proposal for that then I can look into it if the proposal gets positive sentiment. |
We should be wary about shipping more optional fonts with the editor, as this will increase binary size. This is especially relevant for the mobile/web editors, where keeping this size low is critical for fast download and loading speeds. In general, if you want to use a specific font for accessibility reasons, there's a fair chance you've installed it user-wide or system-wide already (so you can use it in other programs). This font may also receive regular updates; using a system font allows updates to apply throughout all programs you're using – assuming they're not bundling the font. What we can do is allow the editor to use a system font ( cc @bruvzg |
Comic Code is a commercial font, we definitely can't include it in any form.
We can add some system font names as an alternative, but it will make sense only on desktop. Web do not have system font support, mobile do, but installing system-wide fonts usually is not as straightforward as it is on desktop. But I guess adding an option to select system font in the editor setting should be added. |
@Calinou This sounds good, and is in line with how other IDEs do it, e.g. VSCode. You usually have to type just the font name and it will detect it if it's installed system-wide. I think this would be a great solution. |
So when the official version is released, will it return to the previous hack font? I'm not sure the Code ligatures are right because there are symbols like , . Will it be confusing? |
No, there are no plans to revert the current code font. And you can disable ligatures in the settings, it's not related to the font. |
JetBrains Mono is here to stay as the default code editor font, but font ligatures are disabled by default now. If you want to use Hack again, you can download it here and specify it as a custom code font in the Editor Settings. |
This recently released font has been gaining popularity thanks to its readability and aesthetics. It also features font ligatures
(enabled by default, but can be disabled in the Editor Settings).
Its character set isn't as extensive as Hack's, but it should be sufficient for most uses.
More information at https://www.jetbrains.com/lp/mono/.
This also reorders the third-party font notices to be in alphabetical order.
Testing project (for taking screenshots): test_jetbrains_mono.zip
Preview
ImgSli: https://imgsli.com/ODg4Mjg
Before
Code ligatures are not available in Hack, so they are disabled.
After
Code ligatures are enabled.