Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-31-2012, 09:12 AM   #1
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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.
JSWolf is offline   Reply With Quote
Old 08-31-2012, 10:19 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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">&mdash;¡</span>T</span>oma!...</p>
The class "predrop" is used for anything preceding the first letter. It's better to include it inside the "drop" span, in case you want to change it to something else... like a float. I also create "letter_?" classes for each letter that might need adjustments (T, V... in this case; A, L... for real drop caps). A simpler example:
Jellby is offline   Reply With Quote
Advert
Old 08-31-2012, 10:40 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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.
JSWolf is offline   Reply With Quote
Old 08-31-2012, 11:06 AM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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&mdash;</p>
Jellby is offline   Reply With Quote
Old 08-31-2012, 11:15 AM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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
roger64 is online now   Reply With Quote
Advert
Old 08-31-2012, 01:52 PM   #6
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
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>
Not the most sophisticated, but was good enough for my first ever book.
ghostyjack is offline   Reply With Quote
Old 08-31-2012, 11:05 PM   #7
Jeff L
Zealot
Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.Jeff L ought to be getting tired of karma fortunes by now.
 
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.
Jeff L is offline   Reply With Quote
Old 09-04-2012, 07:45 PM   #8
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
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
brewt is offline   Reply With Quote
Old 09-04-2012, 08:26 PM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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.
JSWolf is offline   Reply With Quote
Old 09-05-2012, 02:27 AM   #10
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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
roger64 is online now   Reply With Quote
Old 09-05-2012, 10:56 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by roger64 View Post
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
Well, the drop-cap needs to be moved up slightly. The descender of the Q hits the top of the D on the third line. That is unacceptable.
JSWolf is offline   Reply With Quote
Old 09-05-2012, 11:00 AM   #12
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
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
brewt is offline   Reply With Quote
Old 09-05-2012, 11:29 AM   #13
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by JSWolf View Post
Well, the drop-cap needs to be moved up slightly. The descender of the Q hits the top of the D on the third line. That is unacceptable.
Thank you for looking at it and for pointing this.

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.
roger64 is online now   Reply With Quote
Old 09-05-2012, 11:42 AM   #14
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by brewt View Post
.../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. .../...
-b
This can, sometimes be a problem, if you use indents. Statistically, with dropcaps on two lines you have much less chance to face this than with dropcaps on three lines. :-)

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.
Attached Thumbnails
Click image for larger version

Name:	concert.png
Views:	237
Size:	18.8 KB
ID:	91854   Click image for larger version

Name:	concertIPAD.png
Views:	249
Size:	30.4 KB
ID:	91856  

Last edited by roger64; 09-05-2012 at 11:48 AM.
roger64 is online now   Reply With Quote
Old 09-05-2012, 11:44 AM   #15
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
Quote:
Originally Posted by roger64 View Post
This can, sometimes be a problem, if you use indents. Statistically, with dropcaps on two lines you have much less chance to face this than with dropcaps on three lines. :-)

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.
Yes, and that is part of my problem: can't make a decision I'm ultimately happy with.
8^)
brewt is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:55 AM.


MobileRead.com is a privately owned, operated and funded community.