-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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 Chromium's new system-ui font alias #25570
Conversation
This is changing all of our fonts on all OS for anything outside the editor, @Tyriar is that really what you had in mind? |
The actually used font should just change on non-Ubuntu Linux systems. For example here's a screenshot from Windows 10: And from the Chromium commit messages: "This patch enables the "system-ui" generic font family on all platforms." and for macOS "This patch replaces internal uses of "BlinkMacSystemFont", Blink's non-standard extension on Mac, with the standard "system-ui" generic font family." |
@bpasero not sure what's best for Windows and macOS, but for Linux I think this is what we want - use the standard system font. on Ubuntu this should map to "Ubuntu Regular" which is what we used anyway. |
@jhasse @Tyriar it seems we are trying to fix an issue on Linux but this PR impacts Windows and macOS too. If so, I suggest to make this PR fix it only on Linux. Does that make sense? /cc @joaomoreno |
This won't impact Windows and macOS, as <span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', 'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif">The quick brown fox jumps over the lazy dog</span><br/>
<span style="font-family: system-ui">The quick brown fox jumps over the lazy dog</span> From Chromium's commit message (emphasis mine):
|
@jhasse wouldn't it make sense to just change this font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; to this: font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; Just in case for some reason system-ui does not work? Or is there a guarantee it will work. Since this change impacts standalone editor, markdown and terminal, I am adding more people to give feedback on this cross-cutting change. Especially in the standalone editor I think we cannot just use the system-ui font because we also need to run on other browsers. As such I think |
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.
Imho we should just search+replace -apple-system, BlinkMacSystemFont
with system-ui
.
Also, why is the font not changed for the language specific overrides (e.g. .monaco-shell:lang(zh-Hans)
) here?
In Chromium >= 56 it is guaranteed to work, but as you said:
I didn't know that. It won't work in e.g. Firefox.
Yes, good idea. Those never worked in other browsers anyway AFAIK.
Those didn't include the |
If I understand it correctly, I think font-family:
"Segoe WPC",
"Segoe UI",
"HelveticaNeue-Light", /*is this mac only too?*/
system-ui,
sans-serif; /*just in case*/ |
Windows isn't an issue (see #25570 (comment)), but browsers other than Chrome/Chromium/Electron are. Therefore this approach ( |
So it should probably only apply to |
@jhasse I think we only need the non system-ui fonts in Monaco which is |
Fixed :) |
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.
LGTM
Here goes 😄 Thanks @jhasse, this should be in tomorrow's Insiders build. |
Unfortunately this change breaks the VS code UI on Windows. The reason is most likely because I do not use Segoe UI as a system font, but Tahoma (Segoe UI is mapped to Tahoma in the Windows registry key via FontSubstitutes). It seems that whatever is used in the back end to render fonts does not use FontSubstitues and thus render using a default font (looks like Times New Roman or similar which makes the UI not so great). My case is special but wouldn't it be possible to have this configurable (even after a restart of VS code)? For the time being, I'm hacking directly the file workbench.main.css to fix this rendering. Thanks |
What font do the menus (File, Edit, ...) use in your setup? Tahoma or also the Times New Roman like font? |
The menu uses Tahoma as expected. Only what is in the client area of the window is using the wrong font. |
Strange. Does adding Do you see any similar bugs in Chromium? I'm not sure where they use Btw: What is the preferred way to change the UI font on Windows? |
@jhasse The issue is Chromium as specifying system-ui or Segoe UI does the same :-( it uses the wrong font. Maybe I should fill a bug over there instead. Still having the choice of choosing your UI font seems reasonable. On Windows, there is no more supported way of changing the default font (in Pre windows 8, it was possible), but basically I did exactly what this article recommends: http://www.windowscentral.com/how-change-default-system-font-windows-10, ie wiping out the entries for Segoe UI and adding a FontSubstitutes for Segoe UI to map to Tahoma. |
Hm ... why (how) did it work before this PR then? |
Not completely sure but maybe it failed loading up Segoe UI so it continued through the list whereas now, it defaults to Segoe UI no matter what. Unfortunately I cannot test the non-insider version as I'm blocked by issue #26666 which is the reason why I found this font issue with the latest insider. On the positive side, it forced me to reconsider how I do font override and found how to ensure that VS Code/Chromium is using what I want by following the steps here: https://www.windows10forums.com/threads/change-font-type.1308/ which is more or less how you would do it in the old days of Windows. So for now I'm happy. Thanks for the interest in my issue! |
Wait a second. If I'm not mistaken this
means that we can add |
I'll check this in about 10h. |
IMHO Tahoma looks even better then than 1.12 (it matches the menu for example). 1.12 might be I've reported the bug at Chromium's bug tracker and created a pull request for adding Tahoma: #26912 |
Note that it looks good on my screenshots because my whole system is using Tahoma. It should look equally well if you use Segoe UI or some other fonts as your default. |
@manu-silicon I've followed this guide https://www.windowscentral.com/how-change-default-system-font-windows-10 but couldn't reproduce the Times New Roman issue. |
Actually there is something else in my setting on top of not liking Segoe UI, I do not like anti-aliased fonts as they appear too blurry on low dpi display. So in the Windows advanced settings I disable font smoothing and in the registry key I have the following settings in HKCU\Control Panel\Desktop:
You might need to log off to see the effects. |
Thanks, I've changed my settings and now also have anti-aliasing disabled. Still I couldn't reproduce the serif font being used for |
https://bugs.chromium.org/p/chromium/issues/detail?id=654679
Fixes #10144.
As @Tyriar pointed out,
sans-serif
didn't work. But Chromium 56 addedsystem-ui
(similar to-apple-system
but for all operation systems) in Electron :)