10-30-2015, 10:21 AM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2015
Device: Kindle Fire
|
kindle bug with scaled images
Hi,
Has anyone else experienced this? I find that when I scale an image using ems, it works great on Kindle Fire (and on Kindle Previewer 3), except for one thing: If the user increases the font size so that the width of the image takes up the entire screen, it "locks" at that size, and subsequently the image no longer scales down with the font size; it simply takes up the entire width of the screen. Before-and-after screenshots attached. This example is an in-line image used in kind of a weird way, but the same thing happens with all the images I've used in the book (a lot). Here's the CSS img.under{ display:inline-block; width:10em; top:.7em; right:10em; } span.under img.under{ vertical-align: baseline; position: relative; top: .7em; } <span class="under"><img class="under" src="images/underline.jpg" alt=""/> Thanks! —Chris |
10-31-2015, 04:04 PM | #2 |
Well trained by Cats
Posts: 29,817
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Hmm
Is there a reason to NOT use text-decoration: underline? Or another span cheat: border bottom: black solid 2pt; padding- bottom adjusts the spacing |
Advert | |
|
11-06-2015, 09:17 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2015
Device: Kindle Fire
|
Thanks for the tip!
The short answer I'd like to keep the EPUB experience as close to the printed text as possible. I know that's a Quixotic effort but I got pretty close here. |
11-06-2015, 10:55 AM | #4 |
A Hairy Wizard
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I'm not sure how widely supported background images are, but you could give a span the background image??
Code:
span.under { background-image: url("../Images/under.gif"); background-repeat: no-repeat; background-position:center bottom } <p>...in a rapturous frenzy, <span class="under">that she read to write.</span> So there is an irony there....</p> You could also add css that would provide for those systems that don't render background images (eg text-decoration: underline), but someone else with more experience in that area would have to help with that. Hope that helps! |
11-12-2015, 04:30 AM | #5 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Just confirming that I've experienced the same bug. However, flipping a few pages forwards/backwards, and back again, seems to reset the size to the correct one.
As to the actual task in question, personally I'd go for a SVG solution – maybe even code the SVG straight into the document. And resign myself to using plain underline for the mobi fallback. |
Advert | |
|
11-12-2015, 05:00 AM | #6 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
A MWE, only tested in a browser, would be interesting to know if it works in KF8:
Code:
<div> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="4em" style="inline;position:relative;left:-4.2em;top:1.1em;margin-right:-4.2em;" viewBox="77 480 330 100"> <path d="m 77,498 c 130,-52 270,59 408,-30" style="stroke:#000000;fill:none;stroke-width:0.5em;" /> </svg> incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> |
11-12-2015, 06:07 AM | #7 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
|
11-12-2015, 06:58 AM | #8 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
@Doitsu: Thanks for checking it out.
Investigating it further, I did get the wavy line to show in the Previewer by wrapping the <svg> in a <span> and replacing em units with px inside the svg tag, but then ran up against a brick wall trying to get the inline SVG to scale with font size So it seems one has to store the line in an img file, but at least it should be OK to use SVG there. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre window displays scaled | holiveros | Calibre | 3 | 08-01-2013 12:28 PM |
Kindle touch bug that causes bricking (kindle needs repair message) | bdrosen | Kindle Developer's Corner | 2 | 01-24-2012 11:47 AM |
Embedded font bug or CSS bug in ADE | JSWolf | ePub | 10 | 06-11-2011 02:34 PM |
A bug with images in epubs? | Cyclops | ePub | 2 | 09-13-2010 10:57 AM |
Scaled images in iBooks | ckirchho | Apple Devices | 5 | 06-25-2010 05:21 AM |