Quote:
Originally Posted by Hitch
I love Ruben, but that formatting is going to go straight to hell the moment someone with Coolreader opens it. And it won't survive the Kindle process, either, for KF7, I don't think. Or KF8, given the line-height requirement.
Hitch
|
Hi Hitch;
Happy New Year

Yes, you are right, but in CoolReader nothing works, since it doesn't support "float" and many others css2 properties. Regarding Kindle, well, that's an interesting case. Sometime ago (about two years) I spent a lot of time trying to find a way to get a perfect drop cap with any Kindle device (e-ink or Fire models), with any font size, with any font family (with Kindle e-inks you have six fonts to choose). I wanted something consistently displayed, regardless of device used. Could that be possible? After lots of trial and error, I found the only way to get that target was with an image, so I decided to employ a SVG image. With the following code you can get a perfect drop cap for all Kindle models (forget for the moment KF7):
Code:
/* Style to set the grey square */
.KDropSpace {
float: left;
font-size: 4.6em;
width: 1em;
height: 1em;
background: grey;
padding: 5px;
margin: 0 5px -0.1em 0;
}
/* Style to fit the DropCap inside the grey square */
.KSVGDropCap {
display: block;
position: relative;
top: 0em;
left: 0.05em;
font-size: 1.2em;
font-weight: bold;
font-family: sans-serif;
width: 0.8em;
height: 0.8em;
text-align: center;
}
/* Styles for old Kindle models */
@media not amzn-mobi {
.NotKF8 {
display: none;
}
}
And in the .xhtml file:
Code:
<h1>SVG Drop Cap for Kindle</h1>
<p><span class="KDropSpace"><img alt="B" class="KSVGDropCap" src="../Images/B.svg" /></span><span class="NotKF8"><b>B</b></span>ehind the walls of Augustine,<br />
he notes the seven traits of plants<br />
and how their combinations<br />
tell us that what was shall surely be<br />
again. He writes of <i>dominance</i><br />
and <i>recession</i>, of the patterns</p>
These are screenshots of Kindle Previewer for all Kindle models:
Below you can check the respective epub, with the SVG image for the letter "B". Regarding KF7, you know, we can't get there drop caps, so I displayed the first letter as bold.
Regards
Rubén