I need to display several international scripts within a same string in a QLabel.
For instance the QLabel could display:
چاچي चाची ćāćī (dim. of ćāćā, q.v.), s.f. A paternal aunt (=ćaćī, q.v.)
The above string includes Latin script, Perso-Arabic script and Devanāgarī script (which belongs to he family of Indic scripts).
Each script requires different font families and sizes. For instance, the first word in the string is Urdu, and requires a font that is able to display ے
. Moreover, I may want to use a certain type of calligraphy (Urdu traditionally uses "Nastaleeq" script). Besides, calligraphies may require an increases in font size to be readable (not all scripts fall into regular square shapes like Mandarin pictograms, if you have little idea of the diversity of international scripts, take a look at Omniglot.) In conclusion I want each script to be displayed with a particular font and size.
Currently I feed the QLabel with a complex HTML string which I compose bit by bit by specifying the font and size to use for specific sections of the string.
<font family="SomeFamilyforUrdu" size="10>اردو</font> <font family="SomeFamilyforDevanagari" size="8">हिन्दी</font> <font family="FontforLatin" size=5>English</font>
Qt4 also offers QLabel.setFont(QFont)
, but so far I did not see any means to specify font families and sizes according to script families.
Is it possible to set conditions to the QFont so it applies different families and sizes depending on the script it paints into the QLabel?