Affects Version/s: trunk
Fix Version/s: None
Environment:Operating System: other
External issue ID:41831
This patch includes quite a few things (apologies for its size but in this case
I felt it best to refactor before adding additional functionality). The only
consolation is that it should take you less time to apply it than it took me to
Firstly it includes a refactoring of FOP configuration so FOP components no
longer have a direct dependency on the deprecated avalon configuration framework
(renderers no longer implement
org.apache.avalon.framework.configuration.Configurable). Every component that
requires configuration has an associated configuration class in
org.apache.fop.config. Configuration is now achieved by simply calling
FopConfig.configure(fopComponent) from the component (factory, renderers etc).
Secondly it this patch includes some additional FOP configuration options which
allow the user to define a font directory or to automatically detect fonts
installed on the native operating system, the results of which can be cached for
subsequent FOP executions. This should make font configuration much easier for
the standard user.
The patch also includes a rewrite of the resolve method in FOURIResolver and a
general tightening up of the FOP configuration (including a renaming and an
improvement in the unit tests).
Here is an example FOP configuration file demostrating the new configuration
<!-- by default this option is set to true and is only present here to show its
existence in the event that you may wish to turn off font caching -->
<!-- you can specify where the cache file should be, but by default you
shouldn't need to configure or worry about this, it will be set automatically
<font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
<!-- any fonts found in this directory will be automatically added -->
<!-- your native o/s will be searched and any fonts found will be automatically
This new font configuration/caching functionality is excluded from the
specialised AFP font configuration.
Native font finding and font triplet info indentification may need to be tweaked
but seems to work pretty well from my tests on the standard true type fonts
included with windows.
Other changes :-
org.apache.fop.fonts.Font.BOLD renamed to org.apache.fop.fonts.Font.WEIGHT_BOLD
org.apache.fop.fonts.Font.NORMAL renamed to org.apache.fop.fonts.Font.WEIGHT_NORMAL
Please try the patch out, let me know if I have missed or broken anything,
feedback is welcome .