Since switching to QT 6.0.0 I got problems with QPdfWriter. Every Time I try to print a text, the embedded font couldn't get loaded from various pdf reader (even Adobe reader). I'm as well not getting any errors or anything else on the output.
QPdfWriter writer("C:/Users/GGG/Desktop/lol.pdf");
writer.setResolution(300);
writer.setPageSize(QPageSize(QPageSize::A4));
writer.newPage();
QPainter painter;
painter.begin(&writer);
painter.drawText(600,600,"Hello, this is a test");
painter.end();
My attempts:
- Check the doc's and internet -> didn't found anything useful
- read out the font (there is one embedded, but faulty)
- Change font of QPainter to "Calibri"
- check if the font is available with
db.hasFamily("Calibri");
(return value = true) - Check graphics card driver -> installed rightly, no updates available .
- Rebuild with Qt 5.15.2 (in both cases MinGW64) -> Font is embedded correctly. But gone if I turn back to Qt version 6.0.0
- Checked my QT components -> I have installed for Qt 6.0.0:
MinGW 8.1.0 64Bit
,Sources
,Qt 5 compatibility Module
,Qt Shader Tools
,Qt Debug Information Files
. - tried the same with QPrinter which prints Pdf files - same behaviour.
Still no clue what could cause this behavior. Does anyone got the same fault or has a solution?
Information about my system:
Windows 10, 64bit - used fonts are installed
Qt creator 4.14.0 - MinGW64 with Qt 6.0.0
Finally, after research on other forums like forum.qt.io I found out it might be a bug. There's alredy a bugreport open -> https://bugreports.qt.io/browse/QTBUG-89727
edit: Turned out it was a bug - wich is fixed now. As the bugfixer wrote:
Bugfix here: https://codereview.qt-project.org/c/qt/qtbase/+/329442