View Issue Details

IDProjectCategoryView StatusLast Update
0004351FreeCADFeaturepublic2021-02-06 06:49
Reportercbruner Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Target Version0.20 
Summary0004351: gui font sizes are very small on a large screen (High DPI) (how to fix)
DescriptionMy fix as shown in forum topic
https://forum.freecadweb.org/viewtopic.php?f=3&t=41656&p=392509#p392509
is to set environment variables before starting freecad.
exec=/usr/bin/env QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=1.7 ~/bin/freecad_
QT seems to be borked on highdpi monitors.
According to QT documentation, these environment variables can be set inside program.

My suggestion is to add to /edit/preferences/general/display
a checkbox for QT_AUTO_SCREEN_+SCALL_FACTOR and if not checked then a text field for
QT_SCALE_FACTOR.
Steps To Reproduceuse any high dpi monitor or large screen (in my case a 4k tv).
I've attached two screen shots to illustrate the problem and solution.
Current is without env variables set and hidpi is with env set.
TagsGUI, HiDPI
FreeCAD InformationOS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21280 (Git) AppImage
Build type: Release
Branch: master
Hash: 6f3160db3e88733536c7eaf97ad7d6ebd21baccd
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Canada (en_CA)

Activities

cbruner

2020-05-28 19:27

reporter  

current.png (Attachment missing)
hidpi.png (Attachment missing)

vanuan

2020-07-19 11:09

reporter   ~0014659

I see you're using Cinnamon. Have you enabled HiDPI mode in display settings? If yes, what Zoom level did you choose? For example, GNOME supports 100%-400% scaling

vanuan

2020-07-19 11:12

reporter   ~0014660

Last edited: 2020-07-19 11:12

Also, post your
xrdb -query
output

cbruner

2020-07-19 23:52

reporter   ~0014661

3840x2160 dpi, Double (Hi-DPI)

xrdb -query
customization: -color
Xft.dpi: 211.19921875
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.rgba: rgb

vanuan

2020-07-20 15:54

reporter   ~0014662

Last edited: 2020-07-20 15:54

Ok, so it's not smaller than mine. It's just that the difference between window title font size and the Qt calculated font size is larger than mine. This means Cinnamon has larger theme fonts than GNOME's.

But anyway, I see it now. Qt's menubar size should match the system's. So it doesn't inherit the theme of the operating system.

Googling around I found this: https://github.com/AppImage/pkg2appimage/issues/88

So I doubt it's related to HiDPI. It's rather an issue with AppImages not inheriting the System's theme

cbruner

2020-07-20 18:41

reporter   ~0014663

No, it's not an appImage problem. I compile from source (now) and the situation appears to be the same.

Also if you look at the images, it's not just the title font, it's all the fonts.

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22038 (Git)
Build type: Unknown
Branch: master
Hash: 71e1f7c331fcd97c74b4a159bb6a8c90df903e6e
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

vanuan

2020-07-21 20:20

reporter   ~0014664

You need to install qgtk3 platform plugin:

https://bugreports.qt.io/browse/QTBUG-62510

vanuan

2020-07-21 20:25

reporter   ~0014665

Here's a package for Ubuntu:
https://packages.ubuntu.com/bionic/qt5-gtk-platformtheme

Not sure if there's equivalent for Mint

vanuan

2020-07-21 20:26

reporter   ~0014666

After installing, use env QT_QPA_PLATFORMTHEME=gtk3

vanuan

2020-07-21 20:28

reporter   ~0014667

Make sure that the plugin (libqgtk3.so) is in the correct folder, e.g. /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/

cbruner

2020-07-21 21:18

reporter   ~0014668

After installing it, and relogging in, I'm afraid I don't see a difference.
Even compared to openoffice and gimp, freecad fonts are tiny.
ls /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/
KDEPlasmaPlatformTheme.so libqgtk3.so

cbruner

2020-07-21 21:24

reporter   ~0014669

image.png (Attachment missing)

vanuan

2020-07-22 10:11

reporter   ~0014672

You don't need to relogin. Try this:


QT_QPA_PLATFORMTHEME=gtk3 QT_DEBUG_PLUGINS=1 ./bin/FreeCAD

Find the platformthemes output, something like this:

QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platformthemes/libqgtk3.so"
Found metadata in lib /usr/local/Qt-5.13.2/plugins/platformthemes/libqgtk3.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "gtk3"
        ]
    },
    "className": "QGtk3ThemePlugin",
    "debug": false,
    "version": 329473
}


cbruner

2020-07-22 12:41

reporter   ~0014673

Last edited: 2020-07-22 12:45

I relogged in after installing the library because I didn't see any difference.

Here is the total output from report view. I don't see any reference to libqgtk3.so
The build was done with

cmake .. -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DFREECAD_USE_P
CL=OFF
report.txt (Attachment missing)

vanuan

2020-07-22 13:02

reporter   ~0014674

Indeed, I don't see any reference to plugins/platformthemes/ and plugins/platforms/

Are you sure this is a full output? Here's mine fist lines:

FreeCAD 0.19, Libs: 0.19R22036 +2 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Loading Assembly4 WorkBench
QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/Qt-5.13.2/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/local/Qt-5.13.2/plugins/platforms/libqlinuxfb.so"

cbruner

2020-07-22 13:39

reporter   ~0014675

Last edited: 2020-07-22 13:47

My file was from the report view. You're showing the bash output.
Mine bash output is

FreeCAD 0.19, Libs: 0.19R22104 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Loading Assembly4 WorkBench
Sheet Metal workbench loaded
Interlocking laser cut workbench loaded
A3 available
connect failed: No such file or directory
Interesting, I've never noticed the connect failed before.

Apparently a known issue. https://forum.freecadweb.org/viewtopic.php?t=37021
I tried renaming ~/.FreeCAD to ~/.FreeCAD1 but that made no difference (other then default pages were cleaned up).

cbruner

2020-07-22 13:56

reporter   ~0014676

I tried running it with --write-log and this is the result.
FreeCAD.log (Attachment missing)

vanuan

2020-07-22 20:39

reporter   ~0014679

Last edited: 2020-07-22 20:43

Now we're getting somewhere
Log: QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes" ...
Log: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so"
Log: Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "kde"
        ]
    },
    "className": "KdePlatformThemePlugin",
    "debug": false,
    "version": 329989
}


Log: Got keys from plugin meta data ("kde")
Log: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so"
Log: Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "gtk3"
        ]
    },
    "className": "QGtk3ThemePlugin",
    "debug": false,
    "version": 329989
}


Log: Got keys from plugin meta data ("gtk3")
Log: QFactoryLoader::QFactoryLoader() checking directory path "/home/chris/github/freecad-source/build/bin/platformthemes" ...
Log: loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so"

So you've got gtk3 and kde platform themes.

Is switching between these two changes anything?

$ QT_QPA_PLATFORMTHEME=gtk3
vs

 $ QT_QPA_PLATFORMTHEME=kde


Also try this option


-style breeze

vanuan

2020-07-22 20:45

reporter   ~0014680

BTW, Cinnamon uses Gtk3 and D-Bus, right?

cbruner

2020-07-22 21:21

reporter   ~0014681

QT_QPA_PLATFORMTHEME=gtk3 QT_DEBUG_PLUGINS=1 ./bin/FreeCAD
vs
QT_QPA_PLATFORMTHEME=kde QT_DEBUG_PLUGINS=1 ./bin/FreeCAD
kde was a little lighter in colour but otherwise no change in fonts.

-style breeze made no difference to either.
I believe you are correct regarding gtk3 and d-bus

cbruner

2020-08-24 15:33

reporter   ~0014707

A note about this topic. I recently upgraded to Linux Mint 20, and this issue has largely gone away. The only problem as this point is the fonts are slightly larger than the text box. For example, adding a constraint, change the diameter of a circle 18.0 will only show the top 2/3ds of the 18.

vanuan

2020-08-26 07:32

reporter   ~0014713

Any indication what's changed? Qt version?
Has the debug output changed wrt plugins used ( QT_DEBUG_PLUGINS=1 ) ?
Maybe it's just that system font better matches the Qt one?

cbruner

2020-08-26 13:59

reporter   ~0014720

It looks like the qt installed it 5.12.8
No difference in the debug output.
This was a fresh install (keeping my home directories), whereas my old one was updated over the last 5 years, so there was a lot of kruft on it.

Kunda1

2020-10-08 13:45

administrator   ~0014796

Any updates on this issue? What is left to do?

cbruner

2020-10-08 14:45

reporter   ~0014802

as far as I am concerned it can be closed. (It went away when I upgraded my system).

Issue History

Date Modified Username Field Change
2020-05-28 19:27 cbruner New Issue
2020-05-28 19:27 cbruner Tag Attached: GUI
2020-05-28 19:27 cbruner Tag Attached: HiDPI
2020-05-28 19:27 cbruner File Added: current.png
2020-05-28 19:27 cbruner File Added: hidpi.png
2020-07-19 11:09 vanuan Note Added: 0014659
2020-07-19 11:12 vanuan Note Added: 0014660
2020-07-19 11:12 vanuan Note Edited: 0014660
2020-07-19 23:52 cbruner Note Added: 0014661
2020-07-20 15:54 vanuan Note Added: 0014662
2020-07-20 15:54 vanuan Note Edited: 0014662
2020-07-20 18:41 cbruner Note Added: 0014663
2020-07-21 20:20 vanuan Note Added: 0014664
2020-07-21 20:25 vanuan Note Added: 0014665
2020-07-21 20:26 vanuan Note Added: 0014666
2020-07-21 20:28 vanuan Note Added: 0014667
2020-07-21 21:18 cbruner Note Added: 0014668
2020-07-21 21:24 cbruner Note Added: 0014669
2020-07-21 21:24 cbruner File Added: image.png
2020-07-22 10:11 vanuan Note Added: 0014672
2020-07-22 12:41 cbruner Note Added: 0014673
2020-07-22 12:41 cbruner File Added: report.txt
2020-07-22 12:43 cbruner Note Edited: 0014673
2020-07-22 12:45 cbruner Note Edited: 0014673
2020-07-22 13:02 vanuan Note Added: 0014674
2020-07-22 13:39 cbruner Note Added: 0014675
2020-07-22 13:42 cbruner Note Edited: 0014675
2020-07-22 13:47 cbruner Note Edited: 0014675
2020-07-22 13:56 cbruner Note Added: 0014676
2020-07-22 13:56 cbruner File Added: FreeCAD.log
2020-07-22 20:39 vanuan Note Added: 0014679
2020-07-22 20:43 vanuan Note Edited: 0014679
2020-07-22 20:45 vanuan Note Added: 0014680
2020-07-22 21:21 cbruner Note Added: 0014681
2020-08-24 15:33 cbruner Note Added: 0014707
2020-08-26 07:32 vanuan Note Added: 0014713
2020-08-26 13:59 cbruner Note Added: 0014720
2020-10-08 13:45 Kunda1 Note Added: 0014796
2020-10-08 14:45 cbruner Note Added: 0014802
2021-02-06 06:49 abdullah Target Version => 0.20