07-09-2018, 09:33 AM | #1 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
about poetry
Hi
I am looking for the CSS code I could use for looong verses like the ones in the joint screenshot. Thanks for any help. |
07-09-2018, 02:27 PM | #2 |
Guru
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
I think you need to look at using "direction" -
This looks like it will get near to what you are looking for : Code:
<p class= "poem"> A bunch of the boys were whooping it up in the Malamute Saloon </p> <p class= "poem"> The kid that handled the music box was hitting a ragtime tune </p> <p class= "poem">Back of the bar, in a solo game, sat Dangerous Dan McGrew,</p> <p class= "poem">And watching his luck was his light-o'-love, the lady that's known as Lou.</p> Code:
.poem { text-align: justify; direction : rtl; text-indent: 0; } BobC |
07-09-2018, 03:43 PM | #3 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thank you Bob for your help.
This code is new for me. Up to now I though that direction was only used for some foreign languages. I'll try it. I shall very soon make some trials and report it back. I shall try also a float:right span, but this does not look very flexible... Last edited by roger64; 07-09-2018 at 04:04 PM. |
07-09-2018, 08:14 PM | #4 |
Grand Sorcerer
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
It is too bad that text-align-last: right isn't well supported.
|
07-09-2018, 09:06 PM | #5 | ||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
This sounds like yet another case for client education. Hitch |
||
07-10-2018, 01:27 AM | #6 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Hitch
You said, if I understand you well (not sure), that the "rtl" proposal from Bob is not going to work. How would you "right-align the line-wrap"? |
07-10-2018, 07:12 AM | #7 |
Guru
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
There are clearly problems with the RTL suggestion I made, however to say it wouldn't work is perhaps being a bit pedantic (that's usually my job).
I did try it out on a test document and visually it seemed to do what you had asked for. If you used a text-to-speech reader on the text it would read it "backwards", however it does appear on a printed page in the correct order. Another issue which I hinted at in my initial post was that of punctuation within a line, where a comma can appear at the start of a wrapped line rather than at the end of the previous one. Ultimately I think you need to consider how essential it is that the visual format follows exactly your source (I assume that is what you are trying to emulate), there are plenty of other ways to format a poem which can be achieved using standard formatting techniques. "text-align-last : right" may well be the correct way to do it but if readers don't support it then some sort of compromise is in order. It all depends on what you want to do with the book - just read it yourself on a known device or have it published, perhaps in other formats than epub. BobC |
07-10-2018, 09:08 AM | #8 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Bob: Perhaps I should have elaborated, but in my line of work, which is commercial formatting, I can't put forth a layout that would read backwards, no matter what, in TTS. I mean...just can't. I have other reasons for thinking that it won't work quite like expected, but that's my first and foremost objection. I'm tied up this am, but if I get a chance, I'll post in more detail. Hitch |
|
07-10-2018, 10:31 AM | #9 |
Guru
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
@Hitch,
I understand the point about commercial publishing and assumed that was where you were coming from. I now have to revise my own comments as I have just looked at the test document that I said looked fine, this time with Adobe Reader, and it doesn't work there - it simply wraps as if the RtoL wasn't there. It looked o.k in Calibre's viewer and I hadn't bothered to check it out with Adobe. What I haven't done is load the test doc onto one of my ebook readers to see what it looks like there. That's the problem with trying to be clever - unless you have total control over the viewing environment it's best to stick to simple stuff. BobC |
07-10-2018, 10:39 AM | #10 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Many times, even if you do have total control over the test environment, it's best to stick to simple stuff, LOL. I have enough eReaders to start my own damn museum and trust me, simple=good. Hitch |
|
07-11-2018, 07:25 AM | #11 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Well, this is what I decided to use.
Each verse has its own paragraph style (Chanson) and the stanza is kept within a div (space) tag. As the length of the verses is variable, I could not find a perfect solution and had to compromise. I tried this one on a six inches screen, it should possibly be better on wider ones, and dubious on smartphones. I made use of a negative indent which seems to be correctly supported for ePub and PDF. A screenshot is joined. No idea for others (hello Hitch!). Code:
p { display: block; margin-top: 0; margin-bottom: 0; border: none; padding: 0; text-indent: 1.5em; text-align: justify; widows: 2; orphans: 2; } p.Chanson { margin-left: 70%; margin-right: 0; margin-top: 0; margin-bottom: 0; border: none; padding: 0; text-indent: -65%; text-align: justify; font-style: italic; } .space { margin-top: 12px; margin-bottom: 12px; } Last edited by roger64; 07-11-2018 at 07:28 AM. |
07-11-2018, 09:09 AM | #12 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Why the px measurement for the top/bottom margins? Hitch |
|
07-11-2018, 11:30 AM | #13 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
The good news is that you dont't cough immediately about the use of a negative indent...
Why pixels? I use them usually for margins because: Quote:
Last edited by roger64; 07-11-2018 at 11:40 AM. |
|
07-11-2018, 12:24 PM | #14 | ||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
Hitch |
||
07-16-2018, 10:37 PM | #15 |
Bibliophagist
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
One issue with using px for margins is that moving between devices with different resolutions does not work very well. On an 600 pixel wide screen, 10 pixels is a lot wider than 10 pixels on a 1404 pixel wide screen. The referenced web page claim that a px is a constant 1/96 of an inch and not the same as a pixel does not seem to apply on any ereader I've used. Otherwise, I wouldn't have needed to waste the time that I have wasted changing image formatting from px to % so the amount of screen space used is relatively constant on my collection of ereaders. A 600px x 800px image is not 6.25" x 8.33" on any device I've used from a 5" Kobo Mini to a 10.5" iPad Pro.
Last edited by DNSB; 07-16-2018 at 10:51 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Poetry | roger64 | ePub | 7 | 02-11-2014 10:37 AM |
Just Poetry | newone | Self-Promotions by Authors and Publishers | 0 | 04-02-2012 01:34 PM |
Anyone for poetry? | Graham Coulson | Lounge | 1 | 10-08-2011 06:02 AM |
Got POETRY? | Dr. Drib | Writers' Corner | 36 | 04-02-2009 11:18 AM |