Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.8, 6.2.4, 6.3.1
-
Windows 10 Pro 21H2, MSVC 2019 x64
-
3158068209 (qt/qtbase/dev) 3158068209 (qt/tqtc-qtbase/dev) 9ac433b40a (qt/qtbase/6.4) 5f6bc72cd5 (qt/tqtc-qtbase/6.2) 9ac433b40a (qt/tqtc-qtbase/6.4) 9ac433b40a (qt/tqtc-qtbase/6.4.1)
Description
Steps to reproduce
- Set your display scaling to 100%
- Open the "Text Edit" example (https://doc.qt.io/qt-6/qtwidgets-richtext-textedit-example.html) and load the attached HTML document.
- Visually inspect the text in the QTextEdit on screen.
- Click "File" > "Print..." and select "Microsoft Print to PDF". Print the PDF document and visually inspect it in a PDF viewer.
- Click "File" > "Export PDF...". Print the PDF document and visually inspect it in a PDF viewer.
- Close the example application.
- Set your display scaling to 200% (OR, run the application with -platform windows:fontengine=directwrite) and repeat steps #2 - #6.
Notes:
- Step #1 forces the use of the GDI font engine; Step #7 forces the use of the DirectWrite font engine
- Step #4 causes QPrinter to invoke the OS' PDF printer; Step #5 causes QPrinter to invoke Qt's internal PDF printer.
Outcomes
- Correct outcome (correct.png): The "SITKA" text is a bit smaller than the "ARIAL" text. The "SITKA" text has good kerning.
- Wrong outcome (wrong.png): The "SITKA" text is a bit bigger than the "ARIAL" text. The "SITKA" text has bad kerning – the letters touch each other.
Scaling | Text Source | Outcome |
---|---|---|
100% | QTextEdit | Correct |
100% | Microsoft PDF printer | Correct |
100% | Qt PDF printer | Correct |
200% | QTextEdit | Correct |
200% | Microsoft PDF printer | Correct |
200% | Qt PDF printer | WRONG |
Notes
- Most fonts aren't affected by this issue. Some, like Sitka Text, are.
- Qt 5.15 also displays this issue if `QGuiApplication::setAttribute(Qt::AA_EnaableHighDpiScaling);` is set.