Wrong font rendering


#1

The line length and what Atom thinks about the line length seem to be out of whack.

In the following image, there is no space in that string, and the cursor is at the end of the line!

With the cursor at the end of the line in the above image, I hit x, and here is the result:

I’ve tried various fonts (Menlo, Monaco, Inconsolata, Fantasque Mono, Fira Mono, Consolas), all had the same issue, though some (e.g. Consolas) were quite small and then I increased the font size and then it happened again.

I’ve tried atom --safe, too. It happened, too.

I’ve tried various themes, including Atom Light. It happened, too.


#2

Could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Do you have the Shadow DOM feature enabled?

#3

Darn, I just remembered that I forgot something. But you were quicker!

This is 0.177.0, and a couple of versions ago it was still okay. (Not quite sure about 0.176.) This is OSX Yosemite. It happens for all four combinations of

  • with/without --safe
  • with/without Shadow DOM

#4

Could you post your config.cson and styles.less files?


#5

Oh my! My config.cson seems to contain a lot of cruft. So, I moved it out of the way and restarted Atom and then did a couple of settings, but still the problem persists.

"*":
  "exception-reporting":
    userId: "69d2f7cd-a532-eba8-5fa2-a471a8dd2a33"
  welcome:
    showOnStartup: false
  core:
    themes: [
      "one-light-ui"
      "one-light-syntax"
    ]
  editor:
    invisibles: {}
    fontFamily: "Menlo"
    fontSize: 11

Will work on styles.less next.


#6

Okay, it was styles.less. Will use the chance for a fresh start, as well. Not as much cruft as in config.cson, but still.

Thanks a bunch, @postcasio! Very helpful.


#7

The final result is: it was text rendering.

.workspace {
  text-rendering: optimizeLegibility;
}

Adding the above to styles.less makes it misbehave. So I will remove it again. Hm. [trying] Ah. It moved the characters slightly closer together. Removing it spaced them out a bit. Hm. Not sure what that means. I was trying to be too clever I guess.


#8

The optimizeLegibility setting on text-rendering enables advanced kerning features of fonts at the expense of rendering speed. So it may be that whatever technique that Atom uses for resolving font metrics doesn’t take this into account.


#9

Quite possible. Note that it was working fine until recently (in earlier versions of Atom).

In any case, no issues, I’m satisfied with leaving the setting out.


#10

Recent versions of Atom include upgrading to newer versions of Chromium … so that may well be the reason that it changed.


#11

Sorry for resuming this somewhat old-ish topic, but I’d like to point out my experiment on Chrome 40 (see my comment on this issue https://github.com/atom/atom/issues/3821#issuecomment-74414131), which I think shows how Chrome already handles ligatures correctly, which makes me doubt about a Chromium issue…


#12

Chrome ≠ Chromium. Have you tested it on Chromium?


#13

No, sorry, I don’t currently have a Chromium installation on my win machine, and I’m afraid my machine is way too weak to build chromium in a reasonable time… How well-suited is the build provided here https://download-chromium.appspot.com/ for such a test?


#14

I’d suspect that if it runs, it would be pretty decent.


#15

It runs, I loaded my test and it works as good as Chrome does…

P.S. I have to say, having never before tried to code with ligatures, that it would too feel quite amazing to have these eye-candies for use for languages other than Haskell :smile:


#16

Check this out (haven’t tried it myself yet though):


#17

Yeah I know about that one, quite cool (although I prefer Source Code Pro as a fontface), but it has the same problems Hasklig has on Atom… But, like Hasklig, works like a charm in Chrome/Chromium.


#18

Has any progress been made on this? Its been almost a year and ligatures have never worked properly in atom.


#19

Yes they are working on it, see the roadmap :smiley:


#20

There’s an issue tracking font measurement on atom/atom that you should subscribe to for updates. I am on my way to a meeting, unfortunately, so I can’t find it right now.