quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
998 stars 361 forks source link

Cannot copy and paste verses #982

Closed Khaleel closed 6 years ago

Khaleel commented 6 years ago

I'm submitting a ...

Current behavior:

Selecting a verse with the cursor should be able to copy and paste Expected / new behavior:

For issue, please provide steps to reproduce it:

Visit this URL: Try to copy this: رَّبِّ ارْحَمْهُمَا كَمَا رَبَّيَانِي صَغِيرًا

Then paste, you will get this: ﯚ ﯛ ﯜ ﯝ ﯞ

Anything else:

popo63301 commented 6 years ago

This is caused by the fact that quran.com uses a specific font to render each word with the right calligraphy. For example, if there is a surah with 26 words, each letter of of your keyboard (or an urdu keyboard): q, w, e, r, t, etc, will be associated with a specific word. Wakhfid: ﯓ lahuma: ﯔ janahaaththulli: ﯕ mina: ﯖ

So when you copy a verse, you get letters of your keyboard, because what you see (the calligraphy for each word) is different from what it is in reality (just a letter). This is the trick used by quran.com to render beautiful calligraphy for each word of the Quran. However, I don't know if handling the clipboard is planned.

Have a look to this folder: https://github.com/quran/quran.com-frontend/tree/master/src/styles/fonts/ttf

naveed-ahmad commented 6 years ago

We've copy button beside each ayah. Click on it and ayah will be copied in your clipboard.