Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7
-
None
Description
When a ligature is created between 2 characters, the generated PDF will not have them saved as text.
Example: run the code below, open the PDF it generates, select the whole text, copy it and paste it in a text editor.
The first word will be complete when pasted (at least with the default font used by my system) while the second, due to the font being Calibri Light, will be missing the linked `ti`.
Because of that, the buggy "application" word cannot be searched (unless you only type "applica" but that is besides the point).
#include <QtGui/QPdfWriter> #include <QtWidgets/QApplication> #include <QtWidgets/QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; QLabel l1(&w), l2(&w); l2.setStyleSheet("font: 11pt \"Calibri Light\";"); l2.move(0, 50); l1.setText("application"); l2.setText("application"); QPdfWriter writer("Test.pdf"); writer.setResolution(100); w.render(&writer); return 0; }
The behavior does not depend on the type of widget being printed: the issue exists with e.g. `QTextEdit`, even though text can be selected/copied perfectly.