Thread: Kobo Patcher
View Single Post
Old 08-28-2013, 06:13 AM   #100
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 dmapr View Post
Yes, it does say top & left. Maybe I should stop trying to post on the run Thanks for catching it!
Quote:
Originally Posted by ectoplasm View Post
As Anak commented, I'm not clear on what the "Margins fine tuning" values represent. Does anyone know what these do?

Code:
# Left margin
replace_int = 848E86, 0, 10
# Top margin
replace_int = 848E88, 0, 10
Yes, it does change the start coordinate of the viewport. It does not alter the size of the viewport itself. So it only shifts the viewport to the right and down.

For regular epub de default viewport staring point (x,y) is (0,n)
where n = default height top margin. I don't now the exact number but on a Touch my guess is about 10 to 20px.

There is no need to change the left margin as the viewport already starts at the first pixel: utilizing the full width (resolution) of the screen.
This is not so for the vertical height of the screen. This n-height top margin can not be reduced this way.
Code:
<Patch>
patch_name = `Margins fine tuning`
patch_enable = `yes`
# Initial replaces
replace_bytes = 848E86, 19 46, 00 21
replace_bytes = 848E88, 1A 46, 00 22
# Values for replace
# Left margin
replace_int = 848E86, 0, 44
# Top margin
replace_int = 848E88, 0, 40
</Patch>
Code:
<Patch>
patch_name = `Margins fine tuning`
patch_enable = `yes`
# Initial replaces
replace_bytes = 848E86, 19 46, 00 21
replace_bytes = 848E88, 1A 46, 00 22
# Values for replace
# Left margin
replace_int = 848E86, 0, 00
# Top margin
replace_int = 848E88, 0, 00
</Patch>
The book CSS contains this to remove all margins:
Code:
@page {margin:0;}
body {margin:0;}
p {margin:0;padding:0;}

See attached images.
An increased left margin shifts all text to the right and "pushes" part of the text that is located originally on the right hand side of the screen outside the screen demensions. Some words or part of words are not readable any more. Which can be seen in the attached images.

I don't now if it is possible to adjust the size viewport too when adjusting the start coordinate of the viewport.

Touch: screen resolution is 800×600 px
Default viewport width: 600 px (uses full screen width; no left or right margins)
Default viewport heigth: 800 px -/- n height of the top margin (hard coded top margin)
Assumption here: n height = 10 px
That makes the default viewport is 790 (800-/-10) × 600 px

When adjusting the start coordinate of the viewport to, lets say
left: 20
top: 30

The viewport size should be adjusted to 760 × 580 px (height: 790-/-30;width: 600 -/-20) to keep all text on the screen. But this creates uneven left and right page margins (only shifts the viewport). To create even left and right margins the viewport width should be adjusted 2*left margin settings (here: 2*20=40px) to 560 px.
But what I would like is to reduce the hard coded top margin completly. So I can read books full screen (for Touch: 800×600) and when I do need/like some page margins I can adjust them in the book CSS itself (where it should be).
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	529
Size:	42.8 KB
ID:	110114   Click image for larger version

Name:	screen_002.png
Views:	529
Size:	46.0 KB
ID:	110115  

Last edited by Anak; 08-28-2013 at 06:54 AM.
Anak is offline   Reply With Quote