View Single Post
Old 05-31-2020, 12:07 PM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by d351r3d View Post
I was wondering how I'd be able to make just the Arabic text RTL by using CSS or some other means that would work in an epub because no one seems to have covered this exact topic or an exact solution.
The World Wide Web Consortium recommends using dedicated bidi markup to describe RTL content, where markup is available. BTW, the IDPF adopted this position, and epub books with RTL styles will fail EPUBCheck.

Since you can't assign dir="rtl" attributes to control the alignment inline tags such as <span>, you'll have to use <p> tags (or other block level tags). For example:

Code:
<h3>2:25</h3>
<p dir="rtl">وَبَشِّرِ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ أَنَّ لَهُمْ جَنَّاتٍ تَجْرِي مِن تَحْتِهَا الْأَنْهَارُ ۖ كُلَّمَا رُزِقُوا مِنْهَا مِن ثَمَرَةٍ رِّزْقًا ۙ قَالُوا هَٰذَا الَّذِي رُزِقْنَا مِن قَبْلُ ۖ وَأُتُوا بِهِ مُتَشَابِهًا ۖ وَلَهُمْ فِيهَا أَزْوَاجٌ مُّطَهَّرَةٌ ۖ وَهُمْ فِيهَا خَالِدُونَ</p>
<p>And give good tidings to those who believe and do righteous deeds that they will have gardens [in Paradise] beneath which rivers flow. Whenever they are provided with a provision of fruit therefrom, they will say, "This is what we were provided with before." And it is given to them in likeness. And they will have therein purified spouses, and they will abide therein eternally.</p>
I'd also recommend using h1..h6 tags for the surah numbers. This'll simplify generating the TOC once you're done with the Qur'an.

Note also that very few epub3 readers/apps actually support RTL text. (AFAIK, there's isn't a single epub2 app that supports RTL text.)

I.e., you might want to create an epub3 book or convert your book to an epub3 book once you're done.
Attached Thumbnails
Click image for larger version

Name:	rtl.PNG
Views:	782
Size:	35.3 KB
ID:	179618  

Last edited by Doitsu; 05-31-2020 at 01:03 PM. Reason: Deleted claim that span tags can't have dir attributes
Doitsu is offline   Reply With Quote