Check this project:
http://pasind.tsx.org (or http://pasind.zde.cz\)

It is not been developed anymore and source code is mainly in C, so not usable for you, but it has quite lot of formating possibilities you could find interesting to implement in JCF.