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

Add option to turn off anti-aliasing for editor font. #2577

Closed
yangmillstheory opened this issue Jan 31, 2016 · 73 comments
Closed

Add option to turn off anti-aliasing for editor font. #2577

yangmillstheory opened this issue Jan 31, 2016 · 73 comments
Assignees
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@yangmillstheory
Copy link

Thanks for the great product!

Sublime Text allows you to turn off anti-aliasing, which looks great for some fonts:

{
    "font_face": "MS Gothic",
    "font_options":
    [
        "no_antialias"
    ],
    "font_size": 18,
}

I've looked around, but there doesn't seem to be an easy way to do this. Is there a way for me to do this in VSCode?

@alexdima
Copy link
Member

alexdima commented Feb 2, 2016

VSCode is built on Electron, and the rendering is basically Chromium.

-webkit-font-smoothing: none; used to control that, but it doesn't look like it's doing anything for me on windows

@yangmillstheory
Copy link
Author

Thanks @alexandrudima; I use that rule with the Stylish plugin. Do you where I can set that setting on VSCode?

@alexdima
Copy link
Member

alexdima commented Feb 4, 2016

At this time, we don't give a straight-forward way to directly customize CSS, neither from an extension nor from a user configuration option. Short of editing the .css files we ship with (and lose the edits on updates) there's nothing I can think of. Even then, I have tried the -webkit-font-smoothing: none; and it doesn't seem to have any effect.

@Codemaverick
Copy link

I use VSCode on a mac, and I have to say I much prefer having this as an option rather than not. Is it possible to make it a feature request?

@alexdima alexdima added the feature-request Request for new features or functionality label Feb 11, 2016
@alexdima alexdima added this to the Backlog milestone Jul 5, 2016
@wprater
Copy link
Contributor

wprater commented Oct 17, 2016

do the themes have a way to expose this css prop on the editorPart yet? I can set it manually on macOS and it looks much better when I set -webkit-font-smoothing: antialiased

@rafatrace
Copy link

How do you do that @wprater?

@akabiru
Copy link

akabiru commented Nov 21, 2016

@ptraceur To set it manually Go to Help > Toggle Developer tools and then paste -webkit-font-smoothing: antialiased in the CSS section. It's only temporary though.

@rafatrace
Copy link

@akabiru I see... if I close vscode, it will get as normal again right? Do you have any idea on how to make this permanent?

@akabiru
Copy link

akabiru commented Nov 21, 2016

@ptraceur Yeah, it's a temporary fix. I'm not sure how to make it permanent at the moment.

@chriskrycho
Copy link

On any "retina" class monitor, the difference this makes is substantial. Please consider adding it as a configuration option.

@alexdima alexdima added the editor-core Editor basic functionality label Dec 12, 2016
@icewind
Copy link

icewind commented Dec 14, 2016

Just add an ability to use user.css like in Atom. Then it will be possible to gradually adjust anything.

@jimmykamau
Copy link

@akabiru @rafamds You can make the change permanent by adding -webkit-font-smoothing: antialiased; to the style declaration at the top of the file: /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/bootstrap/index.html (if you're on macOS). The editor will complain about your installation being corrupt but you can always ignore the warning. I'm not sure if it is persistent across updates though.

@guillenotfound
Copy link

@jimmykamau

Remember the scape chars :)

/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/bootstrap/index.html

But ye, it works!

@thiyagaraj
Copy link

DejaVu Sans Mono appears thinner(editor.fontWeight: normal) and is a workaround if you are ok with that font, atleast until disabling anti-aliasing is implemented(and if you dont want to modify the css/html)
https://www.fontsquirrel.com/fonts/dejavu-sans-mono

@alexdima alexdima removed their assignment Feb 27, 2017
@natesilva
Copy link

Apple’s SFMono-Light is another one that is not eye-searingly bold on a Retina screen. I’m using it for now. https://github.com/muhasturk/SFMono

@ZER0
Copy link

ZER0 commented Apr 6, 2017

In case anyone is interested, I created an extension to keep the changes across the updates: https://github.com/ZER0/roughify (mostly for a friend of mine).
I didn't publish it yet on Extension's Marketplace since it's modifying the app's core file, so I'm not sure if that is allowed.

