goneovim icon indicating copy to clipboard operation
goneovim copied to clipboard

Blurry fonts on Linux when display scaling is engaged

Open coordinatio opened this issue 2 years ago • 13 comments

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

coordinatio avatar Aug 14 '22 16:08 coordinatio

@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

akiyosi avatar Aug 16 '22 05:08 akiyosi

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.

coordinatio avatar Aug 20 '22 13:08 coordinatio

@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

akiyosi avatar Aug 20 '22 23:08 akiyosi

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.

coordinatio avatar Aug 21 '22 13:08 coordinatio

@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

akiyosi avatar Aug 22 '22 01:08 akiyosi

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.

coordinatio avatar Aug 22 '22 06:08 coordinatio

@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.

  • Your last comment indicates that the current environment variable setting process is not working effectively. Therefore, I have created a modification that changes the environment variable setting process. Does this solve the problem?

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

  • For the same problem in Neovim-qt, only setting QT_AUTO_SCREEN_SCALE_FACTOR=1 seems to work ok. I have created a version with only QT_AUTO_SCREEN_SCALE_FACTOR enabled with the new setting process. Does this solve the problem as well?

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

akiyosi avatar Aug 22 '22 14:08 akiyosi

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

akiyosi avatar Sep 27 '22 00:09 akiyosi

@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 avatar Sep 28 '22 00:09 ldelossa

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

ldelossa avatar Sep 28 '22 13:09 ldelossa

@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

akiyosi avatar Sep 28 '22 16:09 akiyosi

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.

ldelossa avatar Sep 28 '22 17:09 ldelossa

@ldelossa Thanks. Please let me confirm the following.

  • Is it correct understanding that the QT_SCREEN_SCALE_FACTORS environment variable is set to 1 in your environment beforehand, also avoiding the problem?
  • Would the situation be different if you started a goenovim with the CI artifact binaries as follows? /path/to/goneovim --nofork

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.

akiyosi avatar Sep 29 '22 00:09 akiyosi