The length of the cursor changes when I input a word, and the length becomes the same as the word. How can I set QPlainTextEdit?
self.setFont(QFont("Consolas", 10, QFont.Normal))
I set the css font family "Consolas", and when I input English words, there is no problem. (I highlight the line number because when I get a screenshot the cursor disappear)
But when I input Chinese word (this word is higher than English word), the problem comes.
As you can see, the chinese word sinks (the height of the line became higher and the line sink): it is strange.
The effect of above picture in Sublime Text is what I want.
I think there is no problem with
QPlainTextEdit
. You are seeing this problem because you are comparing Chinese letters with lower-case English letters:Have a look:
中国asdsd
These English letters look small as compared to Chinese ones, but:
国中ASDFASD
In this case they look same sized. Try it in your
QPlainTextEdit
, I tried it, everything is okay :)