So far in this series, I have covered how to setup a fixed format ebook, how to add images, and how to place text. In this post I’ll go over how to embed fonts, to make your ebook even more unique. You can use this trick for both fixed format ebooks and reflowable ebooks.
The first thing I want to mention is that you can embed any font you like in your book, so long as you have the rights to use the font.
The easiest way to embed the font is to upload it to Sigil, which you can do by adding existing files to the Fonts folder.
In the OPF file, you should see something like this:
<item href=”Fonts/SMILAGE_.otf” id=”SMILAGE_.otf” media-type=”application/vnd.ms-opentype” />
under the <manifest>
I’m using the font SMILAGE as an example, so whatever font you choose will have a different name.
Next you’ll need to write some rules in your CSS stylesheet so your ebook will include the new font. Start with “@font-face”. Here is an example using the SMILAGE font:
@font-face {
font-family: “SMILAGE”;
font-style: normal;
font-weight: normal;
src:url(“../Fonts/SMILAGE_.otf”);
}
You can use the exact same code I used, just make sure to change the file and font names. You can also use it as a starting point, and change the style and weight to whatever you want.
Last, you’ll want to create a style in your CSS that actually uses the embedded font. In my example, I created a paragraph style:
p {
font-family: “SMILAGE”;
font-size: 38px;
letter-spacing: 2px;
position:absolute;
text-align: left;
color:#8A4117;
line-height: 150%;
}
Since I used the p tag, every paragraph in the book will use that font, size, letter-spacing, etc. You have the option of adding, deleting, or editing any of those styles for your own ebook.
If you follow all those steps, your text will look like the text in the first image of this post.
I think this helps give my ebook more of a children’s book feel.
Next post, I’ll cover how to add read aloud capabilities to your fixed format ebook. This only works for books sold on Apple (basically iPad), but it’s a great feature that can highlight words as they are narrated.
[…] Ricci presents How to Create a Fixed Format Ebook (Part 4): Embedding Fonts posted at Digital Pubbing, saying, “So far in this series, I have covered how to setup a […]