-
Notifications
You must be signed in to change notification settings - Fork 266
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
Text appears blurry on Desktop (Windows) #682
Comments
Hmm, that is quite curious... We have already applied the recommended fix in that Electron FAQ entry, yes. I'll try to get some feedback from other Windows users to see if this affects them as well. |
Can you try reproducing this on another Electron app, e.g. Atom, VSCodium, etc.? |
Hmm, this is quite a perplexing one... Other people in the community have said they are not affected by this on Windows, so it suggests to me that something system specific is happening here... @AgentOak Are you perhaps pinning Element to a specific GPU, or have you made any other "customisation" to the app like that, which might explain the difference between Element vs. your other apps? |
I have seen one such image posted in #element-web:matrix.org where the poster said they weren't affected, but zooming in to the text shows that it's using the same grayscale rendering as in my screen
The system I'm on only has one GPU, a Geforce GTX 670 with recent Nvidia Drivers 456.71. The GPU doesn't seem to affect anything anyway; launching Element with --disable-gpu changes nothing about the font rendering. |
I wonder if the problem here is that the fix we use to make the fonts look crisp at retina on macOS (i.e. to use pure greyscale antialiasing rather than colour-fringing subpixel antialiasing) is now having the opposite effect on Windows (despite us thinking otherwise at element-hq/element-web#11425 (comment):
@AgentOak can you try opening the network inspector in Electron and hunting down the |
DevTools show that the |
I don't think you're going to need any For me the difference is also quite noticable, as I can switch the app between my 4K primary monitor and "regular" secondary monitor. The app looks crisp in 4K (where blurry antialiasing is "hidden" by pixels that are too tiny to see anyway), but more blurry than it ought to on my secondary monitor. And since I'm on Windows 10 20H2, I really doubt any OSX-specific properties are going to fix anything. Shouldn't text just render crisp without any of those properties? Same as Chrome, essentially. The default should be good, as most websites don't use those tacky platform-specific properties, and they all render absolutely fine on all three platforms. |
That's what I thought as well. Element continues to be the only application I use suffering from this poor font rendering. The Electron wiki mentions some other causes for this issue (besides the opaque window background) like transforms or subpixel positioning, but for lack of experience with Chromium/Electron I'm not able to diagnose this issue on my own. |
I'm making some progress here... I can reproduce the issue in Element and the Electron Fiddle does not exhibit the problem, so it's definitely something specific to what we are doing. It's not the font smoothing settings either. I'll need to dig a few steps further, but hoping to have a cause isolated soon. 😄 |
Current StatusFrom my perspective, this is effectively a Chromium rendering choice / regression, and you can find many bugs across the Chromium bug tracker around different variants of this issue over the last few years, such as https://bugs.chromium.org/p/chromium/issues/detail?id=1016062. It appears we can apply various CSS workarounds to regain ClearType's subpixel antialiasing, by adding things like:
However, it feels like a nasty hack to me, as it may force other browsers to use less optimal paths purely to solve a Chromium-specific issue. There's nothing specific to Electron here, as the same issue is observable in Chrome as well. Other AppsLooking at how other similar apps perform in Chrome on Windows:
Next StepsRather than applying the hacks above, it would be better to work out precisely which things are causing Chromium to fall back to grayscale in our case. This will likely require some painful CSS bisection. 😖 |
Slack definitely doesn't look nowhere near as blurry as Element does, even though it does indeed appear to render with greyscale antialiasing... So there might be something else at play than just subpixel vs greyscale. |
I'm curious to know if there's any progress being made. I thought the fix could be copypasted from any other opensource electron-based application. There are two issues at play:
The second issue is solved in a number of other electron-based applications, among which are Slack and VScode. Having their fix in Element as well, may solve the problem. They too have greyscale rendering rather than subpixel. But they do render sharp text regardless. As for greyscale rendering vs subpixel, that's an additional improvement that could further improve clarity. |
No further progress has been made. I'm sure this issue will be updated when it happens. |
Sad to hear it. Anything I can do to help? |
Isn't the actual issue that the Inter font used by Element does not have hinting? Same for the Inconsolata font for code, etc. No amount of messing with rendering settings is going to fix that, you need to either (auto)hint the fonts or use different ones. |
@madig I tested with the Arial system font (which can be set in Element settings -> Appearance -> Show advanced) in the screenshots above. It's better than the default font which is completely unbearable to me, but still blurry. |
Trying to figure out how VSCode team solved this problem, as I remember even last year that VSCode was super blurry on my windows machine for some reason, but I didn't investigate. |
It seems that in Discord in Chrome the sub-pixel rendering is not turned on for every layer. It's not working for rooms, your chats, etc, but works for the general chat. Generally the rendering is very inconsistent even though it looks good. Probably this issue should consist of two separate things: |
Found the culprit: It's this line of css: seems that for some, still unknown to me reason, chrome decides to make a layer that's of a size of the entire window, even if you constraint it. If you want to use |
I wonder if it shouldn't be using |
Pull request solving this problem (in progress): matrix-org/matrix-react-sdk#6262 |
Related, as it should reduce layout trashing and remove the case where we have couple of frames of improper font (grayscale) when loading new messages matrix-org/matrix-react-sdk#6054 |
From element-hq/element-web#22267
Which does seem to reinforce that an option to disable hardware acceleration on windows would be useful. |
What I did: What it means: Additional notes:
|
This should not be a preference. Or at least there should be a good default, not a blurry one. After all, this problem will exist for everyone. As long as they run Element on Windows, on an LDPI monitor. |
Given this issue has only a single upvote, it does not seem that many people are encountering a blurry font for whatever reason. |
Or they aren't noticing it, or they aren't reporting it. And also, this preference doesn't excuse you from properly hinting your custom fonts. Because they aren't. That's clear as day, isn't it?? |
@thany do you see hinting issues on Element Desktop only, or also on Element Web? Any difference between different browsers? |
@novocaine Let's try Firefox and Edge.
I'm comparing whatever Element's default custom font is, against Let me ask you the same question: are you seeing any hinting issues, especially when comparing the two? On Windows desktop, on different browsers? |
Thanks. I agree with you that Element should use a font that by default renders well on all screens, hardware and settings. There seem to be several factors in play on Windows which means people get differing experiences which prove hard to pin down:
I'm using OS X on a HDPI screen. |
This may be the issue; see also https://rsms.me/inter/#faq-unhinted-vs-hinted |
Can someone also please answer this: why is it important for Element to use a custom font in the first place? Why would literally any user care for this? |
It was chosen by product/design, so probably for brand identity & cross-platform consistency, maybe for functional reasons like ligatures. An answer to that question would be better found on https://github.com/vector-im/element-meta |
here is a draft PR with a hinted version of Inter: matrix-org/matrix-react-sdk#8676 can you try the resultant build here and indicate whether you prefer this rendering on your super awesome lodpi windows rig |
@novocaine No need to be diminuitive of someone not having all HDPI screens. The resultant build is slightly better. But it's still no match for a system font. |
downgrading because of the impact it has on the collective user base: most people do not appear to be reporting this, or it's not severe enough to be considered a problem by those people. |
I'd been just waiting quietly to see if something would happen. Have been experiencing the blurry text myself. |
Yes, I've had the same experience with the blurriness, Firefox does fine, but it seems even still after disabling Hardware Acceleration that it still is blurry. Discord was the same until l I disabled Hardware Acceleration. I'm not exactly sure whats causing it. Also marked over some things that I didn't want people to see, sorry if it looks Photo-shopped because of it. Just privacy reasons. |
Maybe I will give this a go, even though I believe it should be fixed in the app, not in the computer... It does baffle me that hardware acceleration can cause blurriness. You'd expect hardware acceleration to only, you know, accelerate 🤨 |
@thany @DjStephLordPro @Ryonez can you provide as much details about your OS and hardware as possible? This very much seems like a graphics card drivers issue, and not really something that can be easily fixed in an app. |
Alright. Just tell me what you need. |
Anything you can tell: Thanks. |
Same issue here with text blurriness. Disabling hardware acceleration worked.
|
It's not a solution though, please keep that in mind. Besides, lucky that this workaround fixes it for you, but it's not the fix for everybody. |
Description
Compared to other applications and Element Web in Firefox, text appears blurry in Element Desktop.
Steps to reproduce
Example screenshot taken with system font Arial, 14pt in a random matrix room:
(open in new tab so it is unscaled)
All fonts in the UI are affected, not just chat messages. I don't have any other applications where I have seen this problem before. In other applications and Firefox, fonts look very sharp by comparison. This is the same text screenshotted from Element Web in Firefox 82:
Through older issues I've found https://github.com/electron/electron/blob/master/docs/faq.md#the-font-looks-blurry-what-is-this-and-what-can-i-do and it very much looks like that problem, but as I understand this is supposed to be fixed already?
Logs being sent: no
Version information
The text was updated successfully, but these errors were encountered: