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

Provide an option to enable DirectWrite #1896

Closed
luca-moser opened this issue Jan 9, 2016 · 98 comments
Closed

Provide an option to enable DirectWrite #1896

luca-moser opened this issue Jan 9, 2016 · 98 comments
Assignees
Labels
electron Issues and items related to Electron font-rendering Font rendering issues info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@luca-moser
Copy link

I am using VS Code on a 4k monitor (ASUS PB287Q 4K) and have set Windows 10's scaling on that monitor to 150%. VSCode fonts inside the editor are extremely blurry.

Look at this example (scaling in Windows 10: 150%, editor.fontSize:: 13, window.zoomLevel: 0):
vc4k_blurry

The code in the background is very blurry (please open the image in a new tab to really see it), while the dialog in the foreground is not (just for comparison).

I tried to play around with the edtior.fontSize/window.zoomLevel options, but there isn't any way to get the font crisp. Using --disable-direct-write and --force-device-scale-factor=1.0 to start VS Code also doesn't fix the issue.

@luca-moser luca-moser changed the title VS Code editor fonts look blurry when scaling VS Code editor fonts look blurry on Windows scaled monitor Jan 9, 2016
@luca-moser luca-moser changed the title VS Code editor fonts look blurry on Windows scaled monitor VS Code editor fonts look blurry on Windows 10 scaled monitor Jan 9, 2016
@rickmed
Copy link

rickmed commented Jan 9, 2016

+1

@alexdima
Copy link
Member

cc @egamma

@bpasero Looking at electron/electron#3349 looks like we still have a blurry font issue on windows until we adopt an Electron version with Chrome 47 -- the patch of Electron v0.34.4 only covers Linux.

@alexdima alexdima assigned bpasero and unassigned alexdima Jan 12, 2016
@bpasero
Copy link
Member

bpasero commented Jan 12, 2016

@alexandrudima yup

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Jan 12, 2016
@bpasero bpasero added this to the Backlog milestone Jan 12, 2016
@kanreisa
Copy link

👍

@luca-moser luca-moser changed the title VS Code editor fonts look blurry on Windows 10 scaled monitor VS Code is blurry on high DPI monitors (Windows 10, 125%) Feb 3, 2016
@luca-moser luca-moser changed the title VS Code is blurry on high DPI monitors (Windows 10, 125%) VS Code is blurry on high DPI monitors (Windows 10, 150%) Feb 3, 2016
@SeriousM
Copy link

SeriousM commented Feb 9, 2016

Any updates on that?
The blurriness is really annoying!

(notice the blur-effect on two different documents)
image

@bpasero
Copy link
Member

bpasero commented Feb 9, 2016

We can only solve this by updating Electron to a newer version but currently are blocked because of a native node crash.

@luca-moser
Copy link
Author

For reference, he is talking about electron/electron#4299

@pprice
Copy link
Contributor

pprice commented Feb 21, 2016

FWIW, this is also true on OSX (10.11.3) with 96 DPI monitors, but setting the zoom level to vscode to anything other than default (e.g. I have "window.zoomLevel": 1).

It appears to be related to 'subpixel' scrolling of the editor text area. Might be different issue, however.

@iHuahua
Copy link

iHuahua commented Mar 3, 2016

i think the issue should be fixed by electron, Chrome has no problem.
so, u can set the monitor's scaling to 100%, and font size 20+, it‘s very clear, just look like MAC retina.

@luca-moser
Copy link
Author