@MIPSpro
Copy link

MIPSpro commented May 2, 2017

I use the SGI screen font converted to .ttf file for use on OSX. It result looks really nice and crisp in vscode.

https://njr.sabi.net/2015/11/01/sgi-screen-fonts-converted-for-os-x/

@wprater
Copy link
Contributor

wprater commented May 2, 2017

Im still finding myself opening up the developer tools every time to adjust these settings. APIs / editor options would be great, but use controlled CSS could work too. Problem with user css is that if can break other parts of the editor if applied incorrectly.

@icewind
Copy link

icewind commented May 3, 2017

From my point of view it should not prevent this feature to be added. Since this tool is aimed on developers and we are able to handle css :) The tool should be as flexible as possible and VSCode is flexible. With one exception.
At this moment constant fighting with fonts is most annoying thing in Code.

@rossPatton
Copy link

At this moment constant fighting with fonts is most annoying thing in Code.

Seriously. Please fix the font rendering. Having to paste the -webkit-font-smoothing: antialiased; fix every time I open the editor just to get somewhat Sublime Text level rendering is not a great experience

In sublime, I use the gray_antialias setting in font_options and it makes things much much better

@joerx
Copy link

joerx commented May 14, 2017

+1

@priithaamer
Copy link
Contributor

priithaamer commented May 25, 2017

Hi! I'm willing to tackle this as i prefer antialiased font as well. However, does anone have thoughts how it should be configured? Is font_options good way to do it?

@roman0x58
Copy link

roman0x58 commented May 25, 2017

@priithaamer I think it should be just "editor.fontAntialiasing" : "antialiasing" (none | subpixel-antialiased)

@kraftwer1
Copy link

kraftwer1 commented May 25, 2017

@priithaamer Excellent. I think another question is which parts of the UI exactly should be affected. Should it be the editor only (source code "words"), or also tooltips, terminal, menus and / or dropdowns?

In my personal favour, only the editor and related elements (everything that includes source code -
such as Peek Preview) and the terminal should be affected.

Any other opinions?

@priithaamer
Copy link
Contributor

@roman0x58 @kraftwer1 I'd prefer antialias to be applied to entire window on top level. It looks best this way.

@bpasero bpasero modified the milestones: July 2017, On Deck Jul 18, 2017
bpasero pushed a commit that referenced this issue Jul 18, 2017
* Add workspace.fontAliasing configuration option

Add simple boolean configuration option that controls how fonts are being rendered in workbench.

Enabling this option in configuration results with more native feel on macOS.

* Add different modes for workbench.fontAliasing

Support both additional "antialiased" and "none" methods on font antialiasing. Leaving subpixel-antialiased as default

See #2577

* Apply workbench.fontAliasing on document.body

Instead of using only workbench element, apply font aliasing setting globally on entire window.

See #2577
@bpasero bpasero added the verification-needed Verification of issue is requested label Jul 18, 2017
@bpasero
Copy link
Member

bpasero commented Jul 18, 2017

To verify: On macOS you can now control this via a new setting workbench.fontAliasing. The possible values are antialiased, none and default. This transforms into a -webkit-font-smoothing setting on the body element of the workbench.

@bpasero bpasero closed this as completed Jul 18, 2017
@anhvupham
Copy link

@bpasero should I wait for the new update to have that setting ?

@chriskrycho
Copy link

chriskrycho commented Jul 18, 2017

Should be in the next Insiders build, and then in the next major release.

@priithaamer
Copy link
Contributor

Please note that you have all reasons to be disappointed that editor.fontAliasing did not made into this pull request. I'm still working on it.

Thanks for the merge @bpasero

@icewind
Copy link

icewind commented Jul 21, 2017

As for me editor.fontAntialiasing will not resolve the issue. The font is crappy in tab bar/search/menus.
For me it is better to set -webkit-font-smoothing: antialiased to body tag. But this may not be acceptable for someone else.
Thats why I think that adding a support for user.css will be a best option. Anyone will be able to adust it as he wants. Without messages about corrupted install and 3rd party plugins

