quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
991 stars 360 forks source link

How to convert Standard Quran Text into Special Character required by the font #1101

Closed ahsansuhail closed 5 years ago

ahsansuhail commented 5 years ago

I'm submitting a ...

I need to figure out how Quran.com App is converting the text into special characters

For Example API Response:
"text_madani": "ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ", "text_indopak": "اَلۡحَمۡدُ لِلّٰهِ رَبِّ الۡعٰلَمِيۡنَۙ‏", "text_simple": "الحمد لله رب العالمين"

Text Used in App to show: ﭖ ﭗ ﭘ ﭙ

naveed-ahmad commented 5 years ago

Each word has code_v3 attribute, you use that to render font. Each word also has class_name, that's css class. Then you need to configure font faces in css.

      "words": [
        {
          "id": 1,
          "position": 1,
          "text_madani": "بِسْمِ",
          "text_indopak": "بِسۡمِ",
          "text_simple": "بسم",
          "verse_key": "1:1",
          "class_name": "p1",
          "line_number": 2,
          "page_number": 1,
          "code": "ﭑ",
          "code_v3": "ﱁ",