QGnomePlatform icon indicating copy to clipboard operation
QGnomePlatform copied to clipboard

It is lack support for font size and subpixel rendering

Open iamzhaohongxin opened this issue 3 years ago • 10 comments

iamzhaohongxin avatar May 30 '21 13:05 iamzhaohongxin

Description from RH bugzilla since this bug doesn't provide any:

Description of problem:

When enable subpixel rendering in GNOME tweaks, all gtk software work properly.
But fontconfig does not work on Qt software.

It seem that QtWayland does not work as Qt on X11.

This problem could be resolved by manually create fonts.conf on /home/username/.config/fontconfig/, but Qt program's font size is still cannot be set. 

Another solution is using qt5ct, but this software has many bug with QtWayland,
include GTK's window manager loses theme and cannot load icon theme file.  

I will submit bug report for qt5ct later.


Version-Release number of selected component (if applicable):

Fedora 34 x86_64
GNOME 40 and wayland session
Qt5 programs

How reproducible:

Everytime

Steps to Reproduce:
1. Install gnome-treak and enble subpixel rendering
2. Install some qt based software such as qbittorrent
3. Open qbittorrent

Actual results:

qbittorrent's UI does not enable subpixel rendering and font size is unchange.

Expected results:

As other GTK based software.

grulja avatar May 31 '21 04:05 grulja

But fontconfig does not work on Qt software.

fontconfig works on Qt software, it's GNOME who doesn't use fontconfig to set font settings...

ilya-fedin avatar Sep 29 '21 06:09 ilya-fedin

Maybe it's better to file a bug for GNOME and ask them to set font settings in a standardized way instead of doing hacks in Qt?

ilya-fedin avatar Sep 29 '21 06:09 ilya-fedin

Hello! May I add that Qt fonts do scale according to gnome-tweaks for Qt apps on xwayland (QT_QPA_PLATFORM=xcb), but not for native wayland, (QT_QPA_PLATFORM=wayland)

RushingAlien avatar Oct 20 '21 11:10 RushingAlien

But fontconfig does not work on Qt software.

fontconfig works on Qt software, it's GNOME who doesn't use fontconfig to set font settings...

@ilya-fedin If that is the case, why is my fontconfig settings in ~/.config/fontconfig/fonts.conf being ignored? I set a dpi setting of 120

RushingAlien avatar Jul 01 '23 11:07 RushingAlien

Because Qt doesn't read it? I believe Qt supports only a small subset of options like those related to hinting and antialiasing

ilya-fedin avatar Jul 01 '23 11:07 ilya-fedin

I see, so you can't set font size and scale factor via fontconfig

RushingAlien avatar Jul 01 '23 11:07 RushingAlien

Yeah, Qt has no platform backend supporting text scaling even though its abstraction can theoretically do that

ilya-fedin avatar Jul 01 '23 11:07 ilya-fedin

Does KDE or the KDE platform theme do anything special in this regard?

RushingAlien avatar Jul 01 '23 11:07 RushingAlien

Yeah, they have a plenty of hacks via Qt's debug environment variables (like QT_SCREEN_SCALE_FACTORS) which have a side effect of forcing modes applications may not support and resulting in broken scaling

ilya-fedin avatar Jul 01 '23 11:07 ilya-fedin