12-26-2013, 09:41 AM | #16 | |
Guru
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
|
Quote:
Now consider a line of poetry. There are two possibilities:
In the first case, the negative indent cancels out with the positive padding and the line starts at position 0 on the left. In the second case, the negative indent cancels out with the positive padding in the first line but not in the second, third, etc., as text-indent only applies to the first line. So the first line starts at position 0 on the left, but the second starts at the position configured for the padding property. In short: each new line of poetry always starts at position 0 of the left. If a line doesn't fit in the width of the screen, it continues in the next line with a small padding. Example: This line fits in the width of the screen This line does not fit in the width of the ---screen This line fits in the width of the screen Another line that doesn't fit in the width ---of the screen where "---" are white spaces. |
|
12-26-2013, 10:20 AM | #17 | ||
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Quote:
THESE... (Chil!...) Now... (Chil!...) Word... Word... Here's... They... (Chil!...) They... (Chil!...) ... Some of them are indented (the "Chil!" ones). But a few lines are too long for the page (especially where the drop cap appears), and are broken in two, with the second part indented too. These linebreaks are "soft" ones, you don't want to include them in the ebook, they should only be generated as needed by the reader (just like normal paragraphs are broken into lines). The only way I know of getting this kind of display is with a negative text-indent (and a matching positive margin or padding), but it is this negative indent that causes the problems, especially since ADE is apparently behaving differently from other renderers. If there is no poetry, I don't need the negative text-indent, or any indent at all, and there's no problem. If there is no float (drop cap or illustration), the negative text-indent works perfectly as intended. EDIT: Pablo's explanation is much better than mine, but here you have your image |
||
12-26-2013, 11:47 AM | #18 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
This technique is often used in poetry since most of the time the first line is sufficient but occasionally on narrow screen lines may be too long and have to flow on a second line but need to be identified as such and not mistaken for a new poetry line. Dale |
|
12-26-2013, 08:03 PM | #19 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks all for all your explanations (and for the screenshot too!). I really learnt something.
I can't help but verses that long make me think of the Giant Gippsland earthworm but they do indeed represent a specific problem to tackle with the Giant Dropcap... I'll have a try (don't laugh please). Last edited by roger64; 12-26-2013 at 08:09 PM. |
12-26-2013, 08:09 PM | #20 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Try reading any well done version of Alice in Wonderland. There is a tale to be had there.
Dale |
12-26-2013, 11:42 PM | #21 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@Jellby -- I wonder if you might be able to work something out using a two-column table (I know... tables... ewwww!) to create a fake "adjacent" cap. I'm just spitballing here, and it might not be possible, but theoretically it could work. The table cells could keep the cap quarantined from the text. Of course, it would probably break in lots of devices.
I've seen adjacent caps discussed in a few blogs about InDesign, but not often for CSS. This link http://webdesign.about.com/od/exampl...p_examples.htm has some CSS samples. If I get some time, I'll do some fiddling too. |
12-27-2013, 03:38 AM | #22 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Hmm... might be an option. But what if the poem is more than one page long? Tables and pagebreaks don't get along that well. And forcing the whole poem to be indented just because the first 2-3 lines have a drop cap... I don't think small screens would like that
|
12-27-2013, 07:02 PM | #23 |
A curiosus lector!
Posts: 463
Karma: 2015140
Join Date: Jun 2012
Device: Sony PRS-T1, Kobo Touch
|
jellby I was wrong!
Or put in a more elegant way, you were right (it does not work). My codes, and I've played with them, don't give what you were expecting. By the way if you or Rubén had not find the solution, the challenge is great for everyone else! But I am convinced that Hitch will find the right solution (the good codes). @ Pablo Siempre es un placer de leerte. Yo no te he olvidado, pero tuve problemas con mi archivo y la traducción fue bloqueada en muchos reinicios. ¡Yo no pierdo la esperanza, aunque! Last edited by Arios; 12-27-2013 at 07:10 PM. |
12-28-2013, 02:21 AM | #24 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
However, if I get through my massive video-making tasks for our annual "downtime," I'll see if I can stare at this for a while. No promises! But I'll take a gander at it. (This is a colloquialism, meaning, take a look. Este é um coloquialismo, ou seja, dar uma olhada. I think that's right. I hope I said what I meant, and didn't confuse you.) Hitch |
|
12-28-2013, 11:05 AM | #25 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Good news, folks. It seems it was as simple as setting "text-indent: 0" for the drop cap style. Why a span, with an explicit "display: inline !important", would be rendered with a text-indent is something that defies my understanding... until I realize we're dealing with ADE.
I was resigned to using an .xpgt file, but then I realized that it seemed to be working with images (first screenshot, that's with the "old" code). So, with basically the following code, I could get it working with text too (second screenshot): Code:
div.poetry div.line { padding-left: 3.5em; text-indent: -3.5em; } span.drop { float: left; margin-right: 0.5em; text-indent: 0; } span.drop span { font-size: 300%; font-weight: bold; } div.poetry span.drop { margin-left: -3.5em; margin-right: 4em; } span.drop + span.first { margin-left: -0.5em; white-space: pre; } <div class="poetry"> <div class="line"> <span class="drop"><span>P</span></span><span class="first">earl</span> of delight that a prince doth please</div> ... In the process, I noticed another ADE bug. When I tried to move a drop cap image up (third screenshot), it didn't work. Apparently ADE does not like "position: relative". I then tried setting a negative margin-top, and lo and behold, that only works if I have a border! So I had to use something like this: Code:
img#initc3 { border-top: 0.001px solid inherit; margin-top: -2em; } p#c3 { padding-top: 2em; } <p id="c3"><img id="initc3" class="drop" src="images/Init-C3.jpg" alt="Y"/><span class="first"><span class="hide">Y</span>ou</span> will remember... So, all this is now working in ADE, and in my test browser (Opera), I hope it works in most readers too. Last edited by Jellby; 12-28-2013 at 01:42 PM. |
12-28-2013, 01:15 PM | #26 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Great work! Thanks a lot. Will test that.
|
01-02-2014, 02:02 PM | #27 | ||
A curiosus lector!
Posts: 463
Karma: 2015140
Join Date: Jun 2012
Device: Sony PRS-T1, Kobo Touch
|
Quote:
Quote:
Thank you also for "possible" info to come. PS I'm more on the French side of things than on the Spanish one, but as I am in the process of learning this language, I sometimes use it everywhere or in the wrong place. My message to Pablo should have been a PM: sorry about that. jellby thanks for the code. I am not sure to use it one day, but it's nice to know how to do it. Last edited by Arios; 01-02-2014 at 02:06 PM. |
||
01-02-2014, 02:20 PM | #28 | |||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
Quote:
Hitch |
|||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to strip drop caps? | ficbot | Calibre | 2 | 08-30-2013 11:06 AM |
drop caps in paperwhite? | morrow | Kindle Formats | 7 | 12-11-2012 12:10 PM |
Drop caps | huebi | ePub | 8 | 03-04-2012 06:25 AM |
The opposite of drop caps | LostSock | ePub | 13 | 09-13-2011 07:07 AM |
newbiq Q about Drop Caps and Calibre | NASCARaddicted | Calibre | 2 | 01-14-2010 07:03 PM |