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

[CLOSED] Bad font rendering makes text hard to read #9661

Open
core-ai-bot opened this issue Aug 30, 2021 · 30 comments
Open

[CLOSED] Bad font rendering makes text hard to read #9661

core-ai-bot opened this issue Aug 30, 2021 · 30 comments

Comments

@core-ai-bot
Copy link
Member

Issue by arrbie
Tuesday Apr 28, 2015 at 17:28 GMT
Originally opened as adobe/brackets#11013


Text rendering in Brackets is of very low quality and subpar other text editors. Eyes become tired and you need to increase the text size to compensate for the low readability. To me this is a deal-breaker.

The effect is quite independent of choice of font, and is especially true for the default font 'SourceCodePro-Medium', but also for 'Menlo-Regular' (pics below).

It's as if Brackets weren't even using the Mac's built-in font rendering API:s for text areas. Adobe, are you fiddling on your own with the text rendering algorithms here? I know you are masters of graphics – especially typography – but I think you should trust Apple on this one, and you get it for free. This is NOT a matter of differences in aesthetic opinions. Just follow the system defaults like all other Mac applications do and we'll all be happy. (Already pointed out by drewhamlett at GitHub back in 2013)

See comparison of screen dumps from Brackets (top pic) vs Smultron (bottom pic) running on the same machine. This font is "Menlo-Regular" 11pts (or "px" as Brackets says). Pay attention to the letters in the word "supplied". Every single letter (except the "i", which is actually too thin) is much more unclear, smudged out, and of varying thickness on the Brackets version.

brackets
smultron

This problem is true not only for the actual text area, but also for all other text inside the Brackets windows, ie sidebar, window title, modal dialogs etc.

Brackets version: Release 1.3 build 1.3.0-16022
OS: Mac OS X 10.10.3
Hardware: MacBook Air 13" (1440-900 px)
Extensions: None (fresh factory install)

@core-ai-bot
Copy link
Member Author

Comment by brunnopleffken
Monday May 04, 2015 at 02:52 GMT


I believe Brackets uses grayscale anti-aliasing instead of subpixel for some reason (performance, maybe)... I agree with you, it's really bad and I use a "CSS injection" extension and do some workarround to solve it.

This is my workarround to get subpixel rendering back:

* {
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
}
.CodeMirror {
    -webkit-font-smoothing: subpixel-antialiased !important;
}

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 10:26 GMT


@brunnopleffken: Yes, thank brunnopleffken. I also try to easen up on the worst pain by applying similar rendering patches. I've also experimented a little with 98% alpha on the text colors, eg rgba(0, 136, 0, 0.98). It helps a little, but it's still VERY FUZZY compared to normal Mac standards and other text editors.

During the last week I've spoken to five different developers using Macs, and every single one of themhad been ditching Brackets for the same reasons: terribly fuzzy text rendering. One guy said something like: "If the Brackets developers can't even prioritize text quality in their text editor, then I don't entrust them with anything else either. Everything else come second.". And I kind of agree, it's a shame and they will loose a lot of Mac users in this way.

Brackets
brackets menlo regular 11

BBEdit (same color codes as Brackets' above)
bbedit menlo regular 11

Smultron
smultron menlo regular 11

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 11:00 GMT


@arrbie I have marked this for 1.4 and we need to figure what is the best possible way to disable sub-pixel rendering on Mac. CEF does not give us a flag to disable this out of the box so we may have to tweak our CSS for it. Found an interesting article and it says Apple is tweaking the CSS to disable sub pixel rendering. http://usabilitypost.com/2011/02/08/please-stop-disabling-subpixel-rendering/

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 11:08 GMT


@nethip, thanks for taking this seriously. However, I think you are quite on the wrong track. This is definately not a matter of "disable sub-pixel rendering on Mac". Actually, you seem to have misunderstood completely nethip. Please, read carefully all fixes that have been attempted above – without reaching satisfactory results.

You need to get hold of someone that really uses a Mac as their primary tool and ask for their assistance. It's simply not enough for you to just test a little on a Mac, since clearly you lack the ability to see the real nature of the problem here. The product should never have been released in this state otherwise.

@core-ai-bot
Copy link
Member Author

Comment by ryanstewart
Monday May 04, 2015 at 11:19 GMT


Is this just an issue on non-retina Macs? I'm on a 15" Mac Book Pro and I'm not seeing any obvious text issues.

I definitely notice the differences in the screenshots above. I just don't see those differences on my own machine.

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 12:19 GMT


@ryanstewart@arrbie I think this is a problem on all Macs. And it is much worse on non-retina displays. We have being tracking multiple issues with fonts on MAC (adobe/brackets#4640, adobe/brackets#10083, adobe/brackets#2791) for quite some time. And I think actually CEF 2171 made it look a lot worse.

@arrbie I take back what I said about disabling sub-pixel rendering. What I meant was to tweak this attribute to get the desired rendering. And by the way we don't use any custom rendering/layouting (i.e use Core Text or NSText* rendering) on Mac. We use the rendering provided by CEF itself and we completely rely on the CSS to tweak the text rendering on all platforms that we support(Mac/Win/Linux). It is just tweaking CSS to get the desired result.

As mentioned in adobe/brackets#10083 (comment), Atom seemed to have fixed some of these issues (to do with kerning and leading) by using one of the blink settings, which we cannot use inside Brackets as we are based out of CEF. It would be great if you can open a PR with your suggestions and we could collaborate on this. We will make sure this PR would indeed be picked up for this release. Please take a note that we have integrated CEF 2171 and the rendering looks a little different to that of the older versions(<=1.0) and that the solution should work for retina(or HiDpi) as well as non-retina displays as attempts were made earlier which was kind of mutually exclusive kind of result.

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 12:27 GMT


Also take a look at adobe/brackets#10083 (comment) for@peterflynn comment on the same.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 13:48 GMT


CEF is crap for the Brackets product. I wish Brackets had used the built-in web engine of the OS instead. Brackets is a web-app, right? And since when did a web-app need to carry its own web browser engine anyway?

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 16:09 GMT


Regarding #10083 and@peterflynn's comments:
I think he might be onto something here. I also have noticed strange horizontal shiftings related to the font size. Fractional width is definately part of this problem.

However, as I pointed out in a new comment in #10083, there must be more to it than this since the geometric size of the rendered text is actually correct now (used to be too narrow).

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 17:16 GMT


From my previous experience we had problems with fractional widths attributed to AA, only if the AA algorithms are implemented by the renderer rather than by the system, like the text engine used in Fireworks(Check Anti aliased text in Fireworks and you will see jaggered edges, which I have been fighting for ages to figure out how to solve this AA problem as we had to implement the sub pixel rendering by ourselves).

System does an awesome job of using sub pixel rendering along with AA to smoothen the curves in a brilliant way(looks good on LCD and LEDs). So I don't think there is any problem with the fractional widths. The downside of this is that same character may have different rendering, as it is bound to happen with fractional widths, but that is still fine.

I am not sure if chrome uses any line breaking algorithm by themselves. Mac provides CTLine and CTFrame which do a great job in calculating string widths and rendering them good as well. I need to look at chromium's source and figure out what is happening there. I am not sure if they are using any offscreen rendering for particular cases.

While modernising the text engines in other Adobe products (Dreamweaver to be more specific), I found that AA works fine even for font size less than 11pts. The biggest problem with AA is to do with the way scaling is implemented to smoothen the curves and this becomes worse with ligatures and auto kerning (especially on Mac), if not implemented fine or a badly written font. So here is what we need to do

  • Disable ligatures
  • Use -webkit-font-smoothing: subpixel-antialiased; refer to this article http://www.intridea.com/blog/2014/5/8/better-font-smoothing-in-chrome-on-mac-os-x.
  • If the above does not work we need to see if there is any other CSS property, like drop shadow, which is creating a pixelated look.
  • Also we could have a media query to enable or disable AA based on screen resolution and pixel density. This we could give it a try.
  • Also we need the check if chrome is defaulting to offscreen rendering in certain cases(may be because of some CSS attributes)

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 17:19 GMT


  • There is another thing I want to add. If there is a scale factor applied to the entire text, it is going to effect the entire text rendering. So another point to look out would be to see if any scale factor is getting applied.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 18:03 GMT


Already tried the following (in extension and theme), but it didn't help:
• disabling ligatures
• changing all varieties of font-smooting (incl AA off)
• drop shadow nullification (text-shadow, svg-shadow)
• font scaling factors (+/- 0.5 px in steps of 0.01 px)
• text-rendering
• alpha channel on colors
• font-kerning
• text-stroke-width
• font-weight

@core-ai-bot
Copy link
Member Author

Comment by ryanstewart
Monday May 04, 2015 at 18:24 GMT


@arrbie if you're feeling brave, would you mind seeing if this experimental branch of Brackets running on Electron is better?

Here's a side by side comparison on my machine (Black title bar is Brackets normal, grey is with Electron)
main_css__getting_started__ brackets_and_main_css__getting_started_ _brackets_and_slack

@core-ai-bot
Copy link
Member Author

Comment by brunnopleffken
Monday May 04, 2015 at 18:47 GMT


I can't see differences between Brackets-Shell and Electron at all... I believe the main point here is that Brackets doesn't use sub-pixel anti-aliasing for text, it uses greyscale, leading it into fuzzy fonts (basically, the same issue that IE10 and Office 2013 faced in Windows 8 a few years ago) on non-Retina/non-High-DPI displays, lowering the effective resolution...

Enabling sub-pixel rendering will also improve ligatures and font kerning, because it'll use three pixels instead of just one with a single color. On Macs it's even worse, because it doesn't use the "aligned-to-grid" rendering like Windows does.

thesansmono_office_features_cleartype

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 18:51 GMT


@brunnopleffken Did you do this comparison on a retina display. If yes it is hard to figure that differences because of high pixel density. May be we might want to compare this on a non retina display.

And you many be right about enabling sub pixel rendering support. Did you get a chance to experiment with -webkit-font-smoothing: subpixel-antialiased;. Does that make the rendering a little better.

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 18:55 GMT


@ryanstewart I am not able to distinguish between both the screenshots just by looking at them. I will have to probably do an XOR in Fireworks to figure out the little differences.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 19:23 GMT


@ryanstewart, nope, I can't see any difference in rendering quality between your two images of Brackets normal and Electron above. Both look good to me.

I will try to install the experimental branch on my MacBook Air 13" (non-retina) and get back to you with results. Now, where do I find the compiled version of this?

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Monday May 04, 2015 at 19:28 GMT


@arrbie There's no compiled version available, but it's more or less easy to set up:

  1. git clone https://github.com/zaggino/brackets-electron
  2. cd brackets-electron
  3. git submodule update --init
  4. npm install
  5. npm start to run

Notice you won't have your usual extensions and themes installed as it's more or less a separate install.

Even if you don't see a difference/improvement immediately, please keep it installed as it's easily configurable and thus, you could test some different configurations.

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 19:31 GMT


@brunnopleffken I just saw from your above comment that you have already tried -webkit-font-smoothing: subpixel-antialiased;. Let us then compare then screenshots with this setting on. I will do this first thing tomorrow.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 19:37 GMT


@MarcelGerber, what's npm?

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 19:40 GMT


@arrbie npm is a node package manager. Install node and this would get installed along with it

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 19:41 GMT


Sorry, don't do NodeJS yet. Will have to pass on this one.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Monday May 04, 2015 at 19:42 GMT


Oh, ok. It's the Node package manager.
So, Node is a command line tool that lets you run JavaScript locally on your computer (with access to files and so on), and npm is a tool that lets you install modules (similar to pip for Python, gem for Ruby, etc.).

Just saw your answer: You don't really have to have any Node skills for this, just install Node and you're ready. But it's of course also fine to not install it :)

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 19:48 GMT


@MarcelGerber, yeah, I know about NodeJS. Just not ready to go there yet. Any way to install Brackets Electron w/o node?

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 04, 2015 at 21:23 GMT


Actually we were deliberate in disabling sub pixel AA. See this adobe/brackets#4640 (comment)

After looking at our issues base, I found that the only possible solution for time being is to write an extension or a theme which would either enable/disable sub pixel-anitaliasing. Also we could have more options in this extension to either completely disable AA or just disable sub pixel AA. That way we could give more flexibility to the users. This have been disabled to fix some issues with the animations. If those animation issues indeed come back after enabling back sub pixel AA, then we should be disabling animations in the code view as well, in this extension.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Monday May 04, 2015 at 21:59 GMT


Here we go again. This animation reason for fiddling with the AA has been discarded in numerous discussion comments. It seems nobody has reported proof of such a connection, but rather the opposite. So we have to conclude that it's simply a myth. Read for ex. drewhamlett (in #4640).

Also – and more importantly – we are not talking about simply switching on or off the subpixel-antialiasing. This has already been tested (in extensions and themes, see the 9-bullet list above), and is not enough to solve the fuzzy text rendering issue. I haven't seen a single CSS command that does that, independently of where it's put.

Since this discussion is clearly going in loops, I suggest we give up and close it unsolved(!)

@core-ai-bot
Copy link
Member Author

Comment by brunnopleffken
Monday May 04, 2015 at 22:10 GMT


There has been some change on Brackets-Shell or something since Brackets v. 1.0? I tested this CSS (using -webkit-font-smoothing and -webkit-backface-visibility) on my friend's iMac and it seems not to work anymore... I used to do this workaround before I started using MacBook Retina, and yes, I checked with Digital Color Meter: there was subpixel anti-aliasing using CSS... ;)

By the way, I never see an animation issue with the anti-aliasing enabled... All I see is a better readability on dark backgrounds on OS X, nothing else! So, I see no reason for disabling it...

And by the way # 2: Brackets uses Chromium, it's more like a browser, so I don't know if it's possible to use Mac's native font rendering APIs on it (which is great on Sublime and TextMate), as it is defined by Chromium itself.

@core-ai-bot
Copy link
Member Author

Comment by nethip
Tuesday May 05, 2015 at 04:04 GMT


I had mentioned in my comment above the actual reason why we have turned this off with the older build of CEF. Now I also mentioned that if and only if we see any degradation at all only then we need to worry about disabling animations, though it has been ruled out in multiple comments.

@brunnopleffken The difference between 1.0 and 1.1 is that we have upgraded to CEF 2171 in 1.1. If I understand it correctly, you are saying enabling sub pixel anti aliasing is not fixing the fuzzy text issue in the latest build(1.3)? And about the animation issue, I think it was more to with performance but that was way back when Brackets was using a older build of CEF.

I understand it could get quite frustrating to see nothing working but hey, you can think this is to be a good learning experience. And as I mentioned above we will be tracking this for 1.4 especially when we are hearing this from multiple users.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Tuesday May 05, 2015 at 13:49 GMT


Consider switching from CEF to PhoneGap on the Mac distribution of Brackets – if you think that userbase is of value to Adobe. It will make the product behave natively, and make it much leaner (you could save ~75MB of the total 114MB). It would also start up faster.

The should require only minor work, and I don't see any reason this product should make hard-coded dependencies on CEF functions anyway.

@core-ai-bot
Copy link
Member Author

Comment by arrbie
Saturday May 16, 2015 at 15:34 GMT


Still, nearly 3 weeks after the problem was reported here, there isn't even an issue report entered on bitbucket.org/chromiumembedded/cef/

Since this bug has been reported as a Brackets deal-breaker by various Mac users, I can only conclude that the Brackets team don't care about this community anymore.
:-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant