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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2011, 03:39 PM   #1
marekl
Member
marekl doesn't littermarekl doesn't litter
 
Posts: 11
Karma: 176
Join Date: Jan 2011
Device: Kindle/iPad
HTML-EPUB: no justified alignment in iPad (iBooks)

Update: Please ignore the question. It was my own mistake, I overlooked the Full Justification item in iBooks settings. I'm sorry.

---------

I spent hours yet and I still haven't found solution of this justify issue:

I prepared very simple text in HTML and I want to have the common paragraphs <p> justified. So I made a CSS file with:

Code:
p {text-align: justify; text-indent: 1.1em; }
I linked the style file to Calibre terminal command (--extra-css=styles.css). It is really linked, because I see the indents in iPad iBooks viewer - but I see no justification.

Well, iBooks probably isn't able to justify text. No, it is. When I add simple <b> tag to some paragraphs to make them bold, they appear bold... and justified. Please look at picture attached. There is also HTML code which was used as source for the EPUB in the second picture - just very simple, nothing complicated.

What am I missing? Why the basic text has only left alignment and after I add bold, it will justify?

Thank you
Attached Thumbnails
Click image for larger version

Name:	justify.PNG
Views:	163
Size:	203.0 KB
ID:	65234   Click image for larger version

Name:	Screen shot 2011-01-21 at 21.36.59.png
Views:	131
Size:	75.3 KB
ID:	65235  

Last edited by marekl; 01-21-2011 at 04:39 PM.
marekl is offline   Reply With Quote
Old 01-21-2011, 03:45 PM   #2
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I only know basic HTML, but when I look at the markup, it's identical for the bold and normal paragraphs apart from the bold tags. Might this be an iBooks issue? How does the text render in other viewing programs, like the Calibre reader? What does the actual XHTML in the ePub look like for those paragraphs?
Manichean is offline   Reply With Quote
 
Enthusiast
Old 01-21-2011, 03:55 PM   #3
marekl
Member
marekl doesn't littermarekl doesn't litter
 
Posts: 11
Karma: 176
Join Date: Jan 2011
Device: Kindle/iPad
This is funny: If I use code text-align: right in the CSS file, all paragraphs in iBooks are correctly aligned to the right. :-)

I see all paragraphs justified in Calibre viewer.

Here is the Calibre command I use for conversion:

/usr/bin/ebook-convert aaa.html aaa.epub --output-profile=ipad --input-encoding=utf-8 --disable-font-rescaling --extra-css=styles.css --chapter="//h:h1" --chapter-mark=pagebreak --page-breaks-before="//h:h1" --author-sort="Me" --authors="Me" --comments="no comment" --language=CS --pubdate="2011 01 21" --publisher="me" --title="aaa 11" -v -v -v

The EPUB result is attached to the reply.
Attached Files
File Type: epub aaa11.epub (87.7 KB, 72 views)

Last edited by marekl; 01-21-2011 at 04:01 PM.
marekl is offline   Reply With Quote
Old 01-21-2011, 04:16 PM   #4
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Here's a snippet of text from the ePub:
Code:
<p class="calibre3">Nulla viverra viverra odio, ut euismod arcu ultrices ut. Sed laoreet blandit turpis quis dictum. Donec rutrum tellus at nulla aliquet feugiat consectetur sem suscipit. Suspendisse non turpis mauris.</p>

<h2 class="calibre4">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h2>
The relevant CSS parts are:
Code:
.calibre3 {
    display: block;
    font-weight: normal;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1em;
    text-align: justify;
    text-indent: 1.1em
    }
.calibre4 {
    display: block;
    font-family: sans-serif;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 0.83em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.83em;
    text-align: left
    }
I notice that the bold style (calibre4) is set to align left, whereas the "normal" style (calibre3) is set to justify. Also, I note that Calibre seems to have interpreted the bold parts from the original source as being headings, which might explain the different CSS.
However, I don't know why this is so. I'd suggest you wait for someone more knowledgeable to show up.
Manichean is offline   Reply With Quote
Old 01-21-2011, 04:24 PM   #5
marekl
Member
marekl doesn't littermarekl doesn't litter
 
Posts: 11
Karma: 176
Join Date: Jan 2011
Device: Kindle/iPad
Hi, the .calibre4 style is used for H2 headings. The base text paragraph with bold looks like this in EPUB:

<p class="calibre3"><b class="calibre6">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas est odio, consequat vel pretium id, vestibulum eu quam. Maecenas sed risus purus, ac blandit nisi. Aenean a tellus nisl, ullamcorper condimentum lorem. Curabitur pellentesque varius sem, at fermentum libero semper vitae.</b></p>

And the styles definitions are:

.calibre3 {
display: block;
font-weight: normal;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: justify;
text-indent: 1.1em
}

.calibre6 {
font-weight: bolder
}

Last edited by marekl; 01-21-2011 at 04:27 PM.
marekl is offline   Reply With Quote
Old 01-21-2011, 04:37 PM   #6
marekl
Member
marekl doesn't littermarekl doesn't litter
 
Posts: 11
Karma: 176
Join Date: Jan 2011
Device: Kindle/iPad
I'm very sorry to disturbing you with this question. It was my own stupid mistake. There is "Full Justification" item in iBooks settings and it was switched off
marekl is offline   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
iPad iBooks epub on Nook? yanathin ePub 3 08-15-2010 05:41 AM
iPad iPad epub reader that isn't iBooks? frameset Apple Devices 4 05-12-2010 08:57 PM
Text wrap in epub for ipad iBooks dblatner ePub 3 04-24-2010 06:16 PM
Jobs confirms DRM free epub books can be loaded and read via iBooks on iPad stustaff News 14 03-25-2010 09:24 AM
calibre: HTML to LRF conversion, problem with justified text Juggle4Evr Sony Reader 6 07-12-2009 07:19 PM


All times are GMT -4. The time now is 06:56 AM.


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