@wprater
Copy link
Contributor

wprater commented Jul 21, 2017

For me it is better to set -webkit-font-smoothing: antialiased to body tag. But this may not be acceptable for someone else.

The feature does add the property to the body, which fixes the areas you mentioned.

Have you tried it yet?

@weinand
Copy link
Contributor

weinand commented Jul 27, 2017

Looks bad on normal display:
2017-07-27_17-17-21

but slightly better on Retina:
2017-07-27_17-19-39

@weinand weinand added the verified Verification succeeded label Jul 27, 2017
@kraftwer1
Copy link

kraftwer1 commented Jul 31, 2017

@weinand It seems correct (on your normal display) but it looks like your font is not designed for non-antialiasing. Mine looks like this (I'm using Terminus).

bildschirmfoto 2017-07-31 um 08 41 44

@schnz
Copy link

schnz commented Aug 17, 2017

Is there anything I can do to achieve a similar result for Windows? Actually, this is currently the reason why I am still using Sublime over VS Code. I am using the no_antialias font option in Sublime and are quite used to the font style. Unfortunately the solutions proposed in this issue seem only to affect MacOS.

@mathewhany
Copy link

@Coksnuss Same here!

@thefill
Copy link

thefill commented Aug 27, 2017

@bpasero I confirm that this option works on macOS:
screenshot at aug 27 13-34-28

@mmarzec
Copy link

mmarzec commented Aug 31, 2017

The merge request #30628 is providing configuration but only for macOS platform.
Can we reopen the issue to add that option to Windows platform?

@schnz
Copy link

schnz commented Aug 31, 2017

@mmarzec I would love to have that option for Windows too. However, I fear that the WebKit engine does not support that possibility at all. Please correct me if I am wrong.

@mathewhany
Copy link

@Coksnuss I think Atom has options for font anti-aliasing, I'm not sure though.

@mmarzec
Copy link

mmarzec commented Sep 1, 2017

I think that "-webkit-font-smoothing" is supported on Windows on Chrome. But in case of no antialiasing there was recently a problem with DirectWrite font rendering in Windows which can't produce non antialiased fonts. The problem came since Chrome version 52 where old GDI font rendering was removed.
The problem is more detailed explained here: https://www.change.org/p/google-inc-bring-sharp-fonts-back-in-google-chrome-disable-directwrite

I am not very familiar how VSC is created but if it is based on Chrome than to have posibility to have non antialiased fonts it will be required to introduce same option of changing "-webkit-font-smoothing" on Windows and also compile Chrome with GDI font rendering possible.
As for GDI font rendering there is web browser based on Chrome - CentBrowser where they bring back GDI font rendering, so it should be possible.

@kraftwer1
Copy link

@priithaamer Are you by any chance working on editor.fontAntialiasing? :-)

@lumberman
Copy link

Very annoying to see any font so fat in this editor.

@priithaamer
Copy link
Contributor

@kraftwer1 I was working on editor.fontAliasing this summer and got done part of it. Too bad this change got merged so early, i lost part of the interest :) Sorry about this, i'd definitely want to finish the editor part of it.

@kraftwer1
Copy link

@priithaamer I see. I've just noticed that with the new September release, antialiasing in the built-in terminal doesn't seem to work anymore.

@KonaBlend
Copy link

fontAliasing is not only useful for workspace but pretty much anywhere one can specify a font/size.

For example, the built-in terminal, I would prefer Monaco font, size=10, fontAliasing=none because Monaco is designed for that. For editor, another font/size/aliasing.

As of 1.17.0 "terminal.integrated.fontAliasing": "none" has no effect on macOS. Also "editor.fontAliasing" has no effect.

@priithaamer
Copy link
Contributor

@kraftwer1 @KonaBlend Thanks for reporting this. I will take a look what happened with fontalias setting in terminal.

@smoothdeveloper
Copy link

What is the way to disable antialiasing in the editor? @bpasero mentions workbench.fontAliasing but it doesn't seem to be a known configuration setting nor to do anything when I add it to my user settings.

Thanks.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests