![]() |
#31 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#32 | ||
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
|
||
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#34 |
Not Quite Dead
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
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. |
![]() |
![]() |
![]() |
#35 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
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:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#36 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#37 | |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,363
Karma: 27182818
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:
|
|
![]() |
![]() |
![]() |
#38 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
|
![]() |
![]() |
![]() |
#39 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
https://www.mobileread.com/forums/sh...d.php?t=184056 |
|
![]() |
![]() |
![]() |
#40 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#41 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
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.
|
![]() |
![]() |
![]() |
#42 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
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 |
![]() |
![]() |
![]() |
#43 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,363
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That was a bug I fixed earlier today, look at the updated code.
|
![]() |
![]() |
![]() |
#44 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
|
![]() |
![]() |
![]() |
#45 |
Book E d i t o r
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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; } |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |