12-13-2014, 07:52 AM | #1 |
Connoisseur
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
|
[not perfect]CSS solution for words cut-off in kepub full screen reading
Hi guys, I find if the margin of whole text (body) in CSS is set to 0 like this:
Code:
margin: 0 0 0 0 To modify CSS, the body code section must be known, like this: Code:
<body class="calibre"> </body> Code:
.calibre {
display: block;
font-size: 1em;
padding-left: 0;
padding-right: 0;
text-align: justify;
margin: 0 0 0 0
}
this can be done when kepub is converted by Calibre. it needs to change output setting to prevent Calibre add itself margin. The setting is in Page Setup and you need to set the four margins to zero. Then you can do the conversation. "f" and "j" issues have been solvedin post #13 Last edited by scoky; 12-14-2014 at 07:04 AM. Reason: "f" and "j" issues have been solvedin post #13 |
12-13-2014, 01:44 PM | #2 |
Dead account. Bye
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
I think that is not the solution.
I mean I've just suffered the issue once but just going to another book or changing the GUI settings (font size, margins) "fixed" the issue. I don't exactly remember. What I'm trying to say is that AFAIK the layout going FUBAR is not a fully replicable, constant issue. So it just "fixes" itself. Probably you've just sent a "new" book and then it has been fixed no matter the margin o no margin setting. Nevertheless maybe I'm wrong and you do have a fully replicable test eBook. In that case it would be great if you could post it (if its copyright allows it), or nevertheless I would like to test it in any case so you could PM me a download link (I promise I will delete it afterwards). |
Advert | |
|
12-14-2014, 12:00 AM | #3 | |
Connoisseur
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
|
Quote:
Actually, I find the words cut-off issue in kepub full screen reading mode is caused by non-zero margin setting in CSS which may be original or modified by Calibre. So manual modification or using Calibre can set margin to zero. Attachments are a free book from Project Gutenberg. This first one is original and I change its extension name to .kepub.epub to use access render. The second is converted to kepub by Calibre and its Margin settings in Page Setup of Calibre are all set to zero. Last edited by scoky; 12-14-2014 at 04:26 AM. Reason: rename kepubs' name |
|
12-14-2014, 03:22 AM | #4 |
Dead account. Bye
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
Wow, you are right. The issue is fully replicable.
I've just downloaded your first version (as epub) and when uploaded to my H2O through KoboTouch Extended driver (I mean with an automatic conversion to kepub) the rendering is absolutely FUBAR. I'll try to narrow the issue down... Because I swear you that I've got books without any margin setting in body (because I ALWAYS explicitly delete them) which perfectly work. Side comment: Do not convert into kepub by just changing the file extension. Kepubs have a lot of <span>s in them which are needed by the annotation system and I don't know if other modifications are also made... |
12-14-2014, 04:02 AM | #5 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
There are other things done, but for these sort of tests, they are not going to affect anything. And, Kobo actually tell authors/book creators to do this as a way of checking the book looks OK on the devices.
|
Advert | |
|
12-14-2014, 04:07 AM | #6 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
This is interesting, the body margin does seem to affect the magnitude of the full-screen cut-off.
But both of the books still suffer from the cut-off problem, although the second one (first screenshot) is much worse than the first. (In the screenshots in post #1 you can see the 'f' on line 8 is cut off in the second screenshot.) Last edited by GeoffR; 12-14-2014 at 04:10 AM. Reason: second book, first screenshot |
12-14-2014, 04:19 AM | #7 | |
Connoisseur
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
|
Quote:
You can test the two books in post #3. |
|
12-14-2014, 04:22 AM | #8 | |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
(It is not so easy to see with a sans-serif font, much more noticable with serifs.) |
|
12-14-2014, 04:24 AM | #9 | |
Dead account. Bye
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
Quote:
|
|
12-14-2014, 04:34 AM | #10 | |
Connoisseur
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
|
Quote:
Last edited by scoky; 12-14-2014 at 04:39 AM. Reason: "f" issue exists. |
|
12-14-2014, 04:37 AM | #11 | |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
|
|
12-14-2014, 04:39 AM | #12 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Have a look a the 'f' character at the end of line 8 in your screenshots and compare it to other 'f' characters. The one at the end of the line is cut off at the right.
|
12-14-2014, 07:03 AM | #13 |
Connoisseur
Posts: 62
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
|
Continue...
I find in .css there are two section to control the real margin. The first one is mentioned above, it is body section to control whole margin and it is better to set to zero. The second is the detail text section in paragraph, it is better to set to a very small value. To process CSS like this, the "f" and "j" issue will be disappeared. Example: this code is in html of kepub Code:
<body> <p> </p> </body> However, I don't find any setting in Calibre can modified this automatically. |
12-14-2014, 07:38 AM | #14 | |
Fanatic
Posts: 598
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
|
Quote:
Code:
<style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } </style> <style type="text/css"> div#book-inner p, div#book-inner div { font-size: 1.0em; } a { color: black; } a:link, a:visited, a:hover, a:active { color: blue; } div#book-inner * { margin-top: 0 !important; margin-bottom: 0 !important;} </style></head> The trick here is to add a "soft" margin. The margin property creates hard margins. The padding property creates (for this purpose) "soft" margins and prevents that characters with a negative side bearing are cut off. In the example below I add a "soft" margin of 2% to the wrapper (divider) only because it is intended as a page margin only and should not affect individual (child) properties. It will probably work with much smaller values (like 1% or 0.10em). But the (average) width of a negative side bearing varies from font to font. And if set too low it might not work for all fonts. I add soft margins to the wrapper (divider only) by Code:
div#book-inner p, div#book-inner div { font-size: 1.0em;padding-left:2%;padding-right:2%;} Code:
<style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } </style> <style type="text/css"> div#book-inner p, div#book-inner div { font-size: 1.0em; padding-left:2%;padding-right:2%; } a { color: black; } a:link, a:visited, a:hover, a:active { color: blue; } div#book-inner * { margin-top: 0 !important; margin-bottom: 0 !important;} </style></head> Code:
<body> <div id="book-columns"> <div id="book-inner"> …… </div> </div> </body> Code:
<style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } </style> <style type="text/css"> div#book-columns div { padding-left:2%;padding-right:2%; } div#book-inner p, div#book-inner div { font-size: 1.0em; } a { color: black; } a:link, a:visited, a:hover, a:active { color: blue; } div#book-inner * { margin-top: 0 !important; margin-bottom: 0 !important;} </style> If you use the wrapper principle for your home made kepubs (or epubs) it will work out fine but then you should avoid defining unnecessary left and right margins in the CSS of the book (read: use set default margins to 0 as the page wrapper adds the left and right margin). Last edited by Anak; 12-14-2014 at 07:46 AM. |
|
12-14-2014, 07:52 AM | #15 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
It would be good to have a solution that can be automatically applied to sideloaded kepubs. If sideloaded kepubs work better than kobo-bought kepubs then that might give Kobo some extra incentive to fix the bug.
(BTW this does only happen with kepubs in the experimental full-screen mode right? I've never seen it happen with epubs or with kepubs in normal mode.) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Letters of some words are cut off on the right hand side of Calibre screen | innogen | Calibre | 1 | 12-02-2012 10:10 PM |
Kindle 4NT Full-Screen PDF Reading(HELP) | CapitainDerya | Kindle Developer's Corner | 2 | 09-25-2012 03:45 PM |
Possible solution for full screen images | erez213 | Kindle Developer's Corner | 242 | 06-20-2012 11:15 AM |
THE full screen reading | irukandji | Kindle Developer's Corner | 5 | 08-08-2011 10:21 PM |
Gen3 Words "falling off" the screen / sentences cut off (mobipocket) | Spektakel | Bookeen | 6 | 04-17-2010 11:26 PM |