On Fri, Jul 09, 2004 at 11:00:08AM +0200, tango ray wrote:

> Add a font in fop app is really hard !!!

Chris warned you, this version of FOP is under heavy
development. Support for user configuration and adding fonts is
patchy.

Well, was, I hope. I have just committed code which enables using a
user configuration file and adding fonts from it.

Usage:

- Command line: point to a configuration file similar to
  conf/fop.xconf. 
- From an app: add a configuration object to the FOUseragent object,
  using the method setUserConfig(userConfig), where userConfig is an
  avalon user configuration object similar to the configuration object
  obtained from conf/fop.xconf.
- From an app when you supply your own renderer: configure the
  renderer as an avalon Configurable object:
  renderer.configure(rendererConfig), where rendererConfig is an
  avalon renderer configuration object similar to the configuration
  object obtained from one of the renderer elements in
  conf/fop.xconf.

I have enabled some debugging. Set the loggers called FOP,
org.apache.fop.render and org.apache.fop.fonts to debug
level. Remember that this version of FOP uses Apache Commons
logging. See there for documentation. Example:

Fri Jul  9 -- 19:17:51 -- distelvlinder:~/programmeren/fop
>JAVA_FLAGS="-Dorg.apache.commons.logging.simplelog.log.FOP=debug 
>-Dorg.apache.commons.logging.simplelog.log.org.apache.fop.render=debug 
>-Dorg.apache.commons.logging.simplelog.log.org.apache.fop.fonts=debug" fop-run 
>-c configuration-error.xml test-prop1.fo test-prop1.pdf
Using class path: 
/source/xml-fop/build/classes:/home/simon/programmeren/java/classes:/usr/local/javaclasses
[DEBUG] FOP - -No user configuration found for MIME type application/pdf

Fri Jul  9 -- 19:18:06 -- distelvlinder:~/programmeren/fop
>JAVA_FLAGS="-Dorg.apache.commons.logging.simplelog.log.FOP=debug 
>-Dorg.apache.commons.logging.simplelog.log.org.apache.fop.render=debug 
>-Dorg.apache.commons.logging.simplelog.log.org.apache.fop.fonts=debug" fop-run 
>-c configuration.xml test-prop1.fo test-prop1.pdf
Using class path: 
/source/xml-fop/build/classes:/home/simon/programmeren/java/classes:/usr/local/javaclasses
[DEBUG] FOP - -User configuration found for MIME type application/pdf
[DEBUG] render - -Adding PDF filter for type content: null
[DEBUG] fonts - -Adding font arial.ttf, metric file arial.xml
[DEBUG] fonts - -Font triplet Arial, normal, normal
[DEBUG] fonts - -Font triplet ArialMT, normal, normal
[DEBUG] fonts - -Adding font arialb.ttf, metric file arialb.xml
[DEBUG] fonts - -Font triplet Arial, bold, normal
[DEBUG] fonts - -Font triplet ArialMT, bold, normal

Good luck, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to