View Single Post
Old 09-20-2014, 03:20 PM   #268
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 603
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Quote:
Originally Posted by John F View Post
That's easy for you to say.

I currently have ~50 books on the reader, so it would be a little tedious. And than if it gets fixed, I'll need to go back and take the change out?
Yes, and that is exactly why it is not a good solution.

Quote:
Originally Posted by indyglow View Post
A couple of books with no body tag in css had no cut off at all.
That should be obvious because if you define margins in the body tag you're basically saying to partially 'crop' the page, and characters will be 'cut off' if they don't fit on the page at the right page margin. This is a 'hard' margin and that's why characters are cut off.
This will definitely be case when a character whit a negative right sidebearing (RSB) is the last charcter (position) on a line.
Two examples: (1) a character with a negative RSB is the lowercase character f. (2) the lowercase character j has a negative LSB, that character will be cut off if a line starts with this character.

There are a few trick to tackle this.
1. Don't define margins in a body tag if they are not set or equal to zero (0).
2. Use padding selector instead. Consider this selector as a soft margin. Chacters witha negative left or right side bearing will be displayed in 'full' instead of being cut off.

body {margin:15px;padding:0;} (this will cut off characters)
body {margin:0;padding:15px} (this creates a 'soft margin' of 15px and prevents that some characters are cut off)

Or use something like
Code:
body{margin:0;padding:0;}
p,div {margin:0;padding-left:15px;padding-right:15px}
(the same but limited to p and div)

Or define a 'wrapper' for the page margins:
Code:
body{margin:0;padding:0;}
p,div{margin:0;padding:0;}
.pagemargins {padding-top:20px;padding-left:15px;padding-right:15px}
(CSS)

Code:
<body>
<div class="pagemargins">

... original code/markup here
</div>
</body>
Nutshell:
You have the native viewport of the device, everything outside this area will not be printed or visible.
Within the viewport there is a window or screen in which the reading app (epub, kepub engine) prints text and images. This window or screen can be shifted outside the actual viewport of the device, and characters are only partically displayed (cut off) or not at all. That is the problem were discussing here. Is there a way to reposition this window or screen to the correct position to prevent that characters are not visible or cut off.
This window or screen can be reduced in size by using various selectors, @page, margin, padding (and maybe others) to set the actual page size.
There is a distinction between hard and soft margins. Hard margins cut off characters that have either negative left or right sidebearings. To prevent this from happening use 'soft margins' instead of 'hard margins'. Especially and/or limited to, left and right margins.

Last edited by Anak; 09-21-2014 at 05:40 AM. Reason: nutshell
Anak is offline   Reply With Quote