06-02-2020, 06:25 PM | #1 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
CSS Line Height RTL Only
I want to affect the line height for the RTL text in the epub3 only. Help is appreciated.
|
06-02-2020, 08:38 PM | #2 |
A Hairy Wizard
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Use CSS and style the RTL lines with line-height.
eg. .rtltext {direction: rtl; text-align:right; line-height: 1.3em} <p class="rtltext">.addaY ,addaY ,addaY</p> |
Advert | |
|
06-03-2020, 12:18 AM | #3 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
Quote:
style.css is the sheet used. *I think I put the stuff in the wrong spot in the sheet somehow. idk, but it works now. Good times *Another edit. Seeing as how Moon+ Reader chops up each individual verse into a separate deal and how no epub reader shows anything as how it was created I seriously don't think line height is important when all epub readers change everything you make and most go out of their way to not show your styles as you created them to be shown. Last edited by d351r3d; 06-03-2020 at 04:16 AM. |
|
06-03-2020, 08:00 AM | #4 | ||
A Hairy Wizard
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Quote:
|
||
06-03-2020, 08:26 AM | #5 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
Quote:
the epub is filled with filler english. Last edited by d351r3d; 06-03-2020 at 08:30 AM. |
|
Advert | |
|
06-03-2020, 08:47 AM | #6 |
A Hairy Wizard
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I'm sorry - I'd need to see the CSS you used, and what you think is displaying incorrectly, to draw any kind of conclusion.
I saw Doitsu's response in your Sigil thread about RTL css. Is this something different? I have to admit that it has been many moons since I studied Arabic in college, but it appeared the word order was not consistent in the image in his post. Is that the issue? I attributed the word order thing to my not being familiar with different language keyboard procedures - I completely defer to Doitsu's expertise there. |
06-03-2020, 08:59 AM | #7 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
Quote:
Again this epub has filler english content. CSS Code:
@font-face { font-family: "Roboto"; font-weight: normal; font-style: normal; src: url(../Fonts/Roboto-Light.ttf); } @font-face { font-family: "AmiriQuran"; font-weight: normal; font-style: normal; src: url(../Fonts/AmiriQuran.otf); } body { font-family: 'Roboto','AmiriQuran', sans-serif; } .rtltext {direction: rtl; line-height: 3} h1 { text-align: center; } h4 { text-align: left; } p { text-align: justify; } .rtltext {direction: rtl; line-height: 3em} HTML Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <title></title> <link href="../Styles/Style0001.css" type="text/css" rel="stylesheet"/> </head> <body> <h1>Blah blah blah blah blah blah<br/> سورة البقرة </h1> <h4 id="sigil_toc_id_1">2:1</h4> <p class="rtltext"> الم </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_2">2:2</h4> <p class="rtltext"> ذَٰلِكَ الْكِتَابُ لَا رَيْبَ ۛ فِيهِ ۛ هُدًى لِّلْمُتَّقِينَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_3">2:3</h4> <p class="rtltext"> الَّذِينَ يُؤْمِنُونَ بِالْغَيْبِ وَيُقِيمُونَ الصَّلَاةَ وَمِمَّا رَزَقْنَاهُمْ يُنفِقُونَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_4">2:4</h4> <p class="rtltext"> وَالَّذِينَ يُؤْمِنُونَ بِمَا أُنزِلَ إِلَيْكَ وَمَا أُنزِلَ مِن قَبْلِكَ وَبِالْآخِرَةِ هُمْ يُوقِنُونَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_5">2:5</h4> <p class="rtltext"> أُولَٰئِكَ عَلَىٰ هُدًى مِّن رَّبِّهِمْ ۖ وَأُولَٰئِكَ هُمُ الْمُفْلِحُونَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_6">2:6</h4> <p class="rtltext"> إِنَّ الَّذِينَ كَفَرُوا سَوَاءٌ عَلَيْهِمْ أَأَنذَرْتَهُمْ أَمْ لَمْ تُنذِرْهُمْ لَا يُؤْمِنُونَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_7">2:7</h4> <p class="rtltext"> خَتَمَ اللَّهُ عَلَىٰ قُلُوبِهِمْ وَعَلَىٰ سَمْعِهِمْ ۖ وَعَلَىٰ أَبْصَارِهِمْ غِشَاوَةٌ ۖ وَلَهُمْ عَذَابٌ عَظِيمٌ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> <h4 id="sigil_toc_id_8">2:8</h4> <p class="rtltext"> وَمِنَ النَّاسِ مَن يَقُولُ آمَنَّا بِاللَّهِ وَبِالْيَوْمِ الْآخِرِ وَمَا هُم بِمُؤْمِنِينَ </p> <p>Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.</p> </body> </html> Last edited by d351r3d; 06-03-2020 at 09:03 AM. |
|
06-03-2020, 09:01 AM | #8 |
A Hairy Wizard
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Ah, sorry again - I didn't see the ebook attachment on your earlier post.
I can't speak to Lithium's fidelity, perhaps someone else is more familiar with that app. However, the line-height appears to be coded properly in your css. I've attached two images where I added a border to visualize the differences between 2 and 5 line-height and it reacts properly. .rtltext {direction: rtl; line-height: 5; border:1px solid red} What exactly is incorrect with Lithium's display? Last edited by Turtle91; 06-03-2020 at 09:03 AM. |
06-03-2020, 09:19 AM | #9 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
Quote:
Related, is the way Moon Reader handles the epub correct? Lile it opens each h1, h4 as a separate page for some reason and I can't find a way to make it not do that? |
|
06-03-2020, 09:41 AM | #10 |
A Hairy Wizard
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
In Sigil the line-height is displaying properly (see attached). Not sure why Lithium isn't??
I noticed that in your latest epub attachment (nothing 007.epub) you had a duplicate .rtltext definition in your css file. CSS rules stipulate that the last, or more recent, style definition is the one that takes priority, so changing the line-height on the first .rtltext won't change the display because the duplicate at the bottom keeps the line-height at 3. You will definitely find that some readers/apps are much better than others. I have never been impressed with moon reader, or moon+. I prefer readers that render the CSS 'properly'...especially since I clean up the CSS on every book I read. I've found that the Marvin app is very good in that regard - although I have to turn on 'Publisher's Layout' every time I open a new book. The downside to Marvin is that it is an iOS only app and hasn't been updated in a while... although there are very few things I consider needing to be updated... |
06-03-2020, 10:11 AM | #11 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2017
Device: none
|
Quote:
|
|
Tags |
css, epub 3, font formatting, line height |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
line height | Rellwood | Conversion | 3 | 04-07-2018 04:34 AM |
Line height. - preferred css settings | sunny1z | Conversion | 3 | 01-28-2013 12:43 PM |
Advice about line-height | Julien Pham | Sigil | 2 | 12-22-2011 09:05 AM |
Incorrect line-height property in calibre CSS ? | Bertrand | Calibre | 2 | 06-24-2011 04:15 PM |
changing text line-height in css | wjcroft | EPUBReader | 0 | 12-15-2010 03:13 PM |