DocBook to EPUB Transformation
Oxygen XML Editor Eclipse plugin includes a built-in transformation scenario that is designed to
convert DocBook content to EPUB. The EPUB specification recommends the use of OpenType
fonts (recognized by their .otf file extension) whenever 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
<h1>elements, use thefont-familyrule, as in the following example:h1 { font-size:20pt; margin-bottom:20px; font-weight: bold; font-family: "MyFont"; text-align: center; } - Open the Configure Transformation Scenario(s) dialog box, select the DocBook EPUB transformation scenario in the DocBook 4 or DocBook 5 section, and click Edit.
- In the Parameters tab, set the
epub.embedded.fontsparameter tofonts/MyFont.otf. If you need to provide more files, use commas to separate their file paths.Note:Thehtml.stylesheetparameter allows you to include a custom CSS in the output EPUB. - Run the transformation scenario.