Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-08-2015, 08:06 PM   #1141
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@jgoguen: No problem .

I'll be waiting for more people to test this though, because after a bit more testing, I appear to have managed to break stuff in certain circumstances (cf. latest edit of #1137) ^^.

That said, I can launch the PR right now if you prefer that as a means of code review?

(In the mean time, pushed on GH).

Last edited by NiLuJe; 01-08-2015 at 08:15 PM.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 12:37 AM   #1142
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
I think the book's stylesheet will override the patched device stylesheet, so If the plugin adds padding to div#book-inner in the book's stylesheet then idealy it should choose either left/right padding or top/bottom padding depending on whether the writing direction is horizontal or vertical, or if that is not possible then just add padding to all four sides.

I also wonder if we should add the padding to div#book-columns instead of div#book-inner, so that people can still use the alternative firmware patch that adds padding via the body>* selector? (Some might want to do this if they have a mix of kepubs made with the old and new plugins.)

Last edited by GeoffR; 01-09-2015 at 12:39 AM.
GeoffR is offline   Reply With Quote
Old 01-09-2015, 02:01 AM   #1143
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I don't think the css should hard-codes the plugin. Reading it from a configurable file is the most flexible. Or leave it completely alone. Once the divs are in the book, then the patch should work. Or use the "Modify CSS" and the kobo_extra.css file to add them during the send should work.

If it is hard-coded, it should be identical to what Kobo is using. Adding the other two rules forces them on people who might not want them. And is that padding correct for all devices? Or just the H2O and HD?
davidfor is offline   Reply With Quote
Old 01-09-2015, 03:53 AM   #1144
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by davidfor View Post
Or leave it completely alone. Once the divs are in the book, then the patch should work. Or use the "Modify CSS" and the kobo_extra.css file to add them during the send should work.
That makes sense.

Quote:
If it is hard-coded, it should be identical to what Kobo is using. Adding the other two rules forces them on people who might not want them. And is that padding correct for all devices? Or just the H2O and HD?
Kobo doesn't use any padding. The firmware patch adds 0.2em by default, so it is proportional to the font size set by the slider, and should be independant of screen resolution.

0.2em is just what seems to work from the testing that has been done so far, it seems to be enough to prevent any cutoff of an italic f at font size 1em or a normal f at font size 2em, which should be good enough for most books, but there will probably be some situations where the cutoff still happens, such as a 2em italic f which might occur in a right-justified heading.
GeoffR is offline   Reply With Quote
Old 01-09-2015, 09:16 AM   #1145
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@davidfor/@GeoffR: Speaking of, I actually appear to have vanilla kepubs *without* those specific divs (and style-hacks, except for the .koboSpan thingy) [at least according to the liberated Kobo Desktop version of the file. The one on my H2O looks the same, but with it being encrypted, who knows]. Yet the book-inner/book-columns stuff is still mentioned in the js :?.

One common trait to those books is that they *already* wrap the full body in a single div (although not book-inner and/or book-columns). And I could swear those don't suffer from the cutoff bug.

Since I basically just threw myself in the deep-end of Kobo arcane stuff here, I'd be glad for some more feedback on that point .

Last edited by NiLuJe; 01-09-2015 at 09:19 AM.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 10:04 AM   #1146
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
My slightly-educated opinion on the matter is to please try to emulate the current "real" KePubs as closely as possible Ignore what's in the JS and CSS files and build the KePub structure based on observations of a few Kobo-supplied books. I didn't necessary do that at first and it resulted in a lot of avoidable problems.

EDIT: As for JS and CSS files, try to use the mechanism I'm using for "reference.kepub.epub" or (probably better) work with the existing code for sending a device-based CSS file. You could easily add code to do the same for JS files.

Last edited by jgoguen; 01-09-2015 at 10:07 AM.
jgoguen is offline   Reply With Quote
Old 01-09-2015, 10:35 AM   #1147
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@jgoguen: The issue with this specific bit of CSS (the kobo stylehacks) is that (when present), it's inlined in each (x)html file, and not evacuated to an external CSS, so we can't (easily) use the same mechanism as for the JS ;/.

----

To illustrate my previous message, I forgot to mention that those books of course use 0 padding & margin, and yet, no cut-off... :?

The code basically looks like

Code:
<body>
    <div class="galley-rw">
        ...
    </div>
</body>
Code:
.galley-rw { padding: 0; font-size: 1em; font-weight: normal; color: rgb(0, 0, 0); orphans: 1; widows: 1; letter-spacing: 0; word-spacing: 0; font-family: serif; margin: 0; line-height: 1.2em; text-align: justify; }
FWIW, that's the book.
Attached Thumbnails
Click image for larger version

