Thread: Epub & fonts
View Single Post
Old 07-27-2009, 06:34 AM   #5
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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Nate the great View Post
Would this be correct? I'm not quite certain what the id is for.

<item id="Tahoma" href="Tahoma_KOI8.ttf" media-type="application/x-truetype-font" />
That would be fine if Tahoma_KOI8.ttf sits at the same directory as the .opf file. The "id" is only a label you have to give to the file, as you have to do with every other file you include in the ePUB, images included. As far as I know the "id" is only really used in the <spine>, though.

In the .css files, you need the @font-face statement, and in the src property the url must be relative to where the .css sits. Like this:

Code:
@font-face {
  font-family: "Dearest";
  src: url("../fonts/Dearest.ttf") format("truetype");
}
The .css is in OEBPS/css, and the .ttf in OEBPS/fonts.

As examples, of my ePUBs, "The Prince and the Pauper", "Savage Stories of Conan", "Don Quijote" and "Novelas Ejemplares" use embedded fonts.
Jellby is offline   Reply With Quote