Priority: P3: Somewhat important
Affects Version/s: 5.6.3, 5.8, 5.9.1
Component/s: GUI: Font handling
Environment:Linux Mint 18, Cinnamon Edition.
Some Linux desktop environments, such as Cinnamon or Gnome 3, set font DPI by using a floating point scaling factor, such as 1.2, from within their graphical Settings tools. The Typically, the scaling factor is applied to the monitor's default (such as 96 DPI), and the result is applied to Xft.dpi. The Xft.dpi value thus also is a floating point value, for example, 115.19921875. Qt apps seem to like nicely rounded integer values only, and will default to using a 96 DPI for fonts (or the monitor default) if a floating point value is set for Xft.dpi. Below are steps to replicate this in Cinnamon. These steps also prove that Qt apps will correctly accept an integer value from Xft.dpi.
1. Set DPI to 1.2 in Cinnamon Settings Manager.
2. From a terminal, query the DPI value set for Xft.dpi by Settings Manager. It will be 115.19921875 on a typical FHD screen.
3. Launch a Qt application, and note that its font is a smaller size than the GTK applications.
4. Create a file named ~/.Xresources. Populate it as follows:
5. Run the following command in a terminal from your home directory to laod the new Xft.dpi value.
6. Query the DPI value again. Note that it is an integer value (115).
7. Launch the Qt application again. It's font size will now be the same size as any GTK app.
Qt should ideally be fixed to read the Xft.dpi value as a floating point, and round and cast the value internally to an integer.
Note that desktop environments such as Mate or Xfce do not have this issue with Qt applications, since their Settings Managers always set an integer value for Xft.dpi (such as 115) rather than using a floating point scaling factor like Cinnamon or Gnome 3 do.
You can also use the above steps to set Xft.dpi in .Xresources to be a floating point value, such as 115.8325. This will likewise prove that Qt rejects the Xft.dpi setting if it is a floating point value.