Recent

Author Topic: Qt6 has lower font quality than Qt5  (Read 1928 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Qt6 has lower font quality than Qt5
« on: November 19, 2022, 10:11:56 am »
For comparison, top is qt6, bottom is qt5.
https://github.com/Alexey-T/CudaText/issues/4595#issuecomment-1320821691

quote: I tried a fonts.conf file per the wiki, no effect (tried many combinations, disabling/enable aliasing/hints, using filters, etc. I had no fonts.conf before on this machine.
« Last Edit: November 19, 2022, 10:14:35 am by AlexTP »

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #1 on: November 19, 2022, 12:36:26 pm »
Maybe you should check qt.io bug tracker for such bugs.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #2 on: November 19, 2022, 12:44:14 pm »
Also you tried QFont_setHintingPreference(handle: QFontH; hintingPreference: QFontHintingPreference); setting it to FullHinting ?

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #3 on: November 19, 2022, 02:00:42 pm »
@zeljko
How my cross-platform app can try QFont_setHintingPreference(handle: QFontH; hintingPreference: QFontHintingPreference) ? this is the job of the widgetset IMO. Can you please add it?

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #4 on: November 19, 2022, 02:34:27 pm »
(Maybe consider the TFont.Quality when setting this? You are the master)

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #5 on: November 19, 2022, 03:17:21 pm »
@zeljko
How my cross-platform app can try QFont_setHintingPreference(handle: QFontH; hintingPreference: QFontHintingPreference) ? this is the job of the widgetset IMO. Can you please add it?
Yes, changes to the cbindings and qt62.pas will be commited today, currently testing since I have to change complete QFontDatabase implementation since it's obsoleted as class in Qt6 and have only static members.
QFont_setHintingPreference(), QFont_hintingPreference() is added, and also added to the TQtFont object (qtobjects.pas), so you can play with after my commits (and rebuild libQt6Pas)

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #6 on: November 19, 2022, 03:25:04 pm »
Seem that win and mac supports different fontengine from the command line ./myapp -platform cocoa fontengine=freetype, but it's not supported under x11 :(

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #7 on: November 19, 2022, 04:55:01 pm »
Possible solution (after commit), in qt6/qtwinapi.inc -> CreateFontIndirectEx(), after setting style strategy call
QtFont.setHintingPreference(QFontPreferNoHinting) and see if it helps. Maybe that param should be setted up only when style strategy = antialias

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #8 on: November 19, 2022, 04:58:43 pm »
Thanks for these changes. I hope change will be inside Qt6 WS... I did not understand some part of your text

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #9 on: November 19, 2022, 06:17:12 pm »
C bindings are updated, also qt62.pas, added setHintingPreferences to TQtFont (qtobject.pas).
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/1d09c01275d9957602ea559539688564ef4597d7


AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #11 on: November 19, 2022, 07:34:01 pm »
2nd URL tells that it is the Qt6 bug and we must wait for the fix, ok.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #12 on: November 19, 2022, 08:08:54 pm »
Friends found that font problem is fixed by adding the env-var:
https://wiki.freepascal.org/CudaText#Linux:_Qt5_and_Qt6_builds

it also fixes the distorted icons painted from ImageList.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 has lower font quality than Qt5
« Reply #13 on: November 19, 2022, 09:15:55 pm »
No need for env variable, setted up QGuiApplication to use Round by default. Please change wiki.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/364a94d82b1cc710ea30604394002329fed945ff

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Qt6 has lower font quality than Qt5
« Reply #14 on: November 20, 2022, 01:50:20 pm »
Great, removed the env-var info from wiki.

 

TinyPortal © 2005-2018