Hello,

I am confusing with some strange things when using html tags with Arabic text.

For first for render text in Qlabel i use code:

Qt Code:
  1. QChar data[] = {1576,1616,1587,1618,1605,1616,
  2. 1649,1604,1604,1617,1614,1607,1616,
  3. 1649,1604,1585,1617,1614,1581,1618,
  4. 1605,1614,1648,1606,1616,1649,1604,
  5. 1585,1617,1614,1581,1616,1610,1605,1616};
  6.  
  7. QString p(data,35);
  8.  
  9. ui->label->setFont(QFont("Scheherazade",45));
  10. ui->label->setText(p);
To copy to clipboard, switch view to plain text mode 

The output:
query1.png
there is all right and rendering is properly.

So i am using, for example, <em>arabic symbol</em> and write this code:

Qt Code:
  1. // 60,101,109,62 is <em> tag
  2. // 60,47,101,109,62 is </em> tag
  3.  
  4. QChar data[] = {60,101,109,62,1576,1616,60,47,101,109,62,
  5. 1587,1618,1605,1616,
  6. 1649,1604,1604,1617,1614,1607,1616,
  7. 1649,1604,1585,1617,1614,1581,1618,
  8. 1605,1614,1648,1606,1616,1649,1604,
  9. 1585,1617,1614,1581,1616,1610,1605,1616};
  10.  
  11. QString p(data,44);
  12.  
  13. ui->label->setFont(QFont("Scheherazade",45));
  14. ui->label->setText(p);
To copy to clipboard, switch view to plain text mode 

The output:
query2.png

also for this example <span style="color:red">arabic symbol</span>

Qt Code:
  1. QChar data[] = {
  2. // <span style="color:red">
  3. 60,115,112,97,110,32,115,116,121,108,101,
  4. 61,34,99,111,108,111,114,58,114,101,100,34,62,
  5.  
  6. 1576,1616,
  7.  
  8. 60,47,115,112,97,110,62, //</span>
  9.  
  10. 1587,1618,1605,1616,
  11. 1649,1604,1604,1617,1614,1607,1616,
  12. 1649,1604,1585,1617,1614,1581,1618,
  13. 1605,1614,1648,1606,1616,1649,1604,
  14. 1585,1617,1614,1581,1616,1610,1605,1616};
  15.  
  16. QString p(data,66);
  17.  
  18. ui->label->setFont(QFont("Scheherazade",45));
  19. ui->label->setText(p);
To copy to clipboard, switch view to plain text mode 

The output:
query3.png

example for only first symbol
Qt Code:
  1. QChar data[] = {
  2. // <span style="color:red">
  3. 60,115,112,97,110,32,115,116,121,108,101,
  4. 61,34,99,111,108,111,114,58,114,101,100,34,62,
  5.  
  6. 1576,
  7.  
  8. 60,47,115,112,97,110,62, //</span>
  9.  
  10. 1616,1587,1618,1605,1616,
  11. 1649,1604,1604,1617,1614,1607,1616,
  12. 1649,1604,1585,1617,1614,1581,1618,
  13. 1605,1614,1648,1606,1616,1649,1604,
  14. 1585,1617,1614,1581,1616,1610,1605,1616};
  15.  
  16. QString p(data,66);
  17.  
  18. ui->label->setFont(QFont("Scheherazade",45));
  19. ui->label->setText(p);
To copy to clipboard, switch view to plain text mode 

The output:

query4.png

Why when using html tags rendering is wrong? i check (color and em) in libreoffice with this font and all ok. But qt can't rendering it properly. Need help.

PS. The task is rendering highlighted Arabic text on Qt widgets (QLabel, QTextEdit, etc.)