Closed imranbaig1977 closed 8 years ago
there are two ways of writing arabic text - "imlaei" (the way Arabic is written today in books, newspapers, etc), and "uthmani" (the handwritten script drawn specifically for the Quran). when you load quran.com, before the fonts load, you see the imlaei text, and once the fonts are loaded, you get the uthmani image:
before the font load:
after the font load:
the key here is the font - this font is a hand drawn font from the Quran Complex in Saudi Arabia, where each word has a glyph (as opposed to the standard "each letter is a glyph").
in summary, you get two pieces of data from the api:
arabic
- the imlaei arabic text - this has harakat, but for something like "الم", it doesn't show the "madd" because there's no "madd" tashkeel in today's written Arabic.
code
- that's what's used to draw the word using the uthmani font for that page (from the page 2 font in that case). see quran/quran.com-images for the fonts and how we generate images from these if you are curious as to how they work.
closing for now, please feel free to reopen if there's something else to expound on.
Jazak Allah Khair for your help. However, I could not find the relationship between code property ( inside the words JSON array) and the appearance of الم. I do understand code contains unicode fb51 ( ﭑ ) how does that unicode draws https://quran.com/2:1 الٓـمّٓ. Your help would enable me to complete my Quranic App.
the uthmani font is not a letter by letter font - it's a letter to word font. in other words, each letter pressed (fb51, or, easier, an ! in ascii range would work too), maps to a single word drawn as one piece - not to the letter alif, followed by the letter lam, followed by the letter meem (as would happen in standard imlaei writing). in other words, you can't split up the words.
i've attached two screenshots that might help explain.
this shows each character slot and what it contains:
and this shows the fb5a / ! and what it maps to:
in an ideal world, you'd be able to have an uthmani font representing the entire Quran, so that you could do the same things as you could with a normal font. my guess is that they didn't do this because the same word on two separate pages may be drawn slightly different (because it's hand drawn). there are some people who put together actual uthmani fonts that work the way you'd expect (the me_quran font is one of the more popular ones), but i haven't found one that looks nearly as good as these do.
Jazzak Allah Khair, I am using your ttf files and using typeface per word.
I have been experimenting with following GET request. https://quran.com/api/v2/surahs/2/ayahs?from=1&to=1&audio=8&content%5B%5D=53&quran=1
It results into first ayah surah Bakra.
I need to know how to get الم with All HARAKAT. On website https://quran.com/2:1 Alif Laam Meen appears with Madh but in the api response it comes back without HARAKAT.