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

Block's initial font size wrong in QTextDocument when using IME

    XMLWordPrintable

Details

    • 391e3aeef45efc937979b44c32147206e389a60b

    Description

      In the beginning of an empty block in QTextDocument the font size is not the one set with QTextCharFormat::setFontPointSize(). This is best seen when using IME e.g. with Japanese. Then the first word of a block has invalid font size until the word is accepted. See the attached image with 3 screenshots: 1) typing the word (invalid), 2) opening the selection menu (invalid) and 3) after accepting the word (correct).

      The document sets correct font size when the text is inserted i.e. QTextCursor::insertText() is called. Therefore the problem is not visible with Latin languages, because insertText() is called immediately when the first character is input while with IME languages insertText() is called when the word is accepted.

      See the attached example app for reference. Change the input language to Japanese (or other IME language) and start typing. Accept the word with 'enter' key and press 'enter' again for new line. And type again.

      Tested only on Windows.

      Attachments

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: