vscode icon indicating copy to clipboard operation
vscode copied to clipboard

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

Open globalchubby opened this issue 10 years ago • 73 comments

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?

globalchubby avatar Jan 31 '16 05:01 globalchubby

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

alexdima avatar Feb 02 '16 14:02 alexdima

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

globalchubby avatar Feb 02 '16 15:02 globalchubby

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.

alexdima avatar Feb 04 '16 11:02 alexdima

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?

Codemaverick avatar Feb 10 '16 16:02 Codemaverick

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

wprater avatar Oct 17 '16 03:10 wprater

How do you do that @wprater?

rafmst avatar Nov 17 '16 16:11 rafmst

@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.

akabiru avatar Nov 21 '16 15:11 akabiru

@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?

rafmst avatar Nov 21 '16 18:11 rafmst

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

akabiru avatar Nov 21 '16 18:11 akabiru

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

chriskrycho avatar Dec 06 '16 13:12 chriskrycho

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

icewind avatar Dec 14 '16 10:12 icewind

@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.

jimmykamau avatar Feb 25 '17 12:02 jimmykamau

@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!

guillenotfound avatar Feb 25 '17 14:02 guillenotfound

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

thiyagaraj avatar Feb 27 '17 04:02 thiyagaraj

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

natesilva avatar Mar 13 '17 16:03 natesilva

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.

ZER0 avatar Apr 06 '17 14:04 ZER0

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/

MIPSpro avatar May 02 '17 01:05 MIPSpro

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.

wprater avatar May 02 '17 01:05 wprater

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.

icewind avatar May 03 '17 10:05 icewind

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

rossPatton avatar May 14 '17 04:05 rossPatton