Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
2.5
-
None
-
None
-
Operating System: other
Platform: Other
-
41831
Description
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
prepare it!
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
options :-
<!-- 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 -->
<cache-fonts>true</cache-fonts>
<!-- 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
for you-->
<cache-file>C:\MyDir\fop.cache</cache-fonts>
<renderers>
<renderer mime="application/pdf">
<fonts>
<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"/>
</font>
<!-- any fonts found in this directory will be automatically added -->
<directory recursive="true">C:\MyFonts</directory>
<!-- your native o/s will be searched and any fonts found will be automatically
added -->
<auto-detect/>
</fonts>
<renderer>
</renderers>
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
org.apache.fop.fonts.Font.STYLE_NORMAL added
org.apache.fop.fonts.Font.STYLE_ITALIC added
Please try the patch out, let me know if I have missed or broken anything,
feedback is welcome .
Attachments
Attachments
Issue Links
- is duplicated by
-
FOP-1304 [PATCH] Strict url validation of user config
- Closed