03-13-2015, 11:18 AM | #1 |
Member
Posts: 86
Karma: 12586
Join Date: Nov 2012
Device: Ipad and Kindle Fire
|
Formatting Arabic text to read right to left
I have seen some where posts where this is accomplished by adding to the CSS stylesheet something like:
p.arabic { } direction:rtl; } The trouble is when I try to validate the file, I get the error message : The 'direction' property must not be included in an EPUB Style Sheet. I am unable to put dir="rtl" in the body tag of the html pages, as I have mixed English and Arabic paras in each document. Could anyone help me with this? |
03-13-2015, 12:39 PM | #2 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
What device do you intend to read your books on? It's worth noting that Adobe Digital Editions, which forms the basis of the ePub renderer found in the majority of eInk readers, does not currently support right-to-left languages such as Arabic and Hebrew.
|
Advert | |
|
03-13-2015, 12:54 PM | #3 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
dir="rtl" or dir="ltr" is the correct form of telling the device of the text direction in an EPUB3. In EPUB2 you should use CSS rule "direction:rtl;".
You should use the dir="rtl" attribute if the majority of the text on that page is in Arabic, for all the English paragraphs you add dir="ltr". e.g. PHP Code:
|
03-13-2015, 12:56 PM | #4 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
|
03-13-2015, 02:10 PM | #5 |
Member
Posts: 86
Karma: 12586
Join Date: Nov 2012
Device: Ipad and Kindle Fire
|
Thank you very much, Odedta. I am using EPUB 3. I was trying to add the direction rule to the stylesheet, but it looks as though I should add it to the html. The majority of the text is in English, so I should add dir="rtl" to all the Arabic paragraphs and add dir="ltr" to the <html... at the top as you have shown. And forget about the stylesheet. This is what I needed to know, thanks.
[QUOTE=odedta;3063758]dir="rtl" or dir="ltr" is the correct form of telling the device of the text direction in an EPUB3. In EPUB2 you should use CSS rule "direction:rtl;". You should use the dir="rtl" attribute if the majority of the text on that page is in Arabic, for all the English paragraphs you add dir="ltr". e.g. [PHP]<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" lang="ar" xml:lang="ar"> Last edited by verydeepwater; 03-13-2015 at 02:12 PM. |
Advert | |
|
03-13-2015, 02:12 PM | #6 |
Member
Posts: 86
Karma: 12586
Join Date: Nov 2012
Device: Ipad and Kindle Fire
|
|
03-13-2015, 02:30 PM | #7 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
I'm afraid there's no way around it. ADE doesn't support RTL languages at all. The Kindle, however, does (at least in its more recent "KF8" file format).
|
03-13-2015, 04:24 PM | #8 |
Member
Posts: 86
Karma: 12586
Join Date: Nov 2012
Device: Ipad and Kindle Fire
|
So it will work at least on Apple products, probably most kobo devices and kindles with KF8. not bad
|
03-13-2015, 05:08 PM | #9 |
Grand Sorcerer
Posts: 12,632
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Um.. maybe Kobo devices using kEpub format...
|
03-13-2015, 05:12 PM | #10 | |
Grand Sorcerer
Posts: 12,632
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Addiotionaly from https://github.com/kobolabs/epub-spec
Quote:
|
|
03-14-2015, 08:46 AM | #11 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Works on Kindle (KF8), iBooks, Android, Readium, Calibre.
Support for EPUB3 will only increase in the future so I think it's good that you're aiming for an EPUB3. |
03-14-2015, 09:25 AM | #12 |
Resident Curmudgeon
Posts: 76,008
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Gitden Reader supports ePub 3 and it will run on your iPad as long as it's not a 1st gen iPad.
https://itunes.apple.com/us/app/gitd...524939666?mt=8 |
Tags |
arabic script, direction in css, text direction |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting an eBook - Left justify or Justified | simonroyle | General Discussions | 145 | 07-06-2020 07:38 PM |
Arabic displayed from left to right in web browsers | Heba | Amazon Kindle | 6 | 02-03-2015 01:53 AM |
Problem with Arabic (Right-To-Left Language) | titani | Calibre | 1 | 08-21-2014 01:31 PM |
Text formatting issues when creating IDs/hyperlinking text | rnuss | Sigil | 2 | 09-28-2013 06:49 AM |
Formatting arabic text | majidkadi | Sigil | 4 | 06-24-2013 12:01 PM |