View Single Post
Old 04-09-2014, 08:38 PM   #5
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,771
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by mandy314 View Post
thank you for your replies

@RbnJrg
Nice drop caps - but I wouldn't know how to align the float with the text baseline (and keep the Kindle option for resizing the font) to get a raised cap. Always fascinating to see what css is supported (and what not).
Try this:

1. In your css stylesheet write:

Code:
@font-face {
   font-family: "Marnie";
   font-weight: normal;
   font-style: normal;
   src: url("../Fonts/Marnie.ttf");
}

h1 {
   font-size: 1.4em;
   text-align: center;
   margin-bottom: 2em;
}

p {
   font-size: 1em;
   text-align: justify;
   text-indent: 0;
}

p + p {
   text-indent: 1.2em;
}

.raised_cap {
   float: left;
   font-family: "Marnie";
   font-size: 4em;
   margin-top: -0.75em;  /* play with this value */
   margin-bottom: -0.6em; /* play with this value */
   height: 1em;
}
2. Write the following in your .xhtml file:

Code:
<body>
  <h1>This is the title</h1>

  <p><span class="raised_cap">L</span>orem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.</p>
In Sigil and ADE doesn't look fine but in Kindle Previewer (AND YOU ARE SEEKING SOMETHING FOR KF8 ) looks very nice (not only for KPW but also for KFHD); watch for yourself:

Click image for larger version

Name:	Image1.png
Views:	414
Size:	115.2 KB
ID:	121486

Of course, you'll have to write some code to manage the old Kindle devices since the code I wrote only works for devices who support the .kf8 format. Below you can see the respective epub.

Regards
Rubén
Attached Files
File Type: epub Raised Cap.epub (34.7 KB, 305 views)

Last edited by RbnJrg; 04-09-2014 at 08:46 PM.
RbnJrg is offline   Reply With Quote