08-31-2012, 09:12 AM | #1 |
Resident Curmudgeon
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Dropcaps code wanted
I know there are many ways to do drop caps in ePub via ADE. What code do you use or what code do you like the look of?
I'd like ot get as many different dropcaps code as possible so there would be a good choice of differing styles. Thanks. |
08-31-2012, 10:19 AM | #2 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Simple but effective (not really "dropping", though):
Code:
span.drop {
font-size: 200%;
font-weight: bold;
line-height: 0;
}
span.predrop {
font-weight: normal;
font-size: 50%;
}
span.letter_T {
margin-right: -0.15em;
}
<p><span class="drop letter_T"><span class="predrop">—¡</span>T</span>oma!...</p>
|
Advert | |
|
08-31-2012, 10:40 AM | #3 |
Resident Curmudgeon
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
All that is is a raised initial cap. Not a dropcap at all.
|
08-31-2012, 11:06 AM | #4 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Yes, that's what I meant with not "dropping".
For a more elaborate (and really "dropping") cap, from "The Prince and the Pauper": Code:
span.first { font-variant: small-caps; margin-left: -0.5em; white-space: pre; } span.drop { font-family: "Royal"; font-size: 500%; line-height: 1; height: 1em; float: left; margin: 0.1em 0.1em -0.2em 0; } span.afterA { margin-left: -1.0em; } p.initial { text-indent: 0; } p.initial + p { clear: left; /*optional, depends on how you want the second paragraph if the first is short*/ } <p class="initial"><span class="drop">A</span><span class="first afterA"> heavy</span> drowsiness presently fell upon the two comrades. The King said—</p> |
08-31-2012, 11:15 AM | #5 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
You'll find a code in this EPUB and some examples as well. I also use a regex to place them. More by mail if you wish. https://www.mobileread.com/forums/sho...d.php?t=189203 |
Advert | |
|
08-31-2012, 01:52 PM | #6 |
Guru
Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
|
I used the following for my Lovecraft books, it seemed to do the job.
Code:
p.newscene2 { text-indent:0; margin-top:2em; } span.dropcap { float:left; font-size:4.7em; line-height:0.8em; margin-right:3pt; margin-bottom:-0.1em; } <p class="newscene2"><span class="dropcap">T</span>he first line</p> |
08-31-2012, 11:05 PM | #7 |
Zealot
Posts: 117
Karma: 584308
Join Date: Oct 2010
Location: San Francisco
Device: Kindle
|
I use this:
.dropcaps { float: left; font-size: 60px; line-height: 50px; padding-top: 1px; margin-top: -.04em; margin-right: .04em; } Yes, I know it's in px. |
09-04-2012, 07:45 PM | #8 |
Boo-Frickety-Hoo-Erizer
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
You know, I hate to say anything, especially since I've historically fussed so hard about it all. I've given up on drop caps. Too many places they just don't work out, like:
Chapter One "Me?" "Yes. You." Chapter Two I..I couldn't go on. Maybe another word or two. Note quite enough to sometimes make a second line before another paragraph. That you are indenting everywhere else. That you are indenting everywhere else. Chapter Three Aaah, the way it should be, with an initial paragraph that goes on long enough to wrap and look nice until another paragraph comes in somewhere down the road. This is what it works best on and is why we worked it all out to start with: we've seen enough great examples in print to make us want to do it here... I know, my examples suck here, because they don't actually drop (you'll have to imagine them dropping). But unless I'm willing to be inconsistent, or snip out double or single quotes at the beginning, or live with how funny second paragraphs sometimes butt up against them when I can't quite control where things fall, I just keep running into too many situations where they just don't work, and I would have to justify yet another compromise. When they work, they are impressive. When they don't, they impressively don't. Or, maybe rookie here just can't figure out how to make all possible textual situational variants work without scripting. -b |
09-04-2012, 08:26 PM | #9 |
Resident Curmudgeon
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But you can control how drop-caps work.
|
09-05-2012, 02:27 AM | #10 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
This time, a try with drop-caps on two lines. Looks OK including for "tricky" J and Q initials. https://www.mobileread.com/forums/sho...45#post2208445 |
09-05-2012, 10:56 AM | #11 | |
Resident Curmudgeon
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
09-05-2012, 11:00 AM | #12 |
Boo-Frickety-Hoo-Erizer
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Yes, we can control how the drop cap works. What we cannot control so well is how the lines break around them, because the page width is an unknown in reflowable books. In the lovely Soyans Gais example, the AU CONCERT VATOIRE chapter, if you have your view the width set single-column full screen *might* show part of what I've talking about. The second paragraph (Il faut vous dire) starts with an indent, and can land on the second line of the drop cap. Sure, it changes to something more pleasant with a narrower width, but it happens often enough--at least, in the books I'm building, even on smaller screens--that it is bothersome. At least to me. That is something I don't seem to be able to find an acceptable solution for enough of the time (could be solved with scripting, maybe), which is what has led me to abandon the lovely things, with regrets.
But, don't let me stop anyone else. Because I do like dropcaps. Wish I were a clever enough typographer to make them work more often for the situations I so readily seem to keep running into. Dang it. -b |
09-05-2012, 11:29 AM | #13 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
This is easily corrected and will be memorized for the next time: for example, in the CSS style-sheet, using Sigil, just modify the let2 font-size value from the original 2.6 to 2.5 or maybe 2.4. Select the value which gives you the best results. |
|
09-05-2012, 11:42 AM | #14 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Also there is the question of the possible punctuation mark, just before the initial letter. Usually, I suppress it. It is also possible to include it in the initial. I've seen both. It's a matter of choice. Last edited by roger64; 09-05-2012 at 11:48 AM. |
|
09-05-2012, 11:44 AM | #15 | |
Boo-Frickety-Hoo-Erizer
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Quote:
8^) |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS / dropcaps | Oldpilot | Sigil | 49 | 09-17-2012 09:44 AM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |
Dropcaps example in User Manual FAQ | jackie_w | Calibre | 7 | 10-28-2009 06:52 AM |
Ended wanted: coupon code for Abbyy finereader | moz | Flea Market | 1 | 03-12-2008 02:10 AM |
Just wanted to say hi from the UK | NickMilner | Sony Reader | 8 | 01-20-2007 03:14 PM |