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

Font not rendering #3

Closed
gnujeremie opened this issue Dec 23, 2015 · 54 comments
Closed

Font not rendering #3

gnujeremie opened this issue Dec 23, 2015 · 54 comments
Assignees

Comments

@gnujeremie
Copy link

I have a problem with the font not rendering correctly. I don't know if it's an electron or an nyaovim problem (or a 'my bad' problem :-D).
nyaovim

I removed my init.vim (neovim's vimrc), but the issue is still there.
I don't know if it's related, but the terminal displays this line a lot :

[48303:1223/093014:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fecb3451ed0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked

Under Mac OSX 10.11.1, and the latest version of nyavim installed with npm.

@rhysd
Copy link
Owner

rhysd commented Dec 23, 2015

Thank for your report.

Hmm...
It seems a bug of Chromium on rendering GL enhanced canvas. I'm not familiar with Chromium. (The bug may be Electron specific.)
Anyway, I want to confirm your Electron version.

    1. Start NyaoVim in debug mode
$ NODE_ENV=debug nyaovim
    1. Show versions in console on DevTools
console.log(process.versions)

Note: I'm also using OS X 10.11.1 and tried latest nyaovim package but it worked.

@rhysd rhysd added the bug label Dec 23, 2015
@rhysd rhysd self-assigned this Dec 23, 2015
@gnujeremie
Copy link
Author

You're welcome :)
Here's the result of

console.log(process.versions)
ares: "1.10.1-DEV"
atom-shell: "0.36.1"
chrome: "47.0.2526.73"
electron: "0.36.1"
http_parser: "2.6.0"
modules: "47"
node: "5.1.1"
openssl: "1.0.2e"
uv: "1.7.5"
v8: "4.7.80.23"
zlib: "1.2.8"

@rhysd
Copy link
Owner

rhysd commented Dec 23, 2015

The output looks the same as mine.
Is there any other error output in console?

@gnujeremie
Copy link
Author

No, it's seems to be okay, but i'll try to dig deeper (I'm currently at work).

I have powerline installed for my terminal and my vim statusbar. I thought it could be the problem, but as I told you, even when I remove all my vim/neovim config, the font still does not render.

@rhysd
Copy link
Owner

rhysd commented Dec 23, 2015

Thank you for your analysis. Very helpful :)

I want to reproduce this because it is hard to fix a bug without reproducing. If you can, could you show me your init.vim? (Of course after your work ;) )

@gnujeremie
Copy link
Author

You're welcome ^^

You can find my full .vim here : https://github.com/gnujeremie/dotvim (I symlink to .config/nvim and init.vim after).

I just have these lines specifically on my work station at the end of the .vimrc

" Powerline
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup

@rhysd
Copy link
Owner

rhysd commented Dec 24, 2015

Hi @gnujeremie,

Sorry for late response.

I tried your config and somehow I could start your nvim (Note that this plugin seems to have been removed.)
Although I don't install powerline yet, at least all except for it is working well.

2015-12-25 1 29 54

And I have one question.
Do you use 'patched' font for powerline? Powerline requires a patched font for fancy line, I think.

If you're using such a font, could you set other font to ~/.config/nyaovim/nyaovimrc.html as below?

    <neovim-editor id="nyaovim-editor" argv$="[[argv]]" font="Courier,monospace" ></neovim-editor>

Pelase note that Courier can be other font. Please try not-patched font.

@gnujeremie
Copy link
Author

Hi,
Sorry for the delay (christmas...).
I do use patched font for powerline, I will try tomorrow to disable it and I'll let you know :)

Thanks.

@rhysd
Copy link
Owner

rhysd commented Dec 27, 2015

Hi,

No problem. I'm not in a hurry.
Thank you for your cooperation!

@gnujeremie
Copy link
Author

Ok so I changed the line as you said, the problem is still there.

@rhysd
Copy link
Owner

rhysd commented Dec 28, 2015

Thank you for your check.

Hmm... then I think this is a bug of Chromium (or Electron) side...

Finally could you try disabling WebGL by modifying NyaoVim/main/main.js as below in your node_modules?

--- old.js  2015-12-29 01:11:18.000000000 +0900
+++ main.js 2015-12-29 01:11:38.000000000 +0900
@@ -52,6 +52,9 @@
         width: 800,
         height: 600,
         useContentSize: true,
+        webPreferences: {
+            webgl: false
+        }
     });
     win.once('closed', function () {
         win = null;

It should disable GL in canvas.

@gnujeremie
Copy link
Author

Still no differences.
Do you think I should open a bug on Electron ?

@rhysd
Copy link
Owner

rhysd commented Dec 29, 2015

Thank you for your check.
It must be a bug of Electron or Chromium, I think. But I don't know which the bug is derived from... 😕

Do you think I should open a bug on Electron ?

It's very helpful for me. If you do that, could you please let me know the issue URL?

@rhysd
Copy link
Owner

rhysd commented Dec 30, 2015

I posted a question in Atom forum.

https://discuss.atom.io/t/gl-error-in-canvas/24058

@gnujeremie
Copy link
Author

Ok thanks :)

@doenietzomoeilijk
Copy link

By way of "me-too": I have the same issue. OS X 10.10.5 (14F1021)

Output in the terminal:

  % NODE_ENV=debug nyaovim                                                                                        !4645
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(6888)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUniform1i: wrong uniform function for type
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(6914)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUniform4fv: unknown location
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
[7451:0104/105951:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fc6d9453de0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked

Versions:
ares: "1.10.1-DEV"
atom-shell: "0.36.2"
chrome: "47.0.2526.73"
electron: "0.36.2"
http_parser: "2.6.0"
modules: "47"
node: "5.1.1"
openssl: "1.0.2e"
uv: "1.7.5"
v8: "4.7.80.23"
zlib: "1.2.8"

Setting Courier as default font doesn't help, nor does adding the webgl: false in main.js (assuming that worked — is there any way to check that from within the debugger console?

@adelarsq
Copy link

adelarsq commented Jan 5, 2016

Same issue for me on OS X El Capitan. Many lines like this are shown:

[844:0104/230115:ERROR:gles2_cmd_decoder.cc(7333)]
 [.Offscreen-MainThread-0x7fe702562e60]GL ERROR :GL_INVALID_OPERATION :
 glUseProgram: program not linked
...

@rhysd
Copy link
Owner

rhysd commented Jan 7, 2016

@doenietzomoeilijk @adelarsq

Thank you for report.

Hmm... no one seems not to know resolution of this problem in forum and Google Search also could not help (Only old bug report was found).
I think I should open an issue in atom/electron repository (probably today).

@adelarsq
Copy link

adelarsq commented Jan 7, 2016

It's a Chromium bug. On this old page there are a similar bug (GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked).

On my Windows 7 I did notice the same problem 😕
[UPDATE] On Windows works fine now, maybe something wrong with remote connections, I don't know.

@marcj
Copy link

marcj commented Feb 16, 2016

We are having also this issue with our app using https://github.com/atom/electron and font rendering in canvas elements at OSX, so I guess it's a bug with their chromium version. I couldn't find yet an issue reported there about this font render error, but I don't think this is directly related to NyaoVim.

@rhysd
Copy link
Owner

rhysd commented Feb 24, 2016

@marcj

Thanks. Forum also seems not able to help this issue. I'll report this to Electron repository. Could you tell me what your app's Electron version is?

As @marcj said, this may depend on Chromium version. I want to confirm the latest Electron (0.37.8) causes this error yet.
Could anyone confirm this now?

@gnujeremie
Copy link
Author

I updated nyaovim (v 0.0.17), electron is version 0.36.8, the issue is still here.

@rhysd
Copy link
Owner

rhysd commented Feb 24, 2016

@gnujeremie

Thank you!

@rhysd
Copy link
Owner

rhysd commented Feb 27, 2016

I added a workaround for this and bumped up version to 0.0.18, which was suggested in electron/electron#4594 .

Could you create ~/.config/nyaovim/browser-config.json as below and start NyaoVim? (Please ensure that NyaoVim version is 0.0.18.)

{
  "enable_canvas_workaround": true
}

@adelarsq
Copy link

Cool. I will try to use tonight and give you a feedback.

@rhysd
Copy link
Owner

rhysd commented Mar 1, 2016

@gnujeremie @adelarsq

Thank you for your confirmation. Then I'll revert the workaround 😭
I have no idea for this issue...

@gnujeremie
Copy link
Author

Don't give up, sooner or later we'll find a fix :)

@adelarsq
Copy link

adelarsq commented Mar 1, 2016

Maybe that webgl isn't enabled on the chrome that comes with nyaovim. Also we can try others options for the --use-gl flag. The flag used before (egl) still was using opengl, that is why the problem remains.

@a3li
Copy link

a3li commented Mar 16, 2016

Another custom Electron app user here:
We had the same issue, we went back to electron 0.35.5 which did not suffer from it; I updated to 0.37.2 today and that seems to work as well. Maybe up/downgrading electron (aka avoid 0.36.*) can fix that for you as well.

@ohle
Copy link

ohle commented Mar 23, 2016

I tried this today and can confirm that 0.35.6 solves this problem for me. Unfortunately, 0.37.2 doesn't. Also, I had to comment out the (app.dock as any).setIcon line from main.ts for the old version - no idea what else would be affected.

@adelarsq
Copy link

The problem may be related to this issue.

@adelarsq
Copy link

adelarsq commented Apr 7, 2016

@ohle with 0.37.4 did work?

@GnorTech
Copy link

Latest NW.js 0.14.0 fixed the same issue. NyaoVim could consider migration.

@rhysd
Copy link
Owner

rhysd commented Apr 14, 2016

@GnorTech

That's good news. Thank you. Do you know which Chromium version NW.js 0.14.0 is based on?

@GnorTech
Copy link

@rhysd latest Chromium stable 50.0.2661.75 . The same issue reported is nwjs/nw.js#4618

@rhysd
Copy link
Owner

rhysd commented Apr 14, 2016

@GnorTech Thank you. I confirmed that Electron v0.37.5 is based on Chromium 49.0.2623.75. So I'll ping to this issue when Electron is based on Chromium 50.

@p0009231
Copy link

Probably related? Setting OS language to English solved that problem for me.

bug

@gnujeremie
Copy link
Author

Same as @p0009231 , setting the language to English fixed the problem.

@kuglee
Copy link

kuglee commented May 4, 2016

Nice find @p0009231. If opening from command line one can always set LANG="en_EN.UTF-8" then open nyaovim. This way the OS language doesn't have to be changed.

@adelarsq
Copy link

@rhysd What about update Electron for the latest version?

@rhysd
Copy link
Owner

rhysd commented May 16, 2016

Yes, latest Electron (v1.1.0) seems to use Chrome 50 🎉

I'll update tonight.

@rhysd
Copy link
Owner

rhysd commented May 16, 2016

I updated Electron version in local environment and found behavior of KeyboardEvent.key seemed to be changed. (I think this is the difference of Chrome 49 and Chrome 50).

I need to update and fix neovim-component at first.

@adelarsq
Copy link

Hi @rhysd, any update on this issue? Actually this is the only reason because I still don't use NyaoVim, that is why I'm so obsessed about 😁

@rhysd
Copy link
Owner

rhysd commented Jul 17, 2016

I fixed KeyboardEvent.key issue which prevented Electron dependency updating to v1.2.7 in neovim-component package. Now neovim-component v0.6.0 is compatible with Electron v1.2.7 and I'll try to update NyaoVim's Electron dependency. Sorry for making you wait so long.

@rhysd
Copy link
Owner

rhysd commented Jul 18, 2016

@adelarsq I updated NyaoVim to v0.0.20 (Electron v1.2.7). Could you try it?

@adelarsq
Copy link

@rhysd Yeah! Nice! Did work! 🎆

screenshot

Before I got this error on OS X:

╰─λ sudo npm install -g nyaovim                                     0 < 21:58:03
Password:
/usr/local/bin/nyaovim -> /usr/local/lib/node_modules/nyaovim/bin/cli.js

> electron-prebuilt@1.2.7 postinstall /usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt
> node install.js

Downloading electron-v1.2.7-darwin-x64.zip
[============================================>] 100.0% of 42.74 MB (165.33 kB/s)
/usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt/install.js:22
  throw err
  ^

Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt/electron-tmp-download-860-1468889916574/electron-v1.2.7-darwin-x64.zip' -> '/Users/adelar/.electron/electron-v1.2.7-darwin-x64.zip'
    at Error (native)
/usr/local/lib
└── (empty)

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "nyaovim"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE

npm ERR! electron-prebuilt@1.2.7 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-prebuilt@1.2.7 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/adelar/npm-debug.log
npm ERR! code 1

But was able to solve using (microsoft/WSL#14):

npm config set unsafe-perm true

And trying to install again.

@rhysd
Copy link
Owner

rhysd commented Jul 19, 2016

@adelarsq

Please do not use sudo for npm install. It tries to give unnecessarily strong permission to executable and causes an error. Please use $ npm install -g nyaovim for installation on OS X. I think unsafe-perm is not recommended in terms of security.

@adelarsq
Copy link

@rhysd Thanks. I did reinstall with npm install nyaovim.
For some reason there is no link for the app and show this messages:

npm WARN enoent ENOENT: no such file or directory, open '/Users/adelar/package.json'
npm WARN adelar No description
npm WARN adelar No repository field.
npm WARN adelar No README data
npm WARN adelar No license field.

Tomorrow I will see whats is this. 😴💤

@rhysd
Copy link
Owner

rhysd commented Jul 19, 2016

@adelarsq

I did reinstall with npm install nyaovim.

You forgot adding -g 😃 . Please add -g ($ npm install -g nyaovim) for global installation. In previous error you kindly reported,

╰─λ sudo npm install -g nyaovim 0 < 21:58:03

sudo is a problem causing the error, I guess.

@adelarsq
Copy link

@rhysd the command only works with sudo:

╰─λ npm install nyaovim -g                                          0 < 20:12:08
Error: EPERM, Operation not permitted
    at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
    at ChildProcess.exithandler (child_process.js:193:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)

I don't understand the error. With some time I will try to figure out what is wrong.

@rhysd
Copy link
Owner

rhysd commented Jul 20, 2016

@adelarsq

Hmm... that looks a problem depending on your environment... I recommend to install Node.js via Homebrew or Node.js version manager like nvm, nodebrew, and so on.

Anyway, this issue was resolved 🎉
Thank you all who gave me information about this issue 😄

@rhysd rhysd closed this as completed Jul 20, 2016
@adelarsq
Copy link

It's some weird problem on my OS X. But the main problem is solved. Thanks @rhysd 👏 👏
Next step will be make 145 plugins and 6K lines from macvim config compatible with neovim 😄

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

No branches or pull requests

10 participants