@iHuahua that is definitely not a workaround. Having a Windows 10 installation on a 4k monitor without scaling is absolutely tedious to say the least (I'd like to preserve my eyesight for the next years...).

@daniel-dia
Copy link

I just found the problem found a "translate3d" CSS transform that makes it blurry.
I disabled the CSS and it becomes SHARP!!! take a look

blurry text

Left side is folder tree, and right side is code panel.

@bpasero
Copy link
Member

bpasero commented Mar 11, 2016

Interesting, so you say the explorer is always sharp but the editor is not for you?

@daniel-dia
Copy link

exactaly. and It realy seems to be a GPU rendering issue.
Removing the"translate3d" CSS transform (GPU Process) it becomes sharp.
Starting code with "--disable-gpu" too.

@alexdima
Copy link
Member

@artsjedi What settings are you using and what theme is that?

@daniel-dia
Copy link

@alexandrudima default dark theme. using windows 10, febury updated, on surface pro 3. 2016-02 build.

@bpasero
Copy link
Member

bpasero commented Apr 21, 2016

We pushed a major update to the UI framework to our insiders release and would appreciate feedback if this issue got resolved. You can give it a try from our insiders release today: http://code.visualstudio.com/Download#insiders

Happy for feedback!

@phraemer
Copy link

phraemer commented Apr 21, 2016

Unfortunately not on Windows 10
150% text size on a 3840x2160 monitor.

Beware how you view the image below. Your browser might rescale it.

blurtext

@lediur
Copy link

lediur commented Apr 21, 2016

On a Surface Pro (150% scaling) attached to an external monitor (100% scaling), 1.0.1-insider still has blurry UI elements. All the screenshots below are scaled so the 100% versions are shown at actual size.

I think it's definitely getting better though.

External monitor (100%)
scaled-to-100

Surface Pro screen (150%)
scaled-to-150

For comparison, on 1.0.0:
External monitor (100%)
1 0 0-100

Surface Pro screen (150%)
1 0 0-150

@DanTup
Copy link
Contributor

DanTup commented Feb 11, 2018

I'm not sure this is specific to Windows; here's screenshots of VS Code (1.20.0) from my MacBook (Mac OS High Sierra) connected to a monitor. Left is the MacBook (2017 12" MacBook) screen and right is the external screen (an LG 29" 1080p Ultrawide).

screen shot 2018-02-11 at 14 46 27

As mentioned above; it's not just the editor, all of the text including tabs and explorer are blurry on the external screen. Happens even if I launch Code on the second display, so I don't think it's related to dragged the window from one to the other.

@seppemarotta
Copy link

seppemarotta commented Feb 13, 2018

I fixed my resolution by enabling "Disable display scaling on high DPI settings" under the preference tab of Visual Studio Code Properties.
fix

@alien2003
Copy link

The same thing on Manjaro

@anacondaq
Copy link

anacondaq commented Apr 6, 2018

This is the very strange thing, that people trying different solutions related to GPU, and did not realize that the issues in some cases (I can confirm that) with Nvidia control panel and FXAA (and option below)

Try to play with Antialiasing FXAA option if you have Nvidia graphics card, and the issue will be solved.
What about internal graphics cards on resolutions nonstandart and not native (not 1080p with any scaling) thanks to direct-write bugs you will have blurry text. I don't know if someone will be able to fix this blurry text in direct-write, and will be greatly grateful if someone shares it to me because it fills fix tons of issues with other apps based on the electron.

@alien2003
Copy link

@Anacondaqq where is Aliasing FXAA option on Manjaro Gnome?

@anacondaq
Copy link

@alien2003 Sorry, I do not know. But my comment is correct, and I can, again and again, confirm that.
On Windows 1804 the situation MUCH MUCH better with font rendering.

@jacob-arlington
Copy link

jacob-arlington commented May 13, 2018

I solved this with update my driver and set

conservative morphological anti-aliasing to off

https://goo.gl/TtNi7K

@alien2003
Copy link

@jacob-arlington how to do it on Manjaro Gnome?

@jacob-arlington
Copy link

@alien2003 what is your graphic card?

@alien2003
Copy link

@jacob-arlington Intel® HD Graphics 620 (Kaby Lake GT2)

@jacob-arlington
Copy link

@hectorfarahani
Copy link

My issue on second monitor fixed by changing DPI setting to 100%.

@bpasero
Copy link
Member

bpasero commented Sep 10, 2018

We are building exploration builds that use a much newer version of Electron (our UI framework). I wonder if this issue reproduces with one of these builds, could you try? Download:

@bpasero bpasero added the info-needed Issue requires more information from poster label Sep 10, 2018
@anacondaq
Copy link

anacondaq commented Sep 10, 2018

@bpasero the problem with DirectWrite on windows. If you have a way to return back DirectWrite flag (chrome://flags) like on CentBrowser to turn off DirectWrite and render all text via GDI+ the solution will solve the issue.

Btw, these 1.28 builds run SO smoothly and fast. Noticeable differences. Good work.

@bpasero bpasero changed the title VS Code is blurry on high DPI monitors (Windows 10, 150%) Provide an option to enable DirectWrite Sep 10, 2018
@bpasero bpasero removed the info-needed Issue requires more information from poster label Sep 10, 2018
@merill
Copy link

merill commented Sep 12, 2018

@bpasero This exploration build fixed the blurriness on my 43' 4K monitor scaled to 125% on 3840 x 2160. Thanks!!

@unode
Copy link

unode commented Oct 29, 2018

I'm experiencing a similar issue in Linux although in this case it seems to be due to a non-uniform aliasing effect across the screen.

The following are 2 screenshots taken on:
screenshot_2018-10-29_21-08-48_875055699

The font used is Envy Code R at 2 different sizes:

Size 13:
screenshot_2018-10-29_21-28-44_890043110

Here you can see a rainbow-like effect across the screen. The pattern changes every 14 characters cycling 4 different color patterns. green, orange, violet, blue, green, ...
m was used as it makes the aliasing effect more noticeable.

Size 14:
screenshot_2018-10-29_21-03-33_971367519
Similar situation but here the rendering cycles every character and contrary to the previous it alternates between 2 patterns only.

Using --disable-gpu has no effect.

In contrast the same font and size on rxvt-unicode displays no such artifacts:
screenshot_2018-10-29_21-24-43_615369488

What is even more disturbing is that the font renders perfectly in the embedded terminal:
screenshot_2018-10-29_21-27-01_512520030
Even better than in rxvt-unicode (IMO).

@bpasero
Copy link
Member

bpasero commented Oct 9, 2019

Given #15211 (comment) there will be a way to configure Chrome command line switches to be used on each startup. If there is a specific flag that makes the situation better for users, please let me know and we can think about supporting it there.

Otherwise I would like to close this issue as it seems not actionable from the VSCode side of things.

@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 10, 2019
@bpasero bpasero closed this as completed Oct 15, 2019
@jeanabraham
Copy link

I'm not sure this is specific to Windows; here's screenshots of VS Code (1.20.0) from my MacBook (Mac OS High Sierra) connected to a monitor. Left is the MacBook (2017 12" MacBook) screen and right is the external screen (an LG 29" 1080p Ultrawide).

screen shot 2018-02-11 at 14 46 27

As mentioned above; it's not just the editor, all of the text including tabs and explorer are blurry on the external screen. Happens even if I launch Code on the second display, so I don't think it's related to dragged the window from one to the other.

@DanTup I'm noticing the same with my macbook vs ultrawide monitor. However, I find that the fonts of my Terminal window are extremely clear even on the ultrawide. Were you able to figure out how to make the text sharp on VScode by any chance? Thanks!

@DanTup
Copy link
Contributor

DanTup commented Nov 27, 2019

@jeanabraham I didn't figure it out - I tend to always use VS Code directly on the MacBook screen instead. My terminal is also fuzzy on the external screen - though I remember seeing some popup about terminal performance once offering to change renderer - I don't remember if I agreed or not, but maybe that's a reason for a difference.

@jeanabraham
Copy link

@DanTup thanks! Ok. I decided I'll just trade in my ultrawide for 4k instead!

@DanTup
Copy link
Contributor

DanTup commented Nov 29, 2019

It's kinda funny that that might be the easiest fix 😄

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron font-rendering Font rendering issues info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests