Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.15.8, 6.2.4
-
Fix Version/s: None
-
Component/s: GUI: Printing, PDF
-
Labels:
Description
Steps to reproduce
- Set your display scaling to 200%
- 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 100% and repeat steps #2 - #6.
Note: 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.