May 31, 2011

soroush soroush
Ant Farmer
818 posts

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.

4 replies

June 1, 2011

soroush soroush
Ant Farmer
818 posts

anything?

June 1, 2011

SimonL SimonL
Lab Rat
46 posts

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.

June 1, 2011

soroush soroush
Ant Farmer
818 posts

Ok, I don’t care about using QPlainTextEdit or QTextEdit… how could I do this with QTextEdit efficiently ?

June 2, 2011

SimonL SimonL
Lab Rat
46 posts

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

 
  ‹‹ QGLWidget Viewport Ugly Text      Code Folding? ››

You must log in to post a reply. Not a member yet? Register here!