Skip to main content
Known Participant
January 10, 2013
Answered

Fonts in EPUB files

  • January 10, 2013
  • 2 replies
  • 11911 views

When I generate output as an eBook, the results do not use the correct fonts.  I assume I need to embed the fonts somehow, but I have not been able to find a way to do this. 

The font names are listed in the .css file, so I don't think that's the problem.

I'm using RoboHelp 10, and using EPUB3 as the eBook format.

This topic has been closed for replies.
Correct answer Willam van Weelden

Hi,

Font names alone may not be sufficient. Most readers will only support a handful of default fonts and if you want users to be able to use other fonts as well, you need to embed those fonts in your epub. This will require you to add the fonts as baggage files and modify the CSS to load the required fonts. See http://blog.threepress.org/2009/09/16/how-to-embed-fonts-in-epub-files/ for more information on embedding fonts.

Greet,

Willam

2 replies

Known Participant
January 17, 2013

Thank you, William.  Your reply was correct, and I was able to make it work.

Here is some additional information, in case anyone has a similar problem in the future.

First, the actual font files (.ttf or .otf) must be added to the Baggage Files directory.  In addition, it’s necessary to include a statement like this in the .css file:

@font-face {

                font-family: Tahoma;

                font-weight: normal;

                font-style: normal;

                src: url(Tahoma.otf);

}

After I did that, I was usually able to see the fonts I wanted in the eBook. 

Note, however, that it is hard to get consistent results.  I tried four or five different eBook readers, and the file is rendered differently in every one.  Some readers do a pretty good job, and some do not.  I don’t think that's a RoboHelp problem, or even an Adobe problem.  The EPUB format seems to be very limiting, and the variation between readers is very great.

Willam van Weelden
Inspiring
January 17, 2013

Hi,

Glad it's working. To expand on your last remark: Not all epub readers support custom fonts. So you can't rely on the font being used. Always specify a 'backup font' in the css that is universal. Example:

p {

font-family: Tahoma, Arial;

}

Greet,

Willam

Willam van Weelden
Willam van WeeldenCorrect answer
Inspiring
January 12, 2013

Hi,

Font names alone may not be sufficient. Most readers will only support a handful of default fonts and if you want users to be able to use other fonts as well, you need to embed those fonts in your epub. This will require you to add the fonts as baggage files and modify the CSS to load the required fonts. See http://blog.threepress.org/2009/09/16/how-to-embed-fonts-in-epub-files/ for more information on embedding fonts.

Greet,

Willam