Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Text Rendering on macOS changed with Electron 3.0 #19356

Closed
as-cii opened this issue May 17, 2019 · 14 comments
Closed

Text Rendering on macOS changed with Electron 3.0 #19356

as-cii opened this issue May 17, 2019 · 14 comments
Labels
editor-rendering electron electron-3 Tasks related to upgrade to electron v3 mac Issues that occur on macOS but not on other platforms.

Comments

@as-cii
Copy link
Contributor

as-cii commented May 17, 2019

As reported in #18916 (comment), we observed a significant change in how text is rendered on a High-DPI display on macOS after upgrading Atom to use Electron >= 3.0.

Below you can find a zoomed-in screenshot of rendering the word Lorem in a variety of environments. Please, click on all of the images and quickly browse through the tabs to appreciate how stark the difference is for this pull request.

Atom on Electron 3

Atom on Electron 3 0

VS Code on Electron 3 (latest published version)

VS Code

Atom on Electron 2 (Atom 1.38.0-beta0)

Atom on Electron 2 0

Lorem on TextEdit

Screen Shot 2019-05-17 at 16 46 27

You can reproduce the above tests by using Fira Code Retina, 15px.

Causes of the change

We believe the change was caused by upgrading to a newer Chromium version, but it is unclear whether the new rendering is wrong or not. Specifically, this seems to be related to the global "Use font smoothing when available" setting on macOS, and Atom is now just honoring that configuration. Indeed, when rendering the word Lorem in TextEdit (a native macOS application), we observe the same rendering as in Atom on Electron 3.

Next steps

@rafeca and I discussed what to do about this, and it seems okay to proceed with allowing this new rendering behavior. Users can go back to the previous behavior by adding the following CSS to their personal style sheet:

/* This will change how font-smoothing is applied to the entire Atom application */
atom-workspace {
  -webkit-font-smoothing: antialiased;
}

/* If you just want to change how text is rendered within the editor, use this instead: */
atom-text-editor {
  -webkit-font-smoothing: antialiased;
}

If needed, in the future we could provide a configuration parameter to change the aliasing behavior without needing to write any CSS.

@as-cii as-cii added editor-rendering mac Issues that occur on macOS but not on other platforms. electron labels May 17, 2019
@jasonrudolph
Copy link
Contributor

@rafeca and I discussed what to do about this, and it seems okay to proceed with allowing this new rendering behavior.

I agree. 🚀

@nathansobo
Copy link
Contributor

Agreed. Amazing attention to detail catching this, however. Glad we could make this decision explicitly rather than accidentally.

@net
Copy link

net commented May 24, 2019

I greatly prefer the new rendering. 🎉

@Arcanemagus Arcanemagus added the electron-3 Tasks related to upgrade to electron v3 label May 31, 2019
@as-cii
Copy link
Contributor Author

as-cii commented Jun 5, 2019

Given our agreement on accepting Electron's new text rendering system on macOS, I will go ahead and close this.

@as-cii as-cii closed this as completed Jun 5, 2019
@vertic4l
Copy link

vertic4l commented Jun 12, 2019

Couldn't find the option for "Use font smoothing when available" but adding the css from @as-cii helped to get the much nicer looking font rendering back.

Although -webkit-font-smoothing: antialiased; should be default...

Who wants an ugly rendered font for real?

(Atom Beta 1.39)

@Aerijo
Copy link
Contributor

Aerijo commented Jun 12, 2019

Couldn't find the option for "Use font smoothing when available"

That's an OS setting, not an Atom setting.

Who wants an ugly rendered font for real?

It's beauty is subjective. But it matches TextEdit, the text editor provided by Apple. So there is precedence.

I do think a setting in Atom would help people with discovering there is a choice though.

@vinkla
Copy link
Contributor

vinkla commented Jul 1, 2019

Toggling Use font smoothing when available in System Preferences seems to work in TextEdit but not in Atom Nightly:

Screen Recording 2019-07-01 at 22 35 18

Atom: 1.40.0-nightly19
macOS: 10.14.5

@as-cii
Copy link
Contributor Author

as-cii commented Jul 2, 2019

@vinkla thank you for the feedback. Does the setting take effect if you restart Atom? If not, did you try adding that CSS snippet to your personal style sheet?

@vinkla
Copy link
Contributor

vinkla commented Jul 2, 2019

Does the setting take effect if you restart Atom?

No.

If not, did you try adding that CSS snippet to your personal style sheet?

Yes, this works.


Maybe we should remove or alter the line below in #19356 (comment)?

Users can go back to the previous behavior by disabling "Use font smoothing when available"

@as-cii
Copy link
Contributor Author

as-cii commented Jul 2, 2019

Maybe we should remove or alter the line below in #19356 (comment)?

@vinkla: Sounds good, I just modified it to not mention the "Use font smoothing when available" option. It's strange because I remember toggling that option worked, but maybe something has changed since then.

@vinkla
Copy link
Contributor

vinkla commented Jul 22, 2019

The rendering seems to have returned to the previous behaviour (antialiased) with the merge of #19373. This can be tested in the latest nightly build: v1.41.0-nightly1.

@HaoyangFan

This comment has been minimized.

@Arcanemagus

This comment has been minimized.

@lock
Copy link

lock bot commented Jan 24, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-rendering electron electron-3 Tasks related to upgrade to electron v3 mac Issues that occur on macOS but not on other platforms.
Projects
None yet
Development

No branches or pull requests

10 participants