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.
|For Gerrit Dashboard: QTBUG-59196|
|188409,3||Fix char format of preedit text in empty text block||5.8||qt/qtbase||Status: MERGED||+2||0|