View Single Post
Old 05-08-2013, 04:41 PM   #54
buffaloseven
Watching the Sky
buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.buffaloseven ought to be getting tired of karma fortunes by now.
 
buffaloseven's Avatar
 
Posts: 239
Karma: 634112
Join Date: Sep 2012
Location: Winnipeg, MB
Device: Kobo Aura
Quote:
Originally Posted by Anak View Post
I think I've found the solution.
There are "two" kepub versions
1. The "old version", where the kobo.css (/*VERSION:1*/) contains code, and causes the mentioned problems
2. The "new version", where the kobo.css is just an empty file, and doesn't have the mentioned problems.

At some point in 2012 Kobo made some changes to the kepub html code to improve the text lay out.
Kobo should have patched all existing kepubs by replacing the kobo.css with an empty one.

The old kobo.css
Code:

html {
height: 100% !important;
margin: 0 !important;
}
img {
max-width: 100%;
max-height: 100%;
overflow: none;
}
body {
font-size: 14pt;
line-height: 1.575em !important;
font-family: 'Georgia' !important;
margin: 0 !important;
height: 100% !important;
overflow-wrap: break-word !important;
}
.KBHeading, h1 {
margin-top: 0 !important;
display: block !important;
text-align: center !important;
font-family: 'Georgia' !important;
font-size: 1.33em !important;
text-transform: uppercase !important;
letter-spacing: 0.1em !important;
}
.KBSubheading, h2 {
margin-top: 0 !important;
display: block !important;
text-align: center !important;
font-family: 'Georgia' !important;
font-size: 1.25em !important;
}
.KBSubsubheading, h3, h4, h5, h6 {
margin-top: 0 !important;
font-size: 1em !important;
font-family: 'Georgia' !important;
font-weight: bold !important;
}
a:link {
color: #1DAEC7 !important;
}
a:visited {
color: #1DAEC7 !important;
}
a:hover {
color: #1DAEC7 !important;
}
a:active {
color: #1DAEC7 !important;
}
p, div {
font-size: 14pt;
line-height: 1.475em !important;
text-indent: 0 !important;
margin: 0 !important;
padding-top: 0 !important;
padding-bottom: 1.0em !important;
text-align: left !important;
}
.KBIcon {
padding-top: 0 !important;
}
.KBFooter {
position: static !important;
margin-left: auto !important;
padding-top: 10% !important;
}
Blank lines
Code:
padding-bottom: 1.0em !important;
to
padding-bottom: 0 !important;
Solves the unwanted blank lines between sentences or paragraphs.

Text alignment to center text
However, fooling around with text alignment settings in the kobo.css didn't solve the bug that text that should be displayed as centered was actually displayed as aligned to the left.
But when all code in de kobo.css was deleted or replaced by an empty one the text alignment issue was solved.

1. Kepub preview, released May 2013 (no issues, "new kepub")
2. Kepub preview, released September 2012 ("old kepub")
If the images are in a p or a div, the
Code:
margin: 0 !important;
listed in the CSS file may be overriding the centering if they're relying on an image of specific width in a div having
Code:
margin: 0 auto;
to center it.
buffaloseven is offline   Reply With Quote