rhysd / neovim-component

<neovim-editor> WebComponent to embed Neovim to your app with great ease
https://github.com/rhysd/NyaoVim
MIT License
193 stars 18 forks source link

Disable 'alpha' on context of cursor/screen to enable sub-pixel antialiasing #33

Closed lambdalisue closed 8 years ago

lambdalisue commented 8 years ago

Now browser knows that the backdrop for drawing is always opaque, the performance of drawing of transparent content and images are improved.

Additionally, at least Webkit, browser renders text with sub-pixel anti-aliasing so that the quality of readability increase a lot.

http://blogs.adobe.com/webplatform/2014/04/01/new-canvas-features/ https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext

I confirmed by $ npm start

Without {alpha: false}

normal-antialias

With {alpha: false}

subpixel-antialias

rhysd commented 8 years ago

Nice catch! I didn't know the 'alpha' option.

I tried this patch. Although I couldn't see the difference, I believe dropping alpha will improve rendering. This patch will be included in v0.8.1.

lambdalisue commented 8 years ago

Although I couldn't see the difference

Hum... Well at least NyaoVim in Ubuntu 15.04 Gnome shell showed huge difference :+1:

Anyway thanks a lot! :tada:

rhysd commented 8 years ago

I think it's because I'm using thick font. Anyway, your screenshots show the improvement and there is no disadvantage :+1: