Skip to content

Conversation

expenses
Copy link
Contributor

@expenses expenses commented Sep 3, 2025

DO NOT MERGE

This is a complete draft and I do not know what I'm doing.

Related to #6298 #6215 #5748 afaik.

What seems to be happening is that slint is doing its own handling of monitor scale factors/DPI scales greater than 1. At the same time, there's code in femtovg to handle this, but the logic is either somewhat botched or unaware of what slint is already doing. Such that if slint is already handling a scale factor of e.g. 1.5, then that is mistakenly being multiplied by another 1.5 in femtovg to produce a value of 2.25 that's doing something bad somewhere. Or something.

My changes here just remove the scale passed to femtovg and hardcode a value of 1.0 instead.

Regardless, compare how the bevy example looks on my 1.566667 scale factor laptop monitor before and after this change. You might need to download the file and view it 1:1 to properly see the difference:

20250902_12h32m51s_grim

Even if this is indeed the correct solution here (I doubt it) then more cleanup work is needed.

@CLAassistant
Copy link

CLAassistant commented Sep 3, 2025

CLA assistant check
All committers have signed the CLA.

@tronical
Copy link
Member

tronical commented Sep 3, 2025

Related also #2618

// dpi / device pixel ratio as the anti-alias of femtovg needs that to draw text clearly.
// We need to care about that `ceil()` when calculating metrics.
femtovg_canvas.set_size(surface_size.width, surface_size.height, scale);
femtovg_canvas.set_size(surface_size.width, surface_size.height, 1.0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts #2618 more or less. I was under the impression that it looked better, but from the amount of reports and your testing it looks like that isn't universally the case. I'm okay with reverting back to what you're proposing, but I think the comment before this function call needs adjusting.

@expenses
Copy link
Contributor Author

expenses commented Oct 7, 2025

I don't believe that this is still relevant after the recent fontique and parley changes.

@expenses expenses closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants