quran / quran.com-images

images using fonts from King Fahed Complex / qurancomplex.org
http://quran.com
390 stars 125 forks source link

How to derive the actual sura_number for sura or bismillah line types? #39

Open AlGantori opened 3 years ago

AlGantori commented 3 years ago

I am able to generate the line types for page 604 with a query like so

image

I can cross-reference the sura_number by joining the glyph_ayah table like so:

image

However, the above only works for "ayah" line types because the glyph_ids for sura and bismillah types are not in glyph_ayah table.

Did I miss something? like a glyph_sura and glyph_bismillah table :)

or is this info you never needed in this image generating project.

Any pointers would be helpful. Thank you.

murtraja commented 3 years ago

At least for Sura, you can get the respective details by: select gpl.page_number, gpl.line_number, glyph_type_meta as sura from glyph_page_line as gpl left join glyph on gpl.glyph_id = glyph.glyph_id where gpl.page_number=604 and glyph_type_meta <> 0 and line_type='sura'; image