Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34032

QFontEngineMulti::addOutlineToPath calculates wrong x-position for polish special characters and certain fonts, using a justified layout.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P2: Important P2: Important
    • None
    • 5.0.2
    • GUI: Text handling
    • 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.

        1. effective output.jpg
          effective output.jpg
          2 kB
        2. qfontengine.cpp
          57 kB
        3. wanted output.jpg
          wanted output.jpg
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            qtjira021012 Peter Lohmeyer
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes