Windows – Atom editor: disable anti-aliasing

anti-aliasingatom-editorfontstext-editorswindows 8.1

I have been using Sublime Text 2 for a while and are trying to switch to GitHub's Atom editor. Probably the only issue I still haven't resolved is font rendering. The text in the Atom editor is very blurry.

Everywhere else (including Chrome), the text is sharp and OK to read. But not for Atom. For comparison: text rendering for Atom (first line) and Sublime Text 2 (second line).

enter image description here

Both editors use the Monokai theme, with the same font (Consolas, size 12) and font color.

My OS is Windows 8.1 Pro x64 and I have ClearType disabled. I am using the latest version of Atom, which is currently 1.0.11.

I have already done an extensive search and found a lot of solutions, but none of them worked. For example: this, this, this, and this.


UPDATE

I have made some progress on the topic. If I disable DirectWrite, then the text becomes more sharp, but other images and graphics become more jaggy. But since I look at the text 99% of the time, this is not an issue.

My solution to disable DirectWrite is to add --disable-direct-write when launching Atom from command prompt. However, I am not satisfied with this solution, since it does not work when I open Atom from Start Menu, Taskbar or Context menu ("Open with Atom").

Updated question: how do I permanently add --disable-direct-write argument to Atom so that it applies when launching from Taskbar, Start Menu or Open with Atom context menu.

Best Answer

I have solved the issue with a custom post-update script, which fixes Registry entries and Start Menu shortcuts in order to add the --disable-direct-write argument.

Shortcuts

As I have stated at @codeSwift4Life's answer, appending --disable-direct-write won't work with shortcuts to the Update.exe process (which is actually a Squirrel program). However, I did found out how to append arguments to the --processStart atom.exe command. See this issue.

Therefore, If you wish to change the Atom shortcut to append --disable-direct-write, you have to change it from:

C:\Users\USERNAME\AppData\Local\atom\Update.exe --processStart atom.exe

to one of the following lines:

C:\Users\USERNAME\AppData\Local\atom\Update.exe --processStart atom.exe -a "--disable-direct-write"
C:\Users\USERNAME\AppData\Local\atom\Update.exe --processStart atom.exe --process-start-args "--disable-direct-write"

Context menu

To change the "Open with Atom" context menu, you have to update a few registry entries. Change them from:

X:\Path\to\atom\app-1.0.xx\atom.exe "%V"

to:

X:\Path\to\atom\app-1.0.xx\atom.exe "%V" --disable-direct-write

Automated post-update script

But since there are many registry entries and since you have to repeat everything after every update (and updates are very frequent), manual changes aren't feasible.

Therefore I have created an automated post-update script, which updates everything automatically. You just have to run it after every Atom update.

The base of my post-update script was this coffee script, which is actually the stock script that overrides all our manual changes.

You have to change the aforementioned script in the following manner:

Change:

createShortcuts = (callback) ->
  spawnUpdate(['--createShortcut', exeName], callback)

to:

createShortcuts = (callback) ->
  spawnUpdate(['--createShortcut', exeName, '--process-start-args', '--disable-direct-write'], callback)

Change:

  installMenu = (keyPath, arg, callback) ->
    args = [keyPath, '/ve', '/d', 'Open with Atom']
    addToRegistry args, ->
      args = [keyPath, '/v', 'Icon', '/d', process.execPath]
      addToRegistry args, ->
        args = ["#{keyPath}\\command", '/ve', '/d', "#{process.execPath} \"#{arg}\""]
        addToRegistry(args, callback)

to:

  installMenu = (keyPath, arg, callback) ->
    args = [keyPath, '/ve', '/d', 'Open with Atom']
    addToRegistry args, ->
      args = [keyPath, '/v', 'Icon', '/d', atomExe]
      addToRegistry args, ->
        args = ["#{keyPath}\\command", '/ve', '/d', "#{atomExe} \"#{arg}\" --disable-direct-write"]
        addToRegistry(args, callback)

The atomExe variable is defined as following (put it at the top, but after the require lines):

# Get the latest version of atom.exe
parentDir = fs.listSync('..').filter (x) -> x.indexOf('app-') > -1;
[..., atomDir] = parentDir
atomExe = path.join(path.resolve(atomDir), 'atom.exe')

Also, you have to find/replace process.execPath with atomExe. This is needed because the script will be run directly via Node, and the process variable points to Node instead of Atom.

Finally, add the following lines to the end of the script, in order to execute shortcuts and registry updates:

# Update shortcuts, install context menu
updateShortcuts ->
  installContextMenu ->

The script is executed with coffee squirrel-update.coffee. You should place it into a new subfolder inside the AppData\Local\atom folder. You will also need fs-plus and coffee-script node packages in order to successfully run the script.

Related Question