Problem with fonts in GTK applications

Hi all. I got a problem. Fonts in GTK applications became ugly. I tried to disable and enable anti-aliasing in System Settings but it fixes the problem only for a short time. After restarting, the fonts become look bad again. How can I fix this?
Kubuntu 22.04, Plasma 5.24.7

Is it a flatpak and are you on x11?

No, it’s not a Flatpak app on the screenshot. And the problem is present in all GTK applications such as Shotwell, Firefox, etc. X11, yes.

After some searching, I finally found a fix.
Created a file ~/.xsettingsd with config:

Xft/Hinting 1
Xft/HintStyle “hintfull”
Xft/Antialias 1
Xft/RGBA “rgb”