You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Sem.Flamez" <Se...@smals.be> on 2007/12/19 10:16:04 UTC

Registering fonts, stored inside a library.

Hello,

We're trying to generate PDF/A files using fonts which are stored inside a
library "test.jar".
We try to register the fonts based on a relative directory-URL with the
following configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<fop>
  <base>.</base>
  <font-base>.</font-base>
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
        <directory>fonts</directory>
      </fonts>
    </renderer>
  </renderers>
</fop>

The structure of the test.jar library is:

test.jar
     src
          <!-- contains rendering stuff -->
     config
          config.xml
     fonts
          font.ttf

When we start Tomcat from within Eclipse, the base URL is resolved to the
root directory of our Eclipse installation instead of the root of the
test.jar library.

Does anyone have an idea what we're doing wrong?

Thanks.
-- 
View this message in context: http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14413386.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Registering fonts, stored inside a library.

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
In that case, you should not set a base directory in the configuration
file but instead set it on the FOUserAgent (or FopFactory) instance. I'm
sure you can find out the correct base URL for each environment and then
you'd set that using FopFactory.setBaseURL() and
FOUserAgent.setFontBaseURL(). But I'm not sure if the font
autoconfiguration will work correctly. You'll have to try it out.

On 20.12.2007 10:48:43 Sem.Flamez wrote:
> 
> Hey Jeremias,
> 
> Unfortunately, it's not just about running it from Eclipse. The same problem
> occurs when the webapp containing the library is deployed on a WebLogic
> server. In that case, the base URL is resolved to the root of the server
> domain instead of the root of the library.
> 
> Is there no work-around possible with FOP 0.94, because company policy
> prohibits use of non-stable releases of external libraries.
> 
> Regards,
> 
> Sem Flamez
> 
> 
> 
> Jeremias Maerki-2 wrote:
> > 
> > If it's just about running from within Eclipse, you can modify the
> > "Working Directory" in the launch configuration in Eclipse to point at
> > the right directory.
> > 
> > BTW, FOP Trunk has a new feature that allows FOP to auto-detect fonts in
> > JAR files if you follow certain conventions described here:
> > http://svn.apache.org/viewvc?rev=602898&view=rev
> > (Website not updated, yet)
> > 
> > On 19.12.2007 10:16:04 Sem.Flamez wrote:
> >> 
> >> Hello,
> >> 
> >> We're trying to generate PDF/A files using fonts which are stored inside
> >> a
> >> library "test.jar".
> >> We try to register the fonts based on a relative directory-URL with the
> >> following configuration file:
> >> 
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <fop>
> >>   <base>.</base>
> >>   <font-base>.</font-base>
> >>   <renderers>
> >>     <renderer mime="application/pdf">
> >>       <fonts>
> >>         <directory>fonts</directory>
> >>       </fonts>
> >>     </renderer>
> >>   </renderers>
> >> </fop>
> >> 
> >> The structure of the test.jar library is:
> >> 
> >> test.jar
> >>      src
> >>           <!-- contains rendering stuff -->
> >>      config
> >>           config.xml
> >>      fonts
> >>           font.ttf
> >> 
> >> When we start Tomcat from within Eclipse, the base URL is resolved to the
> >> root directory of our Eclipse installation instead of the root of the
> >> test.jar library.
> >> 
> >> Does anyone have an idea what we're doing wrong?
> >> 
> >> Thanks.
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14413386.html
> >> Sent from the FOP - Users mailing list archive at Nabble.com.
> > 
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14433466.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Registering fonts, stored inside a library.

Posted by "Sem.Flamez" <Se...@smals.be>.
Hey Jeremias,

Unfortunately, it's not just about running it from Eclipse. The same problem
occurs when the webapp containing the library is deployed on a WebLogic
server. In that case, the base URL is resolved to the root of the server
domain instead of the root of the library.

Is there no work-around possible with FOP 0.94, because company policy
prohibits use of non-stable releases of external libraries.

Regards,

Sem Flamez



Jeremias Maerki-2 wrote:
> 
> If it's just about running from within Eclipse, you can modify the
> "Working Directory" in the launch configuration in Eclipse to point at
> the right directory.
> 
> BTW, FOP Trunk has a new feature that allows FOP to auto-detect fonts in
> JAR files if you follow certain conventions described here:
> http://svn.apache.org/viewvc?rev=602898&view=rev
> (Website not updated, yet)
> 
> On 19.12.2007 10:16:04 Sem.Flamez wrote:
>> 
>> Hello,
>> 
>> We're trying to generate PDF/A files using fonts which are stored inside
>> a
>> library "test.jar".
>> We try to register the fonts based on a relative directory-URL with the
>> following configuration file:
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <fop>
>>   <base>.</base>
>>   <font-base>.</font-base>
>>   <renderers>
>>     <renderer mime="application/pdf">
>>       <fonts>
>>         <directory>fonts</directory>
>>       </fonts>
>>     </renderer>
>>   </renderers>
>> </fop>
>> 
>> The structure of the test.jar library is:
>> 
>> test.jar
>>      src
>>           <!-- contains rendering stuff -->
>>      config
>>           config.xml
>>      fonts
>>           font.ttf
>> 
>> When we start Tomcat from within Eclipse, the base URL is resolved to the
>> root directory of our Eclipse installation instead of the root of the
>> test.jar library.
>> 
>> Does anyone have an idea what we're doing wrong?
>> 
>> Thanks.
>> -- 
>> View this message in context:
>> http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14413386.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14433466.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Registering fonts, stored inside a library.

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
If it's just about running from within Eclipse, you can modify the
"Working Directory" in the launch configuration in Eclipse to point at
the right directory.

BTW, FOP Trunk has a new feature that allows FOP to auto-detect fonts in
JAR files if you follow certain conventions described here:
http://svn.apache.org/viewvc?rev=602898&view=rev
(Website not updated, yet)

On 19.12.2007 10:16:04 Sem.Flamez wrote:
> 
> Hello,
> 
> We're trying to generate PDF/A files using fonts which are stored inside a
> library "test.jar".
> We try to register the fonts based on a relative directory-URL with the
> following configuration file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <fop>
>   <base>.</base>
>   <font-base>.</font-base>
>   <renderers>
>     <renderer mime="application/pdf">
>       <fonts>
>         <directory>fonts</directory>
>       </fonts>
>     </renderer>
>   </renderers>
> </fop>
> 
> The structure of the test.jar library is:
> 
> test.jar
>      src
>           <!-- contains rendering stuff -->
>      config
>           config.xml
>      fonts
>           font.ttf
> 
> When we start Tomcat from within Eclipse, the base URL is resolved to the
> root directory of our Eclipse installation instead of the root of the
> test.jar library.
> 
> Does anyone have an idea what we're doing wrong?
> 
> Thanks.
> -- 
> View this message in context: http://www.nabble.com/Registering-fonts%2C-stored-inside-a-library.-tp14413386p14413386.html
> Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org