Name:	pack.png
Views:	253
Size:	124.7 KB
ID:	133575  

Last edited by NiLuJe; 01-09-2015 at 10:39 AM.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 10:41 AM   #1148
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,545
Karma: 79436716
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
I think you need to look at the "age" of the kepub; I think there have been changes over the years in the conversions done, and I'm not sure they go back and reconvert all material.
PeterT is offline   Reply With Quote
Old 01-09-2015, 10:45 AM   #1149
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@PeterT: Valid point. That's a fairly recent book (September 2014), as are the few others I have that look like that.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 12:50 PM   #1150
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
Yay inline CSS<!>

If you declare an external stylesheet and make sure it's the second-to-last stylesheet defined (since the user stylesheet should override this one) then you don't need to inline the CSS. There's an order of precedence for styles: external sheets (in document order), inline styles in the <head> in order, and styles on each tag.
jgoguen is offline   Reply With Quote
Old 01-09-2015, 01:58 PM   #1151
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@jgoguen: To be clear, because I'm starting to get confused myself ;D:

It's inlined in vanilla kepubs. The patched version of the plugin puts it in an external stylesheet, defined hopefully last or next-to-last. Good point about the kobo_extra one though, I'll see where that one falls .
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 05:10 PM   #1152
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
@NiLuJe: To keep things easier to manage, what I'd recommend is that you start from the master branch as it was when you forked, then create a branch for each distinct change (git checkout -b branch-name), make only your distinct changes for the one branch, push it, and make a pull request for each branch. Then go back to master and make a new branch and start on the next distinct feature.
jgoguen is offline   Reply With Quote
Old 01-09-2015, 05:58 PM   #1153
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by NiLuJe View Post
@davidfor/@GeoffR: Speaking of, I actually appear to have vanilla kepubs *without* those specific divs (and style-hacks, except for the .koboSpan thingy) [at least according to the liberated Kobo Desktop version of the file. The one on my H2O looks the same, but with it being encrypted, who knows]. Yet the book-inner/book-columns stuff is still mentioned in the js :?.

One common trait to those books is that they *already* wrap the full body in a single div (although not book-inner and/or book-columns). And I could swear those don't suffer from the cutoff bug.

Since I basically just threw myself in the deep-end of Kobo arcane stuff here, I'd be glad for some more feedback on that point .
All I can think is to check that it really is a kepub, some books synced from the Kobo server are actually epubs, and get opened with the epub reader, although I've only ever seen that with free books. The margins in your screenshot make it look like this is being viewed in the epub reader, the kepub reader has larger margns, unless you are using the `Custom kepub default margins` patch?

Also the screenshot doesn't show any f characters at the right of the screen, f is the only character I usually see cut off. Can you check to see if an f gets cut off at the right?
GeoffR is offline   Reply With Quote
Old 01-09-2015, 06:29 PM   #1154
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@GeoffR: Definitely a kepub, and not the only one like that (mostly from Hachette, AFAICT) (flagged as KOBO EPUB in the UI, no adobehost process run, bearable pageturn speeds, and kepub font rendering, so I'm fairly sure of that ).

But yes, I am indeed using the nerfed kepub margins patch (default values) .

Good point on the f's though, I'll check .

Last edited by NiLuJe; 01-09-2015 at 07:00 PM.
NiLuJe is offline   Reply With Quote
Old 01-09-2015, 07:00 PM   #1155
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by NiLuJe View Post
FWIW, that's the book.
Hmm, I see that book doesn't have an epub2 download option, so I think the publisher must have supplied an epub3, and in that case it hasn't gone through Kobo's epub2 to kepub conversion process where the book-inner and book-columns divs get added.
GeoffR is offline   Reply With Quote
Reply

Tags
error, kobo aura one


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo Device Driver Update davidfor Devices 284 05-24-2019 05:24 PM
[Device Plugin] Kindle 2, 3, 4, Touch Device Interface MBP Update Mod cryzed Plugins 7 10-28-2012 04:58 PM
[Device Interface Plugin] Update for Nook Color Driver jmricker Plugins 0 10-22-2011 10:11 AM
Touch Kobo Touch Extended 2 Year Warranty - Is it worth the $34.99? EverC Kobo Reader 11 08-31-2011 11:47 PM
Touch Kobo Touch Extended Warranty Program SensualPoet Kobo Reader 1 07-17-2011 04:08 AM


All times are GMT -4. The time now is 11:29 PM.


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