IMPORTANT UPDATE: TRAJAN PRO is an Adobe font whose license DOES NOT allow embedding on websites or ebooks using @font-face. See comment section on details and links to Adobe licensing.
When choosing a font to embed, make sure you have the legal right to do so.
Many authors want to spice up their pages by adding attractive typefaces and fonts. This can add a lot of interest to your book IF you don’t overdo it.
What you need to embed fonts
- Include your fonts in your ebook
- List your fonts in the CSS first
- Link to font
Finding a Typeface:
There are literally thousands to choose from and many are free for the using. But is more better? Not always. I find that I stick with about 12 typefaces for page layout. I call them my apostles, and they cover the basics of what I need: serif, san-serif, heavy, thin,fancy, plain, grunge. I recommend you find a few typefaces you like and keep them organized on your computer.
LINGO TO KNOW
Typeface: In typography, a typeface is the visual representation or interpretation of a set of characters; it is their appearance. Each typeface is designed, and there are thousands of different typefaces in existence, with new ones being developed constantly. Wikipedia
TTF or OTF?
Should you use a True Type Font (TTF) or Open Type Font (OTF)? Both should work, but in my testing I found OTF to work better in the long run. (at least for me.)
When I have a TTF I want to use that is being obstinate – not displaying correctly all the time – then I convert it to an OTF.
Resource: Convert your TTF fonts to OTF using this free Online Font Converter, http://onlinefontconverter.com/
Create the Cascading Style Sheet
The style sheet for you file can be either inline or a separate file. I either case, the fonts must be the first items listed. You need one declaration for each font (normal, bold, italic, etc).
LINGO TO KNOW
Cascading Style Sheet: Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL. Wikipedia
I prefer to name my fonts without spaces or underscores – just one word. If the name is two or more words then it MUST BE enclosed in quotes.
font-family: “Font Pro”;
The CSS Code for Font Pro:
Substitute FontPro for the name of your chosen font.
Applying the font-family to your tags
In your CSS apply the font-family to the tags you want displayed as Font Pro.
Adding the fonts to your ebook ‘package’.
The actual fonts need to be included with the file (.epub or .mobi). I prefer place all my fonts in a separate folder named “Fonts”. If you place them somewhere other than in a font folder then modify the CSS to the correct location.
NOTE: SIGIL automatically puts the fonts in the “Fonts” folder.
Excerpt from: Embedding Fonts: First Steps Supplement