DocBook to EPUB Transformation
The EPUB specification recommends the use of OpenType fonts (recognized by their
.otf file extension) when possible. To use a specific font, follow
these steps:
- Declare it in your CSS file, as in the following
example:
@font-face { font-family: "MyFont"; font-weight: bold; font-style: normal; src: url(fonts/MyFont.otf); } - In the CSS, specify where this font is used. To set it as default for
h1elements, use thefont-familyrule, as in the following example:h1 { font-size:20pt; margin-bottom:20px; font-weight: bold; font-family: "MyFont"; text-align: center; } - In your DocBook to EPUB transformation, set the
epub.embedded.fontsparameter tofonts/MyFont.otf. If you need to provide more files, use commas to separate their file paths.
Note: The
html.stylesheet parameter allows you to include a custom CSS in
the output EPUB.