akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.37k stars 62 forks source link

Blurry fonts on Linux when display scaling is engaged #399

Open coordinatio opened 2 years ago

coordinatio commented 2 years ago

Hello, and thank you for the wonderful program you have made!

When I start goneovim (v0.6.2) I see the following (goneovim is on the left, nvim-qt is on the right for comparison): image

I use ArchLinux with KDE and Xorg with HiDPI monitors and have global display scaling set to 131.25%. The issue goes away either if the scaling is set to 100% or QT_SCREEN_SCALE_FACTORS environment variable is set to 1.

Here is the illustration. image

akiyosi commented 2 years ago

@coordinatio Hi :D Thanks for this issue report. Problem reports with screen captures are helpful.

I have analyzed your issue and fixed the code that seems to be relevant. You can check the behavior in the following CI job artifacts. Any feedback would be appreciated.

https://github.com/akiyosi/goneovim/actions/runs/2861545890

coordinatio commented 2 years ago

It seems that the issue still persists, here is how it looks like now: image

The screenshot is made with goneovim-linux taken from artifacts of the build you have pointed to.

akiyosi commented 2 years ago

@coordinatio Thanks for the confirmation.

You mentioned that setting the QT_SCREEN_SCALE_FACTORS environment variable to 1 resolves the problem, would it be acceptable to automatically export this environment variable inside Goneovim as a solution to fix the problem?

The following is a test binary that automatically exports this environment variable inside Goneovim.

https://github.com/akiyosi/goneovim/actions/runs/2895363660

coordinatio commented 2 years ago

Still the same: image

According to the diff here: https://github.com/akiyosi/goneovim/commit/d0bdbe6a94dc5cd0c82405583eac1d3892732f0d you have misspelled the variable name.

It's name is QT_SCREEN_SCALE_FACTORS not QT_AUTO_SCREEN_SCALE_FACTOR.

akiyosi commented 2 years ago

@coordinatio Sorry, I was confusing them. I have fixed it further. You can get the artifacts in the following jobs.

https://github.com/akiyosi/goneovim/actions/runs/2899895368

coordinatio commented 2 years ago

Unfortunately, the Linux artifact of https://github.com/akiyosi/goneovim/actions/runs/2899895368 behaves in the same way as before. The same blurry fonts, which can be fixed by setting the environment variable outside the application.

I can guess that Qt is initialized before you set the variable. I observe the very similar issue with nvui, and that pull request fixes it: https://github.com/rohit-px2/nvui/pull/142/commits/83a17f9b0f1bdb0f94247dd98549bc4c268ab831 Maybe that can give you a useful hint for fixing the problem.

akiyosi commented 2 years ago

@coordinatio Thanks for the useful information. I do not have a High DPI display so it is difficult for me to investigate this issue and your information is very helpful.

Any additional information you can provide on the following points would be very helpful.

akiyosi commented 1 year ago

@coordinatio Sorry to bother you, but we would appreciate it if you could confirm that it works.

ldelossa commented 1 year ago

@akiyosi I'm facing this issue as well. Where can I find the build artifact for:

https://github.com/akiyosi/goneovim/actions/runs/2903391086

ldelossa commented 1 year ago

@akiyosi the artifact from this build: https://github.com/akiyosi/goneovim/actions/runs/2903391086 still suffers from fuzzy text on Sway.

akiyosi commented 1 year ago

@ldelossa Thanks for confirming. I have made further fixes. Could you please confirm that it works with the following CI artifacts?

https://github.com/akiyosi/goneovim/actions/runs/3144946308

ldelossa commented 1 year ago

Not much improvement.

Here is the binary you provided compared to neovide:

image

goneovim top neovide bottom

Also, goneovim doesn't seem to adjust its fond rendering based on screen size. I keep my font size at 12 in neovide, and it adjusts the size of it when it moves from my 2k to 4k screen. In goneovime, i must change the font size manually.

akiyosi commented 1 year ago

@ldelossa Thanks. Please let me confirm the following.

Also, goneovim doesn't seem to adjust its fond rendering based on screen size. I keep my font size at 12 in neovide, and it adjusts the size of it when it moves from my 2k to 4k screen. In goneovime, i must change the font size manually.

The above issues would be discussed in a separate issue, if you would like.