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

Typography tune-up needed #9152

Closed
bgashler1 opened this issue Jul 12, 2016 · 25 comments
Closed

Typography tune-up needed #9152

bgashler1 opened this issue Jul 12, 2016 · 25 comments
Assignees
Labels
debt Code quality issues info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X ux User experience issues
Milestone

Comments

@bgashler1
Copy link
Contributor

bgashler1 commented Jul 12, 2016

On VS Code for Mac, Windows and Linux we're using system fonts to fit in with the OS.

TODOS:

Apply OS-specific guidelines on typography for optimal legibility and visual consistency
https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
https://msdn.microsoft.com/en-us/windows/uwp/style/typography

Ensure a consistent visual hierarchy, and check consistency in
Font-weight
Font-size
Line-height
Using the font features as typeface intends (tracking, kerning, anti-aliasing).

Mac feedback

Some feedback from our users

Some feedback from users of other products who use San Fransisco in Chrome

@bgashler1 bgashler1 added ux User experience issues macos Issues with VS Code on MAC/OS X labels Jul 12, 2016
@bpasero
Copy link
Member

bpasero commented Jul 13, 2016

@joaomoreno fyi

@joaomoreno
Copy link
Member

joaomoreno commented Jul 13, 2016

AFAIK, the font is what Apple recommends for small type. #9055

@brunnopleffken
Copy link
Contributor

San Francisco seems to have a quite large letter spacing in Chromium when using the system font alias as font-family, leaving this "cluttered" feeling of the UI.

I found that instead of BlinkMacSystemFont (-apple-system is useless in Visual Studio Code as it doesn't target Chromium, only Safari and iOS), using '.SFNSDisplay-Regular' seems to solve. It uses exactly the same San Francisco Display family and there's no kerning or letter spacing issue; and this without changing the font weight or size.

With this fix, letter spacing and kerning of SF will look like the same as using Segoe UI in Windows, or Ubuntu in... well... Ubuntu, or Helvetica Neue in OS X Yosemite, giving us a much better feel!

@fitojb
Copy link

fitojb commented Jul 16, 2016

Please use Display only for display sizes (e.g., large headings), but not for regular UI copy, where it isn’t appropriate. Let Chromium/Electron fix their spacing issue.

@brunnopleffken
Copy link
Contributor

I strongly disagree @fitojb. This is a recent issue, they're still tracking it and trying to find a way to solve it as you can see in their forums (it's not an Electron issue, it also affects Google Chrome and Opera), so just sounds like "we will use this feature and wait for the vendor to fix it". Is just counter-productive! So isn't also appropriate "downgrade" to Helvetica Neue until the issues with San Francisco's kerning/letter space rendering are fixed? Otherwise feels like the UI font is Verdana or any other wide typography! In a sidebar, with lots of files and folder names, in my exp., I have to make it even wider (= less area to code) in my MacBook 13".

In the mid-2010's we learned that typography is everything! BTW, this is not a website, is a software, currently it just doesn't fit well with the UI and, IMHO, it just doesn't fit in a code editor that is filled with lot of information all the time!

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug labels Aug 17, 2016
@wprater
Copy link
Contributor

wprater commented Oct 21, 2016

a quick fix for macOS seems to be applying -webkit-font-smoothing: antialiased; to the editors content or the whole UI.

@brunnopleffken
Copy link
Contributor

@wprater But this will also remove the subpixel antialiasing in non-Retina displays (low-DPI screens), which is undesirable.

@wprater
Copy link
Contributor

wprater commented Oct 21, 2016

ahh, thanks for the note about that.

can't we just use a media query to select on the pixel density?

Implementing #459 to allow for fine grained control would be helpful too.

@joaomoreno joaomoreno removed their assignment Nov 1, 2016
@wprater
Copy link
Contributor

wprater commented Dec 8, 2016

we can use a query like this to set the font-smoothing. probably only need to use the min-resolution tho

@media 
(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { 
    /* Retina-specific stuff here */
}

Would it be suitable to add something like this to a PR? I'd love to see crisper fonts all around.

@bgashler1
Copy link
Contributor Author

@wprater if you can verify this improves hdpi screens and doesn't negatively affect regular screens, this would be a great PR. Thanks! We will need to test it on Linux, Windows and Mac hdpi screens to verify before merging into master.

@brunnopleffken
Copy link
Contributor

brunnopleffken commented Dec 8, 2016

@wprater @bgashler1
Whatever you do to the high-DPI screens (propably you're talking about the -webkit-font-smoothing: antialiased trick), be aware that this should apply ONLY to the dark theme, as applying to the light theme will make the font rendering appear WAY TOO thin, making it really difficult to read!

TextMate also does this distinction when changing between light and dark themes.

wprater added a commit to wprater/vscode that referenced this issue Dec 11, 2016
@wprater
Copy link
Contributor

wprater commented Dec 11, 2016

Whatever you do to the high-DPI screens (propably you're talking about the -webkit-font-smoothing: antialiased trick), be aware that this should apply ONLY to the dark theme, as applying to the light theme will make the font rendering appear WAY TOO thin, making it really difficult to read!

I applied it to all the themes, looks much better to me. However, I assume this could be subjective and will leave it up to others to help determine how/if we should apply the change. Its easy enough to restrict to each theme type (dark, light, hc).

/cc @brunnopleffken

@syabro
Copy link

syabro commented Jan 22, 2017

You can add

body {-webkit-font-smoothing: antialiased;}

to

/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.css

@agauniyal
Copy link

On my system (Linux) the fonts appear to be thinner on vscode than chrome would display them.

@bpasero bpasero removed the workbench label Nov 17, 2017
@stevencl stevencl assigned miguelsolorio and unassigned stevencl Sep 11, 2018
@stevencl
Copy link
Member

You'll have a better idea about what we might want to do here @misolori.

@brunnopleffken
Copy link
Contributor

brunnopleffken commented Sep 11, 2018

Wow, it's been a long time since this issue was created! Well, actually this issue is a Chromium bug with CoreText that was fixed in Chrome 64.0.3258.0: "Fix tracking for Mac system fonts" (487f920d...).

AFAIK, VSCode still uses Chrome 61, so the kerning of San Francisco font family is still broken. There's no need to fix or workaround it on VSCode itself, basically and updated version of Chromium should fix this issue, making the rendering of SF looking amazing like on Safari.

@bpasero
Copy link
Member

bpasero commented Sep 11, 2018

@brunnopleffken we have builds up and running with Chrome 66 if you want to test it out:

Download:

@brunnopleffken
Copy link
Contributor

Just tested VSCode Exploration with Electron 3.0/Chrome 66 and there are differences to font rendering. As Chrome 64 fixes the kerning of San Francisco fonts using macOS' CoreText, the dots and dashes, letters like T, V, A, W uses the correct kerning and are readable as the native UI (seems less "monospaced"). I made a diff:

(Chrome 66 is magenta; the old Chrome 61 is lime)
screen shot 2018-09-11 at 14 17 14
screen shot 2018-09-11 at 14 17 34
screen shot 2018-09-11 at 14 21 48

@fitojb
Copy link

fitojb commented Sep 11, 2018

Thanks for properly waiting for Chromium to properly fix the issue instead of introducing ridiculous workarounds downstream (like using display fonts for body text)!

@miguelsolorio
Copy link
Contributor

@bpasero what are our current plans for upgrading to Chrome 66?

@bpasero
Copy link
Member

bpasero commented Sep 12, 2018

@misolori this year is all I can predict

@miguelsolorio miguelsolorio added this to the Backlog milestone Sep 12, 2018
@jkyeung
Copy link

jkyeung commented Sep 17, 2018

Thank you to all the contributors in this thread! The fact that there are other people who care enough about font rendering to make this an actual issue is very reassuring.

Thanks especially to @bpasero for the link to the Chrome 66 build and @brunnopleffken for testing.

I can confirm that the Chrome 66 build makes a difference. I've been trying to tweak the kerning of a font using FontForge on Windows 7, and it was really frustrating that some of my changes were showing up but some weren't (in the mainstream VS Code build). As a total noob to font editing, I would have assumed it was just me not knowing how to use FontForge properly, but when I used the same modified font in another editor (SciTE), all my kerning changes did show up. So I went looking for VS Code issues, and fortunately found this one. The VS Code exploration build renders all my kerning changes as I intended them.

Update:
Spoke too soon. :( The Chrome 66 build does render more of my changes, but still not all of them.

Further update:
Evidently "syntax highlighting boundaries" come into play. I'm using this font in the main editing window. In both builds, VS Code will do all my kerning as long as both characters in the pair are within strings. Chrome 66 will kern my (right paren, comma) pair even when they are not in a string (i.e. they are actual punctuation in code) but Chrome 61 will not. Neither one kerns my (quote, comma) pair if the quote ends a string and the comma is just outside the string (which for me means they are different colors).

So... is what I'm describing a VS Code issue after all? Or is it still upstream? Should I open a new issue?

@daviddossett
Copy link
Contributor

daviddossett commented Dec 6, 2022

@bgashler1 I'm doing some housekeeping—is this still a relevant issue? I know there has been a ton of changes in the last six years so I don't have a good sense of the delta from 2016 to now.

@daviddossett daviddossett added the info-needed Issue requires more information from poster label Dec 12, 2022
@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2022
@bgashler1
Copy link
Contributor Author

@daviddossett I'm not sure. A lot has changed in the product and Electron's Chromium renderer since when I created this. At the time, we had some weird tracking issues in some platforms, but I haven't noticed them lately. Probably good to close the issue—as has been done already—and open new issues as needed.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X ux User experience issues
Projects
None yet
Development

No branches or pull requests