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

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle

Notices

Reply
 
Thread Tools Search this Thread
Old 02-06-2024, 12:37 PM   #1
jackm8
Zealot
jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.
 
Posts: 115
Karma: 28464
Join Date: Nov 2015
Device: none
Drop caps?

Amazons site mentions Drop caps as a feature in their Advanced Typesetting blurb. Does anyone know of any book example where they are used? Or what code is needed to implement them manually in the files?

Code:
* Drop caps: Drop caps automatically adapt their line height to the customer's screen size and font settings. 
https://kdp.amazon.com/en_US/help/topic/G202087570
jackm8 is offline   Reply With Quote
Old 02-06-2024, 01:08 PM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,495
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Amazon's documentation for publishers is not great but they do have some information on coding drop caps in the Kindle Publishing Guidelines.
jhowell is offline   Reply With Quote
Advert
Old 02-06-2024, 06:09 PM   #3
jackm8
Zealot
jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.
 
Posts: 115
Karma: 28464
Join Date: Nov 2015
Device: none
Thanks. It's surprisingly easy. Code works on .epubs that are then converted to .kfx with KFX Output plugin.

All that's needed is "span.dropcaps" into styles.css, then <span class="dropcaps">T</span> around first capital letter in the chapter, replacing the T.
Quote:
span.dropcaps
{
font-weight:normal;
font-size:320%;
float:left;
margin-top:-0.3225em;
margin-bottom:-0.3245em;
}

<span class="dropcaps">T</span>
A slight problem is that this code doesn't work the same way in epub format. Looking at preview in Sigil and Calibre, capital letter is off, but in Kindle Previewer it's then properly formatted. So it takes a bit of packing and unpacking from epub to kfx when adjusting things.

Also, it's not as pleasing visually in case of very short paragraphs, or when very small fonts settings are selected. But by the looks of it, typesetters in old paperbacks did it in a very similar way: https://archive.org/details/producer...p?view=theater (page 28, page 38, page 157...)

I'm just wonder now if there's a way to tune it so that it looks the same in epub and in kindle's format without changing the code.
Attached Thumbnails
Click image for larger version

Name:	prev0.jpg
Views:	48
Size:	518.7 KB
ID:	206235   Click image for larger version

Name:	prev1.jpg
Views:	42
Size:	555.4 KB
ID:	206236   Click image for larger version

Name:	prev2.jpg
Views:	43
Size:	309.6 KB
ID:	206237  

Last edited by jackm8; 02-06-2024 at 06:39 PM.
jackm8 is offline   Reply With Quote
Old 02-06-2024, 06:18 PM   #4
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,858
Karma: 128597114
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 jackm8 View Post
Thanks. It's surprisingly easy. Code works on .epubs that are then converted to .kfx with KFX Output plugin.

All that's needed is "span.dropcaps" into styles.css, then <span class="dropcaps">T</span> around first capital letter in the chapter, replacing the T.


A slight problem is that this code doesn't work the same way in epub format. Looking at preview in Sigil and Calibre, capital letter is off, but in Kindle Previewer it's then properly formatted. So it takes a bit of packing and unpacking from epub to kfx when adjusting things.

Also, it's not as pleasing visually in case of very short paragraphs, or when very small fonts settings are selected. But by the looks of it, typesetters in old paperbacks did it in a very similar way: https://archive.org/details/producer...p?view=theater (page 28, page 38, page 157...)

I just wonder now if there's a way to tune it so that it looks the same in epub and in kindle's format without changing the code.
Do you know that your drop-cap span has broken searching? The first work in the chatter cannot be found with a search.

Yes you can have the same code for ePub and KF8/KFX. But one thing you need to do in the ePub is set the line-height the same as that of the Kindle. Also, you may need to use the same font. ON my Kobo, I can override your choice of font and that can spoil your drop cap. On a Reader, drop cap really should not be used as there are many cases where it's a fail.
JSWolf is offline   Reply With Quote
Old 02-06-2024, 07:47 PM   #5
jackm8
Zealot
jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.jackm8 solves Fermatís last theorem while doing the crossword.
 
Posts: 115
Karma: 28464
Join Date: Nov 2015
Device: none
Quote:
Do you know that your drop-cap span has broken searching? The first work in the chatter cannot be found with a search.
I'm not exactly sure what you're talking about. If it's search dialogue, I don't think that it's causing any problems. There appears to be a slight discrepancy in the count between Kindle Previewer and file on the device, still, in both cases "There" at the start of chapter two was picked up. It was correctly found in epub format as well in Neat Reader.
Attached Thumbnails
Click image for larger version

Name:	there1.jpg
Views:	38
Size:	407.7 KB
ID:	206238   Click image for larger version

Name:	there2.jpg
Views:	34
Size:	659.1 KB
ID:	206239   Click image for larger version

Name:	there3.jpg
Views:	33
Size:	596.9 KB
ID:	206240  

Last edited by jackm8; 02-06-2024 at 07:53 PM.
jackm8 is offline   Reply With Quote
Advert
Old 02-07-2024, 12:33 PM   #6
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by jackm8 View Post
Amazons site mentions Drop caps as a feature in their Advanced Typesetting blurb. Does anyone know of any book example where they are used?
Here is what I use:
Code:
.text-dropcap {
  float: left;
  line-height: 32%;
  margin-top: 0.24em;
  margin-right: 0.05em;
  margin-bottom: 0;
  margin-left: 0;
  font-size: 315%; /* ePub 2 lines */
  font-weight: bold;
}

@media amzn-kf8 {
  .text-dropcap {
	  /* font-size: 265%; /* 3 lines */
    font-size: 150%; /* 2 lines */
  }
}
Then, just <p><span class="text-dropcap">T</span>he dropcap demo.</p>.

KFX responds to the "amzn-kf8" media query, so that allows you to customize the font size. You have to use a much smaller font size than you would for EPUB. It appears that Amazon is using something like the draft CSS initial-letter, where all you supply is the size and and the renderer automatically figures out how to locate the drop cap where it belongs.

Unfortunately, my code won't work with actual KF8, because KF8 uses the same sizing as EPUB, but the media query overrides that.
nabsltd 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
Drop Caps Disappears Robertovr Calibre Companion 3 05-11-2021 01:48 PM
Best Way for Drop Caps Wlan ePub 62 07-03-2018 07:11 PM
Drop Caps question holdit Sigil 11 08-24-2014 08:01 AM
Drop caps RandyK Conversion 2 05-18-2014 09:13 PM
Drop caps huebi ePub 8 03-04-2012 06:25 AM


All times are GMT -4. The time now is 01:07 AM.


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