Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2017, 05:25 PM   #1
dougfetch2
Junior Member
dougfetch2 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: none
Forced line breaks and full justify

I've got this project that involves a poem with specific formatting. The lines need forced line breaks but also full justification. I searched a bunch on google and found various tricks that all fail to pan out when tried in the ePub.

Such as

https://stackoverflow.com/questions/...rows-in-a-poem
https://stackoverflow.com/questions/...text-using-css

The best solution did the breaks and the full justify (the second link) however when a long paragraph of text went from one page to the next the reader cut the lines off weird (top few pixels of a line at the and of the page and the rest of the pixels on the next page) -- I think due to the line-height confusing the reader (iBooks).

Any tricks for accomplishing forced line breaks and full justification?
- Doug
dougfetch2 is offline   Reply With Quote
Advert
Old 07-25-2017, 06:42 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,126
Karma: 43266947
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
I don't think you can do it.
JSWolf is online now   Reply With Quote
Old 07-25-2017, 11:44 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,521
Karma: 11627112
Join Date: Dec 2012
Location: Altus, Oklahoma today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
Welcome to MR dougfetch2!

Formatting poetry properly is one of the more difficult, if not impossible, challenges in a reflowable format such as ePub. There should be easy css properties to do what you want, but apparently the demand isn't high enough for the IDPF (the ePub standards people) to require them.

There are multiple threads on here that discuss formatting poetry, but the basic answer is for the author to accept that some of the more esoteric shapes/designs cannot be done in reflowable ePub. If it is essential to have a specific shape, then sometimes inserting an image of the poem is the easiest option. The other option (not for the novice or faint of heart) is to do a fixed format ePub.

For your specific question of line breaks and justified alignment: I can only recommend <br /> and text-align:justify and perhaps setting a <div> with a specific width (and perhaps a monospace/fixed-width font). The page-break-inside, orphans, and widows settings MIGHT help prevent breaking over a page, but it sounds like iBooks has a bug - what a shock...

Code:
CSS
div.poem   {width:410px; margin:2em; page-break-inside:avoid}
div.poem p {font-size:.8em; text-indent:0; text-align:justify; orphans:0; widows:0}

<div class="poem">
     <p>
     Bacon ipsum dolor amet andouille<br />
     meatloaf rump meatball, shank ribeye<br />
     jowl turkey swine. Drumstick tri-tip<br />
     brisket, cupim tongue andouille chuck<br />
     spare ribs. Bresaola cow drumstick,<br />
     tail boudin ground round sausage<br />
     kielbasa prosciutto turkey andouille<br />
     jowl spare ribs. Short ribs brisket.
     </p>
</div>
The div width could be set to a value that just covers the longest line???

Sorry I don't have more help for you - hopefully one of our poetry formatting gurus has some better advice!

Cheers
Turtle91 is offline   Reply With Quote
Old 07-29-2017, 06:21 PM   #4
dougfetch2
Junior Member
dougfetch2 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: none
Thanks for the thoughts. I tried the suggestion and the iBook won't full justify it. Evil iBooks.
dougfetch2 is offline   Reply With Quote
Old 07-29-2017, 06:36 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,126
Karma: 43266947
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
It can't be done.
JSWolf is online now   Reply With Quote
Advert
Old 07-30-2017, 07:54 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 82,056
Karma: 76749331
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by dougfetch2 View Post
Thanks for the thoughts. I tried the suggestion and the iBook won't full justify it. Evil iBooks.
Actually, iBooks is pretty much the best ePub 3 renderer around. Blame the standard, not iBooks.

Poetry is one of the very few things I'd suggest investigating the possibility of using PDF for. A nice PDF with pages properly sized for eInk devices can be very good for this kind of thing.
HarryT is offline   Reply With Quote
Old 07-30-2017, 05:27 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,126
Karma: 43266947
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by HarryT View Post
Actually, iBooks is pretty much the best ePub 3 renderer around. Blame the standard, not iBooks.

