[Refdb-users] Add capability for FOP user configuration file
Status: Beta
Brought to you by:
mhoenicka
|
From: David N. <dav...@sw...> - 2004-06-27 05:38:48
|
Markus, I've been figuring out how to add fonts to FOP and XEP (specifically, TeX's default font of Computer Modern). Adding fonts to FOP requires the creation of a user configuration file which is passed to FOP at execution time as a command line parameter. [For more information, see <http://xml.apache.org/fop/configuration.html> (the fop configuration file) and <http://www.sagehill.net/docbookxsl/AddFont.html> (adding fonts to fop and xep).] Adding support to refdb for FOP's configuration file requires four minor tweaks to the refdbxml and refdbxmlrc files: 1. Add the following lines to refdbxmlrc (I put them just after the FO Classpath section). ................................................................................ ## FOP configuration file (optional) #fop_config_file ................................................................................ You may want to add a sample configuration file for illustrative purposes: ................................................................................ ## FOP configuration file (optional) #fop_config_file /home/user/fop/cfg.xml ................................................................................ A few small alterations are made to refdbxml. 2. Initialise variable 'fop_config_file' and set to an empty string. This is not really necessary but follows the script's pattern. I added them around line 40 (just after <<fo_classpath="">>). ................................................................................ # FOP can accept a user configuration file parameter fop_config_file="" ................................................................................ 3. The value must be extracted from the config file. Add the following to the various 'if' statements around line 80. ................................................................................ if [ $refdbvar = fop_config_file ]; then fop_config_file="-c $refdbval" fi ................................................................................ 4. Finally, add the 'fop_config_file' variable to the FOP execution command. No conditionals are needed -- if the user did not specify a config file the variable is empty and makes no difference. If the previous alterations have been made, this command is on or about line 188. ................................................................................ java -cp "$fo_classpath" org.apache.fop.apps.Fop $fop_config_file -fo $1 -pdf $2;; ................................................................................ Regards, David. |