-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.0.2
-
None
-
Windows 7 (64 bit)
How to reproduce: Print a QTextDocument containing polish characters like
"Jestem Jaś. Przyszedłem na świat" and "justified" layout with the font "Lucida Sans" (there are also some other fonts, resulting in this error) into a PDF, using outlining fonts (curves), not embedding fonts in the PDF.
Error: The position of special characters like ł or ś is wrong and the text in the resulting PDF looks mixed up.
Reason (as far as i can say): Running through QFontEngineMulti::addOutlineToPath with the above sentence, the high byte for glyphs like ł or ś indicates a change of the font engine and calculates a wrong x-position for outlining the special characers in the following call to QFontEngine::addOutlineToPath. This is only happening using a justified layout.
During some more analysis i found out, that QFontEngine::getGlyphPositions adds glyphs.justifications[i].space_18d6 for each glyph. space_18d6 is used to correct the spacing for space characters in a jusitified layout. I guess the same needs to be done in QFontEngineMulti::addOutlineToPath to get the correct x-positions.
Comparing QFontEngine::getGlyphPositions and QFontEngineMulti::addOutlineToPath indicates some potential for reusing.
I found this bug using Qt 5.0.2 and haven't tested it with 5.1.1 or later, but a quick review in git showed, that this bug is still in there.