![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Text wrap around irregular shapes
I had a look at Zelda Pinwheel's excellent ePub edition of "Three Men in a Boat" and noticed that she managed to wrap text around an upside-down L shaped image (without splitting the image into two parts and without spacers) using only two divs (boat006_ch03.xhtml; pg040.gif).
Unfortunately, Zelda doesn't seem to visit MR anymore. The HTML code is: Code:
<div class="leftpic" id="ocean"><img alt="" src="../Images/pg040.gif" /></div> <div class="leftpic"></div> Code:
div.leftpic { float: left; clear: left; text-align: left; margin: 0 0.5em 0.5em 0; } div.leftpic img { width: 100%; display:block; } div#ocean { width: 206px; height: 109px; } div#ocean + div.leftpic { width:143px; height: 282px; margin-top: -0.5em; } Can someone please explain to me how Zelda Pinwheel arrived at the numbers for the divs and how one could recycle the code for upside down and regular L shaped images? Alternatively, what ADE compatible CSS would you use to wrap text around my similarly shaped test image? (The text should be displayed right of the black parts of the image and on top of white parts of the image.) The image dimensions are 200x300px; the dimensions of the white box in it are 120x200px (80px from the left, 100px from the top). Last edited by Doitsu; 05-02-2014 at 06:58 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I don't think it actually works anymore with the newer versions of ADE, but I am not sure.
The numbers should be related to the real picture. Wasn't there a old thread about this that explained it? Hmm... *Update* It was in the epub snippet thread: https://www.mobileread.com/forums/showthread.php?t=46448 Last edited by Toxaris; 05-02-2014 at 07:08 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Hi Doitsu;
Sometime ago I had posted a solution based in two boxes; I have adapted that solution to your present request. 1. In your .css stylesheet write the following: Code:
p { text-align: justify; margin: 0; } .Box1 { float: left; width: 210px; /* 200px + 10px for right margin */ height: 100px; } .Box2 { clear: left; float: left; width: 90px; /* 80px + 10px for right margin */ height: 200px; } In the .xhtml file you should write: Code:
<p>Lorem ipsum dolor sit amet, conectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Sed at velit nisl.</p> <div class="Box1"><img src="../Images/UpsideL.png" alt="" /></div> <div class="Box2"></div> <p>Lorem ipsum dolor sit amet, conectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Sed at velit nisl.</p> ![]() Below you can check the respective .epub Regards Rubén Last edited by RbnJrg; 05-02-2014 at 11:25 AM. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
If I recall correctly, it might be that some readers put a white space between the images. Then again, I may have amnesia...
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Yes, that was the problem with my solution based in two images (in Sony readers). But this time I used only one image ![]() ![]() Regards |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You could check Tom Sawyer. I think my solution there is a bit different.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
I wonder if I might suggest that whatever solution is used it be checked on an Apple. It may be the the whole image is reduced to a tiny dot - at least with iBooks.
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
@Hitch: There's no fallback code required for Mobi7-only Kindles. The image is being displayed left-aligned with lots of white-space right of it. Not very pretty, but, IMHO, acceptable. |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Hi Doitsu;
Try using: Code:
<div class="Box1"><img width="200" height="300" src="../Images/UpsideL.png" alt="" /></div>
<div class="Box2"></div>
Regards EDIT: By the way, you could use my primitive "solution" that works on iPad and Kindle (but it has some issues under ADE): https://www.mobileread.com/forums/sho...55&postcount=9 Also read the post #13 of that thread. Last edited by RbnJrg; 05-03-2014 at 08:49 AM. |
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
![]() Thanks also for the link to your parrot epub, which does work with iBooks. ![]() |
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() In the .xhtml file goes: Code:
<div class="Box1"><img width="200" height="300" alt="" src="../Images/UpsideL.png" /></div> <div class="Box2"></div> Code:
p { text-align: justify; margin: 0; } .Box1 { float: left; width: 90px; /* widht of the vertical part of the "L" + 10px for right margin */ height: 300px; /* height of the image */ } .Box2 { float: left; width: 120px; /* width of the horizontal part of the "L" */ height: 100px; /* height of the horizontal part of the "L" */ } |
|
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Maybe it's time to throw in the towel. After all, Apple device users can always install other apps that behave in a more predictable way. ![]() Anyway, I really appreciate your efforts. |
|
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,634
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
I've tested your epub in iBooks and Marvin, and as Doitsu said it doesn't work. But it's interesting that it fails in different ways between iBooks and Marvin. I'm afraid I don't know how to produce screenshots, so I'll try to describe the results. - with iBooks Lorem ipsum and two lines following is shifted to the right, by a distance 2-3 times the width of the top bar of the image. The next line is still shifted to the right, but only as far as the edge of the top bar, and is level with the bottom of the vertical bar. The next five lines are shifted to the right at the same level, so that there is a big white space below the image. - with Marvin the image looks quite different; the horizontal part of the L is much thicker than the image with iBooks, and much narrower. The vertical part of the L is narrower, and much taller. The text next to the horizontal bar is again shifted to the right, so that there is a white space about 2.5 times the width of the horizontal bar and extending down to the bottom of the horizontal bar. The text from the bottom edge of the horizontal bar to the bottom edge of the vertical bar is shifted to the right level with the right edge of the horizontal bar - there is no white space below the image It looks to my ignorant eyes that there is not only an iPad problem, but also an iBooks versus Marvin problem. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there any way to wrap text around pictures? | ecbritz | Sigil | 7 | 05-04-2013 11:57 AM |
Want to Center Irregular Images with text wrap | GrannyGrump | ePub | 26 | 04-04-2013 02:22 AM |
I need help with text wrap... | skammer1974 | Sigil | 3 | 03-06-2013 07:28 PM |
TEXT WRAP AROUND IMAGES | RKEP71 | Sigil | 1 | 06-20-2011 08:26 PM |
LRF and wrap-around text | Seabound | Calibre | 13 | 12-28-2008 03:30 PM |