View Single Post
Old 07-19-2012, 12:11 PM   #5
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
I assume you're using Sigil to build an ePub that you will eventually convert into azw3/kf8.

What you have to do is quite simple.

1st: load/edit your ePub.
2nd: add your TTF fonts in the "fonts" directory.
3rd: modify your CSS to load those fonts like this:
Spoiler:

Code:
@font-face {
  font-family: "My Font";
  font-weight: normal;
  font-style: normal;
  src: url("../Fonts/my font file plain.ttf");
}

@font-face {
  font-family: "My Font";
  font-weight: normal;
  font-style: italic;
  src: url("../Fonts/my font file italic.ttf");
}

@font-face {
  font-family: "My Font";
  font-weight: bold;
  font-style: normal;
  src: url("../Fonts/my font file bold.ttf");
}

@font-face {
  font-family: "My Font";
  font-weight: bold;
  font-style: italic;
  src: url("../Fonts/my font file italic bold.ttf");
}

@font-face {
  font-family: "My Font";
  font-weight: normal;
  font-style: normal;
  font-variant: small-caps;
  src: url(../Fonts/my font file smallcaps.ttf);
}

body
{
   font-family: My Font;
}

In short: you load fonts into your ePub, add proper @font-face directives and then you actually use them as you would normally do with CSS.

After you have done this, you have to save your ePub and convert it.

Current version of Calibre does not handle correctly font embedding in AZW3/KF8 but next one should do it (see a similar thread in the Calibre forum).

At the moment you have to use Amazon KindleGen or KindlePreviewer. They're both freeware. In particular, KindlePreviewer allows you to load the ePub, convert it into KF8, and preview the result as it would appear in your Kindle Fire or Kindle Touch with firmware >= 5.1.0 /Kindle 4NT with firmware >= 4.1.0.

Remember to check the font license to see under which conditions you can distribute it. Also remember that fonts can be huge.

Last edited by pirl8; 07-19-2012 at 12:18 PM.
pirl8 is offline   Reply With Quote