-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CLOSED] [MAC] Enabling back sub pixel antialiasing for code view #9812
Comments
Comment by nethip Fixes adobe/brackets#11013, adobe/brackets#4640 and adobe/brackets#10169 |
Comment by nethip
|
Comment by MarcelGerber Looks good to me otherwise. |
Comment by nethip
|
Comment by nethip After analyzing how fonts render on both retina and non-retina and also comparing the rendering with other apps I have come to the following conclusion.
So the logical conclusion I have arrived at was that, we should be enabling sub-pixel rendering by default and give an option to user to override this behavior. So I went ahead and added a new preference “fontSmoothing”, which would take “subpixel-antialiased” or “antialiased” as the values for this preference. Now with this in mind I went ahead and enabled subpixel-AA for the entire app(apply –webkit-font-smoothing:”subpixel-antialised” to the body tag). After that I looked at how the overall rendering looked like. The code area was looking a bit more crisp. But the problem was with other parts of the UI like project tree, find in files pane, JS linting pane e.t.c. I could immediately see extra artifacts being rendered. The following screenshot was taken on an external monitor with a resolution of 1680 x 1050, connected to Mac Pro, with subpixel-AA on. This is the same rendered with gray pixel on AA, which is the current scheme on master. I am putting the screenshots of Brackets with subpixel-AA on and off. The first one is with subpixel-AA on. Just by glancing we can see that the first one(subpixel-AA on) has some extra pixels which is making it look a little out of place. I tried substituting the UI font SourceSansPro with system fonts like Lucida Grande and Helvetica Neue and I saw that using system fonts, the fonts render a little better. Looks like SourceSansPro is not rendering fine with text color #ffffff on dark backgrounds after turning on subpixel-AA. I checked on how this is with other apps and found out that Sublime, Atom and Visual Studio Code use system default fonts, which render relatively well for subpixel-AA on cases. Also none of them uses text with color #ffffff and that could be the reason why they text is rendering fine in other apps as white text on black background is producing artifacts even with other apps. So with the above test results, I went ahead and added subpixel-AA only to the code area. (to #editor.holder alone). Now the following screenshot is the one where subpixel-AA is enabled only to the code area. |
Comment by nethip Tagging |
Comment by busykai
Also, if moved to another module, I'd reduce the use of string literals and define modules vars for values and names. |
Comment by MarcelGerber Maybe the place where other font prefs like |
Comment by nethip
|
Comment by nethip
|
Comment by nethip
CC |
Comment by MiguelCastillo
|
Comment by MiguelCastillo I can create the extension and rope you guys in for review if you would like. |
Comment by nethip
I am curious to know what you would be packaging as an extension. Even if we decide to go with the code, that you are planning to package as an extension, IMO that should be added to the core. My understanding of an extension is something that the app wills still function as is, even if that extension is disabled/deleted. In this case, the rendering itself is broken and I am thinking it must in the core. But this is just my opinion and if we have a strong reason to ship this as an extension, that is fine too. |
Comment by MarcelGerber
The thing is, I can think of scenarios like "The font looks awful with your theme", where you can't really blame the developer because he presumably either didn't know or didn't think about including the antialiasing pref in his theme (maybe just because they don't have a Mac themself). |
Comment by MiguelCastillo
I am not sure what you mean by rendering is broken... If anti-aliasing is breaking rendering, then we fix it and don't make it an option to break it again. The extension would possibly be JS that exposes a way to switch the anti-aliasing setting on/off via preferences, a small UI, or even a menu setting similar to settings like
html, body {
-webkit-font-smoothing: subpixel-antialiased !important;
} |
Comment by nethip
We could make the preference name mac specific, something like
Looks like people who are on Mac are having a real bad experience with gray scale AA, especially with white text on black background inside Brackets. This is even becoming a deciding factor for users to either switch with Brackets or migrate to other editors. So this is a very serious problem and I am afraid there is no generic solution to this. I have seen that with sub pixel AA enabled on black text on white background, the fonts are looking a little washed out. And that is where I was thinking of making this specific to a theme. But I just proposed an idea. It could be a bad idea too.
As I mentioned in my analysis above, the problem with the above code snippet is that this enables sub pixel AA for the entire app. But the non-code UI is looking washed out with that. So we might want to enable this only for the code area and that is why I am changing |
Comment by nethip
|
Comment by MiguelCastillo
I probably wouldn't provide an option to change it back - but this is less important to argue about so I can go either way. |
Comment by nethip
|
Comment by nethip
|
Comment by nethip
|
Comment by nethip
|
Comment by rawat11
The text in white background looks totally washed away. I think darken them a bit might make them look better. |
Comment by nethip
Could you change the font from Source Code Pro to some system font and update us, how it is looking with lighter theme. Also would you mind checking the same in other editors like Sublime Text and Atom (You might want to change the font and the theme in these editors to look like what it is in Brackets so that we have an apples to apples comparison) Regarding the UI elements: No change has been done there, so the rendering should be as it is on |
Comment by rawat11
With lighter theme (AA on) With Sub pixel AA on White theme looks better with SP AA Also, I tried the same on Atom, but i could only change the theme, could not find the option for font I guess Atom has SP AA on by default According to me White themes aren't looking that good with many of the system fonts but changing it to SP AA makes it look a bit better but still not unto the par. With Black it looks good and SP is definitely a good option to move to. For the UI, I think we have maintained Gray AA but is there no option to make some change on this, it would only add to readability ad well as rendering |
Comment by prafulVaishnav
|
Comment by nethip
|
Comment by nethip
|
Issue by nethip
Tuesday Jun 09, 2015 at 10:26 GMT
Originally opened as adobe/brackets#11235
Defaulting the code view antialiasing to sub-pixel which can be overridden using a new preference
fontSmoothing
. This preference takessubpixel-antialiased
orantialiased
. With these changes, the UI would have gray scale anti-aliasing but the code view containereditor-holder
, would have subpixel-antialiasing on.The reason to disable subpixel antialiasing for UI is that, with subpixel AA on, SourceSansPro is not rendering fine on low res monitors in Brackets UI.
Historically sub pixel AA was turned off to circumvent the flickering bug. Looks like this is being fixed in CEF2171 as I am unable to repro this bug anymore.
I tested this PR on variety of hardware (retina, non-retina, external monitor) and the code rendering is a little crisper now on MAC.
nethip included the following code: https://github.com/adobe/brackets/pull/11235/commits
The text was updated successfully, but these errors were encountered: