FreeCAD icons and splash screen look pixeled on High-DPI screens
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
FreeCAD icons and splash screen look pixeled on High-DPI screens
I invested in a new laptop (15 inch, High-DPI screen). Now I can reproduce a negative feedback I got from people who give FreeCAD a first try:
- the application looks pixeled in some fields.
I can reproduce these two als with current master:
A: the splash screen font (we know the image looks pixeled because of its low resolution): B: the icons in the preferences dialog:
For the latter, I see that in the AddonManager, the icons look nice, so there should be a way to solve at least issue B. @chennes , do you have an idea what setting is maybe just missing in the preferences dialog?
- the application looks pixeled in some fields.
I can reproduce these two als with current master:
A: the splash screen font (we know the image looks pixeled because of its low resolution): B: the icons in the preferences dialog:
For the latter, I see that in the AddonManager, the icons look nice, so there should be a way to solve at least issue B. @chennes , do you have an idea what setting is maybe just missing in the preferences dialog?
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
The second image (2x) is actually just an upscale version of the low resolution original, we don’t have a true HiDPI version of that one available. The image’s author only created the low rez version, and was unable to directly make a high rez.
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
Regarding the icons: the addon manager just uses QIcons created from the original SVGs, and Qt deals with the HiDPI scaling. I never could figure out why the preferences and splash screen created the low rez assets. It is actually probably due to old attempts at HiDPI support conflicting with QT’s much-improved later code. Their early HiDPI support was pretty awful.
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
There is also a third case of pixelation:
C: the NaviCube: I am working on this now. The problem hereby is that the font "Helvetica" is hard-coded, but on Win 11 there is no "Helvetica" anymore and thus an ugly replacement is used. So we need to add a preferences option to the dialog on what font to be usedfor the NaviCueb. I think I can do this by tomorrow.
C: the NaviCube: I am working on this now. The problem hereby is that the font "Helvetica" is hard-coded, but on Win 11 there is no "Helvetica" anymore and thus an ugly replacement is used. So we need to add a preferences option to the dialog on what font to be usedfor the NaviCueb. I think I can do this by tomorrow.
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
Thanks. Maybe, if you have time, you can have a look at the preferences dialog if you quickly see there a workaround that we should remove.
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
this was reported many times by @onekk, IIRC the Qt documentation claimed to safely fallback to other SansSerif fonts if Helvetica is not available. I could have sworn I made a PR to make the font just "SansSerif" and not specifically "Helvetica" but it seems I never did , not sure if this would solve it anyways.uwestoehr wrote: ↑Thu Jan 19, 2023 5:44 pm I am working on this now. The problem hereby is that the font "Helvetica" is hard-coded, but on Win 11 there is no "Helvetica" anymore and thus an ugly replacement is used. So we need to add a preferences option to the dialog on what font to be usedfor the NaviCueb. I think I can do this by tomorrow.
edit: there is an existing issue for this: issue #5959
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
I agree that Helvetica is not included with Windows 11. However, there is a replacement in the registry to substitute Arial. (I have not changed anything related to that substitution on my computer.)
There may be something else going on other than the name of the font.
Gene
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
Qt may have no knowledge of that registry key
Re: FreeCAD icons and splash screen look pixeled on High-DPI screens
I spent now some hours and it turned out the problem in Win 11 is the following:
- Qt uses "Helvetica" as alternative to get a Sansserif font ( styleHint QFont::SansSerif).
- The point is now that on Windows 11 sansserif fonts like DejaVu Sans do not have the
styleHint QFont::SansSerif but QFont::AnyStyle
- this is the reason why, at least on my PC, the first fomt in the list of installed fonts is used as replacement because no font hat the QFont::SansSerif styleHint anymore
The only solution I see is to allow the users in the preferences to use a font he likes in a size he likes. I implemented this but I am hanging at one point where I need help:
- in order to see the changes font and size directly in the NaveCube, I need to repaint its faces. To do so, I need to delete the existing NaviCube and then recreate it. Thus my question is:
Does anybody know how I can delete an existing NaviCube at runtime?
@Rexbas