Poetry is one of the very few things I'd suggest investigating the possibility of using PDF for. A nice PDF with pages properly sized for eInk devices can be very good for this kind of thing.
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
JSWolf is online now   Reply With Quote
Old 07-30-2017, 06:22 PM   #8
j.p.s
Wizard
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 1,117
Karma: 8285238
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by JSWolf View Post
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
Since the lines are fixed length, they either will be readable on a 5" screen, or they won't.

Once a minimum readable size is found, size the PDF page for that. On larger devices, zoom to fit if it's not automatic. For smaller devices, try portrait.
j.p.s is online now   Reply With Quote
Old 07-31-2017, 07:30 AM   #9
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,102
Karma: 480516
Join Date: Dec 2012
Device: Kindle
For my sins, I was once sent the PDF of a book I need for a book review. It was laid out two pages of book on a PDF page. To have the type large enough to read on my 7-inch Fire tablet, I had to do a lot of moving the pages around. It wasn't fun, but it was doable, and I got the job done.

I don't think a single book-sized page would pose much of a problem. At worst, I could read in landscape mode, which would require such one thumb-sweep to read a page.
Notjohn is offline   Reply With Quote
Old 07-31-2017, 11:59 AM   #10
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 10,771
Karma: 11200002
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2
Quote:
Originally Posted by j.p.s View Post
Since the lines are fixed length, they either will be readable on a 5" screen, or they won't.

Once a minimum readable size is found, size the PDF page for that. On larger devices, zoom to fit if it's not automatic. For smaller devices, try portrait.
I think you mean try landscape.

Dale
DaleDe is offline   Reply With Quote
Old 07-31-2017, 12:09 PM   #11
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 82,056
Karma: 76749331
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by JSWolf View Post
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
You could cover the bases pretty well by producing two versions: one optimized for a 6" screen and the other for a 9.7" screen. Larger devices would simply display the page a little bigger.

I'm not claiming that it's a perfect solution, but it may perhaps be the best available. ePub just isn't up to the job of formatting poetry. If you have any better ideas, please do put them forward.

Last edited by HarryT; 07-31-2017 at 12:13 PM.
HarryT is offline   Reply With Quote
Old 07-31-2017, 01:12 PM   #12
j.p.s
Wizard
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 1,117
Karma: 8285238
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by DaleDe View Post
I think you mean try landscape.

Dale
Yep. Sorry.
j.p.s is online now   Reply With Quote
Old 07-31-2017, 01:16 PM   #13
j.p.s
Wizard
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 1,117
Karma: 8285238
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by HarryT View Post
ePub just isn't up to the job of formatting poetry.
Just curious. Does epub ignore the PRE tag?
j.p.s is online now   Reply With Quote
Old 07-31-2017, 01:42 PM   #14
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 82,056
Karma: 76749331
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by j.p.s View Post
Just curious. Does epub ignore the PRE tag?
No, it should work, but isn't it really only useful with a monospaced font? The place I've seen it used most often is with monospaced code samples in books.
HarryT is offline   Reply With Quote
Old 07-31-2017, 01:58 PM   #15
j.p.s
Wizard
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 1,117
Karma: 8285238
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by HarryT View Post
No, it should work, but isn't it really only useful with a monospaced font? The place I've seen it used most often is with monospaced code samples in books.
I forgot that aspect of it. I guess all the solutions to the epub poetry problem are a compromise.

I live in a 7 bit ASCII monospace font world, so I would see that as the least compromise.

Maybe some embedded font trickery combined with use of PRE would do the job.
j.p.s is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Line breaks on Kindle, no line breaks on 4 PC Siavahda Kindle Formats 0 10-20-2012 06:50 AM
Line breaks with no style therealjoeblow Conversion 5 11-02-2011 12:51 AM
Spurious Line Breaks Halk Workshop 1 05-15-2010 02:22 PM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 07:42 PM
Getting rid of line breaks with Bookdesigner Ned Workshop 16 11-01-2008 06:37 PM


All times are GMT -4. The time now is 04:45 PM.


MobileRead.com is a privately owned, operated and funded community.