pop-os / cosmic-text

Pure Rust multi-line text handling
https://pop-os.github.io/cosmic-text/cosmic_text/
Apache License 2.0
1.57k stars 100 forks source link

example `editor-libcosmic` does not properly apply scale #33

Closed WhyNotHugo closed 1 year ago

WhyNotHugo commented 1 year ago

Running the editor-libcosmic example, I get this:

image

There is no text rendered anywhere. Clicking on the big textfield and typing does nothing. Opening a file changes nothing. The pulldown menus and toggle buttons respond, but do nothing.

mmstick commented 1 year ago

This looks like a graphics driver issue. What GPU do you have?

WhyNotHugo commented 1 year ago

Oh, that was on Asahi Linux / M1. So software rendering. I'll try on another host.

WhyNotHugo commented 1 year ago

I tried on Intel, text rendering is very blurry:

image

WhyNotHugo commented 1 year ago

Screenshot from 2022-11-03 at 22_25_38 092491215

WhyNotHugo commented 1 year ago

Dammit, github compreses too much: https://0x0.st/ogOl.09249121

jackpot51 commented 1 year ago

You should run cargo update to ensure you have the latest version of iced. We have a patched version that fixes the blurriness.

WhyNotHugo commented 1 year ago

I think the issue is the example itself isn't handling the scale properly. Actually, not sure about this; I'm not sure if it's an issue in the example, in cosmic-text or in iced.

The issue becomes extremely obvious when setting scale=6:

image

I can repro this with:

cd ~/clones/github.com/pop-os/cosmic-text
cd examples/rich-text/
echo "output * scale 6\nxwayland off\nexec cargo run" > sway.conf
sway -c sway.conf

If you run your terminal (e.g.: foot) instead of cargo run, it renders perfectly crisp.

VitalyAnkh commented 1 year ago

Is this problem fixed by https://github.com/pop-os/cosmic-text/commit/d85f12af8bbee5a3ef97dc9785f8193a0c3b5f4e?

jackpot51 commented 1 year ago

Yes, it should be.

WhyNotHugo commented 1 year ago

Yeah, now it's nice and sharp!