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);
//TODO: uncomment for testing stylesheet optimization
//Utils.optimizeStylesheet(getStyleResource());