// include fonts
// embed fonts
// NB: on non-Windows platforms you need to supply your own
// FontLocator implementation or place fonts in ~/.epubfonts
if (getFontsPath() != null && getFontsPath().trim().length() > 0) {
FontLocator fontLocator = new SinglePathFontLocator(getFontsPath());
getEpub().cascadeStyles();
getEpub().addFonts(getStyleResource(), fontLocator);
}
OCFContainerWriter writer = new OCFContainerWriter(new FileOutputStream(getEpubFilename()));
getEpub().serialize(writer);