Hi,
fopFactory.setUserConfig(new File(userConfigPath));
works for me !!!

To generate a FOP font metrics file (.xml) and create a UserConfigFile, I
have done what's explained here:
http://www.sagehill.net/docbookxsl/AddFont.html
http://xmlgraphics.apache.org/fop/0.94/fonts.html

I use FOP 0.95beta1
but setUserConfig works only after I have excluded the default dependency
and add one manually.
That's from my pom.xml file : 

<dependency>
                <groupId>org.apache.xmlgraphics</groupId>
                <artifactId>fop</artifactId>
                <version>0.95beta-1</version>
                <exclusions>
                        <exclusion>
                                <groupId>org.apache.avalon.framework</groupId>
                                <artifactId>avalon-framework-api</artifactId>
                        </exclusion>
                </exclusions>
        </dependency>
        <dependency>
                <groupId>avalon</groupId>
                <artifactId>avalon-framework</artifactId>
                <version>4.1.4</version>
        </dependency>





eborisow wrote:
> 
> 
> Alias John Brown wrote:
>> 
>> 
>> According to the documentation at 
>> http://xmlgraphics.apache.org/fop/0.95/fonts.html#basics
>> 
>> "It is currently not possible to easily configure fonts from Java code."
>> 
>> I assume that this means that it is not impossible, but I have no idea
>> how. Hopefully an expert will turn up soon.
>> 
>> 
> 
> John,
> 
> Thanks for the reply.  I have also tried specifying the config file using
> the method in the docs.  Here is what I tried:
> 
>             DefaultConfigurationBuilder cfgBuilder = new
> DefaultConfigurationBuilder();
>             Configuration cfg = cfgBuilder.buildFromFile(new File(baseDir,
> "Local\\personal\\durkan\\projects\\fop\\new-font.conf.xml"));
>             fopFactory.setUserConfig(cfg);
> 
> This gives me the same result.  The fonts are not available.  So, I am
> probably doing something wrong.
> 
> Thanks,
> Eric
> 

-- 
View this message in context: 
http://www.nabble.com/Trying-to-programmatically-add-fonts-tp19334713p19840816.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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

Reply via email to