Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-13-2017, 03:17 PM   #1
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
Converted epub displays italics incorrectly on Moon Reader

Hi all,

I have converted a PDF to an EPUB using Calibre, using the default settings. The result looks good enough for me when viewing inside Calibre.

However, when I load the EPUB into Moon+ Reader Pro, running on a Kindle Fire HD, italicised parts of the text display incorrectly, overlapping with other lines. The rest of the text looks fine.

Going into the 'edit book' option in Calibre, I can see that the italics seem to be controlled by a CSS style called 'calibre6'. I've tried fiddling with the entry for Calibre6 under the css stylesheet, but haven't managed to make any difference regarding the overlapping, overlaid text. I'm pretty much in the dark here though, and don't have a clue what i'm doing with this kind of code.

Does anyone have any suggestions for what may be going wrong? Why would something display correctly in Calibre, but incorrectly in Moon+ Reader?

I have other epubs displaying italics fine in the reader, by the way.

Thanks for any thoughts,
David
dtc87 is offline   Reply With Quote
Old 04-13-2017, 08:44 PM   #2
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by dtc87 View Post
Hi all,

I have converted a PDF to an EPUB using Calibre, using the default settings. The result looks good enough for me when viewing inside Calibre.

However, when I load the EPUB into Moon+ Reader Pro, running on a Kindle Fire HD, italicised parts of the text display incorrectly, overlapping with other lines. The rest of the text looks fine.

Going into the 'edit book' option in Calibre, I can see that the italics seem to be controlled by a CSS style called 'calibre6'. I've tried fiddling with the entry for Calibre6 under the css stylesheet, but haven't managed to make any difference regarding the overlapping, overlaid text. I'm pretty much in the dark here though, and don't have a clue what i'm doing with this kind of code.

Does anyone have any suggestions for what may be going wrong? Why would something display correctly in Calibre, but incorrectly in Moon+ Reader?

I have other epubs displaying italics fine in the reader, by the way.

Thanks for any thoughts,
David
Post the calibre6 css.
Things to try comment out font-size and line-height.
Sample of a commented out css element:
Code:
/*  font-size: 1em;*/
bernie
gbm is offline   Reply With Quote
Old 04-14-2017, 04:49 AM   #3
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
Many thanks for the suggestions - the calibre6 part of the css stylesheet doesn't seem to have those settings. Here's the whole stylesheet;

Code:
.calibre {
    display: block;
    font-size: 1em;
    padding-left: 0;
    padding-right: 0;
    margin: 0 5pt
    }
.calibre1 {
    display: block;
    margin: 1em 0
    }
.calibre2 {
    height: auto;
    width: auto
    }
.calibre3 {
    font-weight: bold
    }
.calibre4 {
    display: block
    }
.calibre5 {
    display: block;
    font-size: 1.66667em;
    font-weight: bold;
    line-height: 1.2;
    margin: 0.83em 0
    }
.calibre6 {
    font-style: italic
    }
.sigilNotInTOC {
    display: block;
    font-size: 1.29167em;
    font-weight: bold;
    line-height: 1.2;
    margin: 1em 0
    }
And here's an example of a paragraph from the text which uses the calibre6 style, resulting in mangled formatting on Moon+ Reader;

Code:
<p class="calibre1">The brother gives the products of his work (yams) for the use of his sister's husband, while the sister provides her brother's wife with the skirts and fibers of female wealth. From the point of view of the siblings'  <i class="calibre6">dala</i>, wealth returns to them by a double route: female wealth via the sister's marriage to her husband and male wealth via the brother's yam exchange with the sister's husband. The work of each sibling is thus objectified in these items. An asymmetry between female and male wealth has already been noted, the latter as Weiner stresses not carrying the regenerative overtones of the former. But the two kinds of wealth</p>
Any thoughts on what to try?
dtc87 is offline   Reply With Quote
Old 04-14-2017, 10:53 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
The Paragraph Before may have issues that cause it to overlap the following stuff. eg line-height smaller than 1.2, a negative bottom margin

BTW what is your Moon configuration settings? Moon or (mostly) User-Books stylesheet
theducks is offline   Reply With Quote
Old 04-15-2017, 08:11 AM   #5
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
Thanks for the suggestion theducks. I've tried turning the 'Disable publisher CSS' option on and off in Moon, which seems to make no difference with this epub. In fact, I've not yet managed to make any noticeable difference whatsoever in the way the epub displays in Moon reader by editing the CSS stylesheet in Calibre.

Other epubs I have in Moon do change when I tell Moon to disable the publisher CSS.

Is there any kind of setting I'm missing which will get an epub to tell the e-reader to use its embedded CSS settings, as opposed to the e-reader's ones? (I notice that an epub I recently downloaded from Google Play displays correctly by default, and then when I 'disable publisher CSS' it overlaps in the same way as the problem epub)
dtc87 is offline   Reply With Quote
Old 04-15-2017, 09:15 AM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by dtc87 View Post
Thanks for the suggestion theducks. I've tried turning the 'Disable publisher CSS' option on and off in Moon, which seems to make no difference with this epub. In fact, I've not yet managed to make any noticeable difference whatsoever in the way the epub displays in Moon reader by editing the CSS stylesheet in Calibre.

Other epubs I have in Moon do change when I tell Moon to disable the publisher CSS.

Is there any kind of setting I'm missing which will get an epub to tell the e-reader to use its embedded CSS settings, as opposed to the e-reader's ones? (I notice that an epub I recently downloaded from Google Play displays correctly by default, and then when I 'disable publisher CSS' it overlaps in the same way as the problem epub)
Try a different font in moon, next add a line-height to the base body style.

bernie
gbm is offline   Reply With Quote
Old 04-15-2017, 04:12 PM   #7
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
I've now tried different fonts in Moon, which make no difference. I've also tried embedding a font into the epub with Calibre; same overlapping. I've tried adding line-heights in all sorts of different ways to the various styles in the css, and still no difference, and i've also tried changing and getting rid of the margin settings.

I think it might be time for me to throw in the towel, thanks both for your help!
dtc87 is offline   Reply With Quote
Old 04-15-2017, 04:24 PM   #8
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
As a last ditch solution, I've just run a find and replace to eliminate all the calibre6 style tags throughout the epub. I lose the italics, but I get a readable file with no overlapping, so it's good enough.

I initially tried replacing the calibre6 tags with <em> tags, since an epub with working italics seemed to use those. But that made no difference to the overlapping.
dtc87 is offline   Reply With Quote
Old 04-15-2017, 05:43 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by dtc87 View Post
As a last ditch solution, I've just run a find and replace to eliminate all the calibre6 style tags throughout the epub. I lose the italics, but I get a readable file with no overlapping, so it's good enough.

I initially tried replacing the calibre6 tags with <em> tags, since an epub with working italics seemed to use those. But that made no difference to the overlapping.
This sounds like you have a bad italic font (metric) on your device.
theducks is offline   Reply With Quote
Old 04-26-2017, 08:11 AM   #10
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
Thanks theducks - your observation prompted me to try getting moonreader running on my android phone; the problem texts display correctly there, so the issue is definitely specific to the Kindle Fire. I'll look into trying to replace or change the font on the kindle.
dtc87 is offline   Reply With Quote
Old 04-26-2017, 11:12 AM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by dtc87 View Post
Thanks theducks - your observation prompted me to try getting moonreader running on my android phone; the problem texts display correctly there, so the issue is definitely specific to the Kindle Fire. I'll look into trying to replace or change the font on the kindle.
FWIW My K4 had embedded font problems when the font metrics do not agree with the @font metrics.
I was doing (converting from EPUB) a Dropcap with a display font with a slanted appearance, but the @font said style: normal.
I got a Straight font dropcap on the K4.
lots of fussing, and I still never did get that font to work on the K4
theducks is offline   Reply With Quote
Old 04-26-2017, 11:49 AM   #12
rashkae
Wizard
rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.
 
rashkae's Avatar
 
Posts: 1,142
Karma: 5061953
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
Out of curiosity, what happens if you try replacing the <i class="calibre6">dala</i> with
<span class="calibre6">dala</span>
rashkae is offline   Reply With Quote
Old 04-26-2017, 12:23 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by rashkae View Post
Out of curiosity, what happens if you try replacing the <i class="calibre6">dala</i> with
<span class="calibre6">dala</span>

I wonder if this is a case of 2 positives cancel?
<i> should be sufficient to get the current font-family
using a class= would be needed if other attributes (bold, underline...) to be applied . but NOT use a font-style
theducks is offline   Reply With Quote
Old 07-14-2017, 02:36 PM   #14
trying
Member
trying doesn't littertrying doesn't litter
 
Posts: 21
Karma: 104
Join Date: Oct 2013
Device: none
Second Generation Kindle Fire (2012), System Version: 10.5.1
Moon+ Reader Free 4.2.2

I ran across the same problem with "retail" epubs. Everything would be fine when viewing the epubs on my PC using the Calibre E-Book Viewer, but when using Moon+ Reader Free 4.2.2 on a Second Generation Kindle Fire (2012) italics would sometimes (but not always) overlap previous lines. When preparing this post, however, I seem to have stumbled across the cause.

I wanted to post an example epub that only contained two chapters: one that displayed the italics overlap problem and the next chapter that mysteriously did not. Originally I eliminated all the images and kept the entire chapters to create Moon+ Reader Italics Overlap Bug BIG.epub. Then I thought, well, maybe I should instead only show a few paragraphs from each so I created Moon+ Reader Italics Overlap Bug SMALLEST.epub. Much to my surprise, when I tested the SMALLEST epub the overlap problem had disappeared. Since the only thing I did was to make the offending chapter's .xhtml smaller, I wondered if the bug had to do with file sizes.

As it turned out, the chapter that displayed the bug was 22,859 bytes whereas the other good chapter was only 20,321 bytes. And the fixed chapter size was just 4,807 bytes.

So I then created Moon+ Reader Italics Overlap Bug SMALLER.epub and edited the bad chapter down until it was only 19,981 bytes. And yes indeed, the italics overlap problem went away.

When viewing epubs via Moon+ Reader Free on a Kindle Fire, it appears that italics will overlap if an .xhtml file is too big --- bigger than around 20,500 bytes or so.

I have attached all three epubs so you can test this behavior for yourselves.

Last edited by trying; 07-14-2017 at 04:06 PM.
trying is offline   Reply With Quote
Old 07-21-2017, 06:39 AM   #15
dtc87
Member
dtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texandtc87 might easily be mistaken for a Texan
 
Posts: 11
Karma: 18222
Join Date: Apr 2017
Device: Kindle Fire HD
Thanks so much for this - I'm away from home at the moment but will investigate as soon as I'm back and see whether I get the same results. Fingers crossed!
dtc87 is offline   Reply With Quote
Reply

Tags
calibre, kindle


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reader in 2.75 displays margins incorrectly on last page of chapter nabsltd Calibre 2 12-27-2016 12:11 AM
Sigil 0.9.7: mouse pointer displays incorrectly yadpes Sigil 1 11-07-2016 09:09 AM
Does Moon+ Reader support true italics kmcbest Android Devices 6 12-28-2013 08:02 AM
Kindle Previewer Displays HTML lists incorrectly when converting from EPUB Gandharva Kindle Developer's Corner 1 09-01-2011 06:52 PM
Converted ePub file displays correctly in Calibre Viewer, but not on Sony library addict Conversion 6 03-24-2011 09:58 AM


All times are GMT -4. The time now is 05:27 AM.


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