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

Bad font rendering when fractionally scaled #140

Open
flukejones opened this issue Feb 23, 2024 · 10 comments
Open

Bad font rendering when fractionally scaled #140

flukejones opened this issue Feb 23, 2024 · 10 comments
Milestone

Comments

@flukejones
Copy link

The screenshot demonstrates the issue. Fractional scaling is 125% here. It happens on most scales except integer.

image

Not sure what other info is valuable. This does happen in both KDE and Cosmic.

@XV-02
Copy link

XV-02 commented Feb 27, 2024

Can you provide the version of Cosmic-Edit you're using?

This can be found on Pop!_OS, Ubuntu, and many other Debian derivatives by running the following in a terminal:

apt policy cosmic-edit

I just need the value next to Installed:

@flukejones
Copy link
Author

@XV-02 I run fedora and install from git (just updated to today).

Details of my setup are:

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.0-0.rc6.49.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® CoreT i7-13700H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus M16 GU604VY_GU604VY_00130747B
System Version: 1.0

I run both KDE and Cosmic.

@flukejones
Copy link
Author

Turned out I had a copy of cosmic-edit in my user bin dir, so i was never actually seeing updates when I rebuilt sysext.

@flukejones
Copy link
Author

image

Re-opening as this is still true. Running bcc1ad8

@flukejones flukejones reopened this Mar 14, 2024
@flukejones
Copy link
Author

From what I can see the bad rendering is in set places (at default window size here)

@mmstick
Copy link
Member

mmstick commented Mar 15, 2024

What graphics card and driver do you have? Does it look like this if you change the WGPU renderer, or disable GPU rendering by removing the wgpu feature from libcosmic?

@flukejones
Copy link
Author

Hmm:

  • __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia WGPU_BACKEND=gl cosmic-edit
    This is nice and crisp, but on dgpu only
  • WGPU_BACKEND=gl cosmic-edit draws blank squares
  • RUST_LOG=info WGPU_BACKEND=vulkan WGPU_ADAPTER_NAME="GeForce" cosmic-edit is not selecting the nvidia like it should (tried a number of strings)

Using mesa 24.0.0 for Intel, 550.54.14 for nvidia. I'll try without wgpu feature if I have time.

@jackpot51
Copy link
Member

The main reason for this is that the custom control cosmic-edit uses for text renders it to an image and the image size is calculated based on the logical size multiplied by the scale factor. When using a fractional size, that can sometimes end up being a size that doesn't exactly fit into integer logical pixels and then it scales incorrectly. I'm going to replace this workaround now that iced directly supports rendering cosmic_text buffers.

@flukejones
Copy link
Author

Ah I see, that explains why resizing to a particular size helped.

@jackpot51
Copy link
Member

This is partially improved by 2bfcfdf. It searches for a pixel size that is an integer in both the logical and physical coordinates. Unfortunately it does not work fully with the wgpu renderer. When I have more time I will switch to using a different rendering technique that will both improve performance and fix this issue when using the wgpu feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Alpha 2 Apps ToDo
Development

No branches or pull requests

5 participants