Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Problem in displaying Arabic fonts on QtWebKit
Forum Updated to NodeBB v4.3 + New Features

Problem in displaying Arabic fonts on QtWebKit

Scheduled Pinned Locked Moved Qt WebKit
4 Posts 1 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hdeldar
    wrote on last edited by
    #1

    I wrote a program with QtWebkit. I used Arabic fonts in this application. But the text as shown below was inapplicable. Whether there is a solution to fix it?

    !http://www.shiaupload.ir/images/50629326717303692958.jpg(test in my application)!

    "an example code ":http://filesave.me/file/22481/arabicFontInWebkit-rar.html

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hdeldar
      wrote on last edited by
      #2

      html code :
      @ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      </head>

      <style>
      /Twe Arabic font for test:/
      @font-face {
      font-family: '__me_quran';
      src: url(me_quran.ttf) format('truetype');
      }
      @font-face {
      font-family: '__traditionalArabic';
      src: url(trado.ttf) format('truetype');
      }
      #para1
      {
      font-family :/__me_quran/__traditionalArabic;
      text-align : justify;/In this project i need justify alinement/
      direction:rtl;
      }

      </style>
      [removed]
      var step=1;
      function plusZoom1(){
      document.getElementById("para1").style.zoom = parseFloat(step);
      step +=0.5;
      }

      function minusZoom1(){
          step -=0.5;
          document.getElementById("para1").style.zoom = parseFloat(step);
      }
      

      [removed]
      <body>
      <input type="button" value="+" />
      <input type="button" value="-" />
      <p id="para1">
      بِسْمِ اَللّٰهِ اَلرَّحْمٰنِ اَلرَّحِيمِ ( 1 ) اَلْحَمْدُ لِلّٰهِ رَبِّ اَلْعٰالَمِينَ ( 2 ) اَلرَّحْمٰنِ اَلرَّحِيمِ ( 3 ) مٰالِكِ يَوْمِ اَلدِّينِ ( 4 ) إِيّٰاكَ نَعْبُدُ وَ إِيّٰاكَ نَسْتَعِينُ ( 5 ) اِهْدِنَا اَلصِّرٰاطَ اَلْمُسْتَقِيمَ ( 6 ) صِرٰاطَ اَلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ اَلْمَغْضُوبِ عَلَيْهِمْ وَ لاَ اَلضّٰالِّينَ ( 7 )
      </p>
      </body>
      </html>
      @

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hdeldar
        wrote on last edited by
        #3

        qt code :
        @
        #include <QtGui/QApplication>
        #include <QWebView>

        int main(int argc, char *argv[])
        {
        QApplication a(argc, argv);

        QWebView wv;
        wv.setUrl(QUrl::QUrl("qrc:/rc/a.html"));
        wv.show();
        
        return a.exec&#40;&#41;;
        

        }
        @

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hdeldar
          wrote on last edited by
          #4

          !http://www.shiaupload.ir/images/47343138299124526783.jpg(incorrect diplay)!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved