Please nominate your Qt Champions for 2021!

A subclass of QPlainTextEdit with two fonts for two scripts?

  • Hi there,

    I'm interested in some kind of plain text editor with this specification: For each character 'c' if c a is a Persian or Arabic letter (its code is in a certain unicode range) then set its font to F else set its font to G. (Obviously reimplementing key-press will not help.) Also, the user should be able to change F and G.

  • anything?

  • You could probably use QTextEdit but then you would need to specify your different fonts in html tags
    I believe your main limitation in QPlainTextEdit will be its restriction to having 1 font at a time.

  • Ok, I don't care about using QPlainTextEdit or QTextEdit... how could I do this with QTextEdit efficiently ?

  • I haven't played with this object much yet but you should be able to use the cursor to determine new user input

Log in to reply