View Full Version : smallcaps how to?


JSWolf
09-17-2009, 11:33 AM
How would I use a smallcap font in an ePub file? Thanks!

Jellby
09-17-2009, 11:55 AM
Use "font-variant: small-caps"

... and a reader other than Adobe's :rolleyes:

Other than that, you'd have to fake them by hardcoding the caps and using a smaller font-size:

<span style="font-variant: small-caps">Real smallcaps</span>

F<span style="font-size: 80%">AKED SMALLCAPS</span>

JSWolf
09-17-2009, 12:00 PM
The font is a smallcaps font already. I just want the ePub to use it.

Jellby
09-17-2009, 12:26 PM
Then I guess it's the same as with any other font, at most you'd have to specify the font-variant in the @font-face. You need to define the font in the CSS:

@font-face{
font-family: "My smallcaps font";
font-variant: small-caps;
src: url("../relative/path/to/the/font.ttf") format("truetype");
}

body {
font-family: "My smallcaps font";
}

Then you have to include the font.ttf file in the epub and add the corresponding line to the <manifest>.

JSWolf
10-01-2009, 08:16 AM
Ok, I've got small caps sorted. But one thing you have to do is convert the uppercase of the small caps to lowercase or it just looks like all uppercase. When a book does smallcaps, it just uses some small font size of all caps. So just setting the font does not work. You also have to convert the words to lowercase or upper/lower.

Jellby
10-01-2009, 11:06 AM
Yes, of course :smack:

You could use text-transform:lowercase, if it were supported, but that wouldn't work if there are real uppercase letters mixed with the smallcaps.