EPUBGen is a Java library that demonstrates EPUB generation from a variety of document formats, and which may be a useful starting point or reference code for other EPUB generation needs. That is to say, it’s an effort to promote the development of a variety of tools and workflows.
EPUBGen has both a set of back-end code generation modules and front end format importer modules. The back-end modules generate EPUB and illustrate more advanced functionality, including font subset embedding with obfuscation
The code itself can be found on the epub-tools Google Code site, which includes other sub-projects witg Python/XSLT scripts for generating EPUB from DocBook and TEI XML. For more of the gory details on font embedding with obfuscation (aka “mangling”), which illustrates the recently published IDPF Tech Noteabout same, see this related blog post.