Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.0 Beta3
Description
QTextDocument has no way of defining a default DPI, so it will use qt_defaultDpi() instead, which is based on system settings (or 75 in the case of a non-GUI application). In principle, this is okay, since it will match the DPI of fonts, but it makes certain use cases difficult.
For instance, if you want to get actual physical sizes e.g. in an image or on a printer, you have to account for the logical DPI factor of the system (or override this using AA_Use96Dpi), even if the QTextDocument is never drawn to any screen. This is not just an issue for fonts, but things like setting absolute sizes for an iframe (or a table) for instance, will also interpret the pixel size in terms of the system's logical DPI and scale all output to the target device based on this.
If there was a way to set the DPI of the QTextDocument, it would make use cases like this a lot easier.
Attachments
Issue Links
- duplicates
-
QTBUG-90958 When an image with a fixed DPI as the paint device for a QTextDocument's layout then it will still have differences when the Windows scale factor is changed
- Closed
- relates to
-
QTBUG-90958 When an image with a fixed DPI as the paint device for a QTextDocument's layout then it will still have differences when the Windows scale factor is changed
- Closed
- resulted from
-
QTBUG-60096 QTextDocument should refrain from utilizing the qt_defaultDpi() and instead calculate the scale based on the resolution of the paint device
- Closed