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

Mixing ligatures with differently formatted text of different writing systems doesn't work

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.5.0 Alpha
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Commits:
      c29c6d9003b3ff67770dee66652dd2faecf842d5

      Description

      Run the following application (reproduced on Mac OS X):

      #include <QtWidgets>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QTextEdit w;
          w.setText("fifi");
          QTextCursor cursor(w.document());
          cursor.movePosition(QTextCursor::EndOfLine);
          QTextCharFormat fmt;
          fmt.setFontUnderline(true);
          cursor.setCharFormat(fmt);
          cursor.insertText(QStringLiteral("\u305F\u305F\u305F"));
          w.show();
      
          return a.exec();
      }
      

      Two of the Hiragana characters will be boxes while the third will be rendered correctly.

      Remove the setCharFormat() call to see it work correctly.

      The more ligatures you add to the beginning of the string, the more of the appended Hiragana characters will show as boxes.

      What happens is that the glyph array contains the glyph indexes for the "f" and the "i", but the glyph data offset of the first Hiragana symbol points to the third glyph in the array, since both "fi" ligatures have been substituted by a single glyph each. This in turn means that Qt detects that the Hiragana character already has a glyph and thus does not search for the correct font engine to render it.

      I haven't been able to reproduce this on Linux though, so there has to be something different there.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                esabraha Eskil Abrahamsen Blomfeldt
                Reporter:
                esabraha Eskil Abrahamsen Blomfeldt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes