Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-16-2019, 04:09 PM   #31
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
is there any way to modify Sigil so it converts % to vh when it sends the code to be rendered? vh does not work with ADE 2.0.1 and whatever version Kobo uses. And if people put in vh to get it to render correctly with Sigil, it may not render correctly for whatever software if they forget to put it back to % before being done.
Relax there, Sparky. We're way ahead of you. Hence my pleasure at discovering this thread.
DiapDealer is offline   Reply With Quote
Old 10-16-2019, 05:32 PM   #32
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,049
Karma: 129333562
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Brett Merkey View Post
@JSWolf:


Wow, thanks for that but seems like lots of layers there. I had originally tried media queries in Calibre to save the one step of going back into a converted AZW with Calibre to edit the CSS to put large, negative margins on the HTML root tag.
When I put in negative margins, I put in -45px for a 300DPI Kindle. I also use the Hyphenate This! plugin to put in soft hyphens as they work very well on KF8. And I use ChareInk as the font for a Kindle that supports fonts as I've modified it so the line height for KF8 is a lot smaller. So it makes the text look better. The only thing I don't get is kerning because KF8 doesn't support it. But ChareInk would work for KFX as it has kerning and a better line height and you get more text on a page then you do with Bookerly and I think it look better.

Quote:
ALL, each and every book I read on the Kindle or tablet, I extensively recode via Calibre in order to improve the typography and add visual interest, as well as insert proper conventions such as blockquote. The Paperwhite wastes lots of space at the margins, so I want to add negative margins for the PW without destroying the look of the ePub or the Calibre viewer.
I too fix up the ePub. Some require more work then others. Sometimes the CSS can be a real mess. I put in my out body and p. I remove unused CSS in the HTML and CSS. I delete any rubbish such as the HTML ToC. I remove things like advertising for other books, any previews, any reviews, any copyright notices not part of the copyright page, and any other rubbish I don't need. I also reduce the size of the cover and title page to 1600 lines is they are larger. I also losslessly recompress using a value of 80 to save size. I don't notice the difference. Because I put in my own p, any classes are .class or p.class, and it has a center, I put in a text indent of 0. And I reduce the silly chapter headers to something that takes a lot less space. Yes this all sounds like a lot of work, but really, it's not that hard to do.
JSWolf is online now   Reply With Quote
Advert
Old 10-16-2019, 05:33 PM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,049
Karma: 129333562
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DiapDealer View Post
Relax there, Sparky. We're way ahead of you. Hence my pleasure at discovering this thread.
Thanks. That will solve two problems at once.
JSWolf is online now   Reply With Quote
Old 10-16-2019, 06:19 PM   #34
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
@JSWolf:
Sounds like we pretty much go down the same list. It always gives me special pleasure to blow away that embedded Contents page. Usually allows getting rid of a nice swath of the CSS file too. For history books, I also get rid of the Index since readers have full text search and I also find images/maps to add. Coding for the Paperwhite and the Kindle Android app also allows the cheap (in labor!) theatrics provided by the pseudos ::first-line / ::first-letter.

Calibre was certainly not designed as an editor but, with its tools and plug-ins, added with a curated store of regexes, it can "do up" a book very quickly.

I will look up that font you mentioned.

Last edited by Brett Merkey; 10-16-2019 at 06:23 PM.
Brett Merkey is offline   Reply With Quote
Old 10-17-2019, 08:04 PM   #35
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,659
Karma: 5433388
Join Date: Nov 2009
Device: many
A few questions.

Is it safe to assume every svg tag with both width and height attributes of "100%" and with an image tag child should be converted to "100vh" and "100vw".

Or should it be further restricted to when there is only 1 svg tag and it is the only child of the body tag or maybe the first grandchild of the body assuming a single div is being used like we do when adding Covers in Sigil.

Since the cover will fill the screen, having no other elements in the body make sense as a selection criteria.

Are there any other cases when this type of swap makes sense?

Thanks,

KevinH

ps why are we talking about this in the Calibre forum. I only found it by accident. Perhaps we should move these posts to Sigil. Can any moderator cross forums like that?



Quote:
Originally Posted by JSWolf View Post
is there any way to modify Sigil so it converts % to vh when it sends the code to be rendered? vh does not work with ADE 2.0.1 and whatever version Kobo uses. And if people put in vh to get it to render correctly with Sigil, it may not render correctly for whatever software if they forget to put it back to % before being done.
KevinH is offline   Reply With Quote
Advert
Old 10-17-2019, 08:36 PM   #36
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,590
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
ps why are we talking about this in the Calibre forum. I only found it by accident. Perhaps we should move these posts to Sigil. Can any moderator cross forums like that?
Yes, in this case it might be best of DiapDealer did it as he would know best which posts are Sigil specific. Most of the thread seem to be about calibre.

BR
BetterRed is offline   Reply With Quote
Old 10-17-2019, 08:57 PM   #37
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
See fs_images.pyj in the calibre source code for the logic I use to detect when to convert 100% too 100vh

Quote:
Originally Posted by KevinH View Post
A few questions.

Is it safe to assume every svg tag with both width and height attributes of "100%" and with an image tag child should be converted to "100vh" and "100vw".

Or should it be further restricted to when there is only 1 svg tag and it is the only child of the body tag or maybe the first grandchild of the body assuming a single div is being used like we do when adding Covers in Sigil.

Since the cover will fill the screen, having no other elements in the body make sense as a selection criteria.

Are there any other cases when this type of swap makes sense?

Thanks,

KevinH

ps why are we talking about this in the Calibre forum. I only found it by accident. Perhaps we should move these posts to Sigil. Can any moderator cross forums like that?
kovidgoyal is offline   Reply With Quote
Old 10-17-2019, 10:09 PM   #38
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,659
Karma: 5433388
Join Date: Nov 2009
Device: many
Will do.

Thank you.



Quote:
Originally Posted by kovidgoyal View Post
See fs_images.pyj in the calibre source code for the logic I use to detect when to convert 100% too 100vh
KevinH is offline   Reply With Quote
Old 10-18-2019, 09:15 AM   #39
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,049
Karma: 129333562
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Brett Merkey View Post
@JSWolf:
Sounds like we pretty much go down the same list. It always gives me special pleasure to blow away that embedded Contents page. Usually allows getting rid of a nice swath of the CSS file too. For history books, I also get rid of the Index since readers have full text search and I also find images/maps to add. Coding for the Paperwhite and the Kindle Android app also allows the cheap (in labor!) theatrics provided by the pseudos ::first-line / ::first-letter.

Calibre was certainly not designed as an editor but, with its tools and plug-ins, added with a curated store of regexes, it can "do up" a book very quickly.

I will look up that font you mentioned.
You can find ChareInk at the following link.

https://www.mobileread.com/forums/sh...d.php?t=184056
JSWolf is online now   Reply With Quote
Old 10-18-2019, 09:18 AM   #40
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,049
Karma: 129333562
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by kovidgoyal View Post
See fs_images.pyj in the calibre source code for the logic I use to detect when to convert 100% too 100vh
Can this code be modified to work with the following CSS?

Code:
img {
  max-height: 100%;
  max-width: 100%;
}
JSWolf is online now   Reply With Quote
Old 10-18-2019, 09:24 AM   #41
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,659
Karma: 5433388
Join Date: Nov 2009
Device: many
svg uses the image tag not the img tag doesn't it. Have you tried your css for "image" instead of "img" otherwise there us no rule that applies.
KevinH is offline   Reply With Quote
Old 10-20-2019, 01:03 PM   #42
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,659
Karma: 5433388
Join Date: Nov 2009
Device: many
@Kovid,

Okay I took a shot at doing this in gumbo directly just before the Preview is loaded. Seems to work but the code is a bit messy.

One question:

I think I followed your general logic although I am not sure after checking for a single div child of body why you would ever see ("svg", "image") and not always ("div", "svg", "image") when building the path from the body. I built my path backwards from the image tag itself back to the body tag but I think it amounts to the same thing.

Am I missing something?

https://github.com/Sigil-Ebook/Sigil...2e178bb226bc5f

Quote:
Originally Posted by kovidgoyal View Post
See fs_images.pyj in the calibre source code for the logic I use to detect when to convert 100% too 100vh
KevinH is offline   Reply With Quote
Old 10-20-2019, 01:09 PM   #43
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That was a bug I fixed earlier today, look at the updated code.
kovidgoyal is offline   Reply With Quote
Old 10-20-2019, 02:10 PM   #44
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,659
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I just fixed my version of well. Thanks!

Quote:
Originally Posted by kovidgoyal View Post
That was a bug I fixed earlier today, look at the updated code.
KevinH is offline   Reply With Quote
Old 10-20-2019, 02:59 PM   #45
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
img {
height: 100%;
width: 100%;
}

The above code works fine for me for full-sized images. I never use the max-height or max-width, since just height and width work fine--and still work fine in v4.2. I never use 100vh, either.

Just make sure the margins for the body class on the image page are set to be small. I use 10pt for the side margins. This results in the image being centered when viewing the epub, as follows:

.calibre-cover {
display: block;
font-size: 1em;
padding-left: 0;
padding-right: 0;
text-align: center;
line-height: 1.2;
margin-bottom: 0;
margin-left: 10pt;
margin-right: 10pt;
margin-top: 0;
}
deback is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install & set up Calibre Companion? Step-by-step instructions DanielLauJJ Calibre Companion 0 03-28-2019 12:09 PM
Excel VBA: Programming For Complete Beginners, Step-By-Step Illustrated Guide WilliamBSkates Self-Promotions by Authors and Publishers 1 10-20-2018 11:51 AM
Touch One step forward, two steps back Noah98 Barnes & Noble NOOK 23 06-28-2011 12:47 PM
Apple takes a step back with subscription requirements Kali Yuga News 61 06-27-2011 01:08 PM
Unutterably Silly Could everyone please take a step back... Nate the great Lounge 5 11-15-2009 10:40 AM


All times are GMT -4. The time now is 11:43 AM.


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