Thread: Epub & fonts
View Single Post
Old 07-27-2009, 08:30 AM   #6
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by Jellby View Post
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.
Hmm. I think is going to finally push me into using a separate css file.

Will that @font-face declaration work if it's between the style tags in the header of an html file? If so, then becuase calibre will extract the data this means I can continue to use MobiCreator.
Nate the great is offline   Reply With Quote