You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Marc Wiest <Ma...@getAbstract.com> on 2015/05/20 11:15:37 UTC

Clearing the hyphenation tree cache

May I suggest to add this method to the org.apache.fop.hyphenation.Hyphenator class?
I had to hack FOP and create a custom build for myself, because I need to reload the hyphenation files at runtime.
The use case is, that I have a web applications that allows on an admin page, to add hyphenation exceptions on-the-fly. In that case the hyphenation pattern files are re-created with the new exceptions but need to be reloaded by FOP. The below worked for me, please consider adding to the trunk.

Best,
Marc

/**
  * Clear the hyphenation tree cache, in case the underlying data files have changed at runtime.
  */
public static synchronized void clearHyphenationTreeCache() {
  hTreeCache = new HyphenationTreeCache();
}