Fyrox icon indicating copy to clipboard operation
Fyrox copied to clipboard

[editor bug] Fonts blurry with display scaling 200% in GNOME using X11

Open fnune opened this issue 2 years ago • 6 comments

The fonts in the editor look blurry. Note that it's only the fonts: other graphics such as the scene preview and icons scale up properly.

image

Here's a close-up:

image

And here's a comparison with another window with correct scaling:

image

Some information about my system:

 ~/Development/fyrox/game => uname -a
Linux feanor 6.1.0-11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux

 ~/Development/fyrox/game => gnome-shell --version
GNOME Shell 43.6

 ~/Development/fyrox/game => echo $XDG_SESSION_TYPE
x11

fnune avatar Aug 12 '23 14:08 fnune

Hi, this is because Fyrox uses bitmap fonts and bakes font atlas in 1:1 ratio.

mrDIMAS avatar Aug 13 '23 07:08 mrDIMAS

I see. Do you think it's feasible to change that?

If I were to take a look at it myself, where should I start?

fnune avatar Aug 13 '23 11:08 fnune

Hard to tell, the problem is quite complex. At first, when display scaling is applied to the UI, it just scales the geometry of the text (each quad per glyph). This means that the UI does not care what is actually placed on these text quads, it just generates geometry of a proper size. The renderer then using a font atlas to render glyphs. This is where the problem hides - font atlas was generated to 100% display scaling, but used with 200%. So you can begin at https://github.com/FyroxEngine/Fyrox/blob/master/fyrox-ui/src/ttf.rs and try to play with the font atlas bitmap size.

mrDIMAS avatar Aug 13 '23 20:08 mrDIMAS

This seems to be an issue on 100% scaling X11 as well. image

perry-blueberry avatar Oct 01 '23 19:10 perry-blueberry

Hmm, so no support for Signed Distance Field fonts?

DanielJoyce avatar Mar 14 '24 16:03 DanielJoyce

This issue should be partially fixed by layout rounding feature, that was added recently.

mrDIMAS avatar Mar 14 '24 17:03 mrDIMAS