Wow very swift reply thanks both of you!

It seems i had the config.xml open twice, one being modified and the other
not and of course i saved the wrong one. I had already replaced those
attributes with metrics-url and embed-url.

It still doesnt seem to like Trebuchet however:

Anyway my config as of now (double checked!):

<?xml version="1.0"?>
> <fop version="1.0">
>   <base>.</base>
>   <source-resolution>72</source-resolution>
>   <target-resolution>72</target-resolution>
>   <default-page-settings height="11in" width="8.26in"/>
>   <renderers>
>     <renderer mime="application/pdf">
>       <filterList>
>         <value>flate</value>
>       </filterList>
>       <fonts>
>   <font metrics-url="file:///E:/FOPCONF/trebuc.xml" kerning="yes"
> embed-url="file:///E:/FOPCONF/trebuc.ttf">
>     <font-triplet name="Trebuchet MS" style="normal" weight="normal"/>
>   </font>
>   <font metrics-url="file:///E:/FOPCONF/trebucbd.xml" kerning="yes"
> embed-url="file:///E:/FOPCONF/trebucbd.ttf">
>     <font-triplet name="Trebuchet MS" style="normal" weight="bold"/>
>   </font>
>   <font metrics-url="file:///E:/FOPCONF/trebucbi.xml" kerning="yes"
> embed-url="file:///E:/FOPCONF/trebucbi.ttf">
>     <font-triplet name="Trebuchet MS" style="italic" weight="bold"/>
>   </font>
>   <font metrics-url="file:///E:/FOPCONF/trebucit.xml" kerning="yes"
> embed-url="file:///E:/FOPCONF/trebucit.ttf">
>     <font-triplet name="Trebuchet MS" style="italic" weight="normal"/>
>   </font>
>        </fonts>
>     </renderer>
>     <renderer mime="application/postscript">
>     </renderer>
>     <renderer mime="application/vnd.hp-PCL">
>     </renderer>
>     <renderer mime="image/svg+xml">
>       <format type="paginated"/>
>       <link value="true"/>
>       <strokeText value="false"/>
>     </renderer>
>     <renderer mime="application/awt">
>     </renderer>
>     <renderer mime="image/png">
>     </renderer>
>     <renderer mime="image/tiff">
>     </renderer>
>     <renderer mime="text/xml">
>     </renderer>
>     <renderer mime="text/plain">
>       <pageSize columns="80"/>
>     </renderer>
>   </renderers>
> </fop>


Adrien Cumiskey , what exactly do you mean with "a trunk version of FOP" ? A
thing I've noticed is that the Font metrics files compiled with TTFReader
puts this:

<?xml version="1.0" encoding="UTF-8"?>
> <font-metrics metrics-version="2"
> type="TYPE0"><font-name>TrebuchetMS</font-name><embed/>
>

Is there any particular reason it removes the space from the font name ?

Thanks in advance,

On 8/23/07, Adrian Cumiskey <[EMAIL PROTECTED]> wrote:
>
> Hi Martijn,
>
> My first thought it that it looks like you may be trying to use a 0.20
> configuration with a 0.93/trunk version of FOP.
>
> If you are using 0.93 or later version of FOP (which is highly
> recommended) then you should change each font definition in your
> configuration file to use a metrics-url attribute (not metrics-file),
> the same goes for embed-file, this should be embed-url (see
> http://xmlgraphics.apache.org/fop/trunk/configuration.html#renderers).
>
> So..
>
> <font metrics-file="E:\FOPCONF\trebuc.xml" kerning="yes"
> embed-file="E:\FOPCONF\trebuc.ttf">
>         <font-triplet name="Trebuchet MS" style="normal" weight="normal"/>
> </font>
>
> Should be something like..
>
> <font metrics-url="file:///E:/FOPCONF/trebuc.xml" kerning="yes"
> embed-url="file:///E:/FOPCONF/trebuc.ttf">
>         <font-triplet name="Trebuchet MS" style="normal" weight="normal"/>
> </font>
>
> If you are working with a trunk version of FOP then the metrics-url is
> not necessary as the font metrics parsing is done for you at runtime.
>
> Hope this helps.
>
> Adrian.
>
> Martijn Laarman wrote:
> > Hi,
> >
> > We are having a particularly hard time trying to get FOP to embedd
> > "Trebuchet MS" in to the result PDF.
> >
> > We successfully use FOP as a tomcat servlet however it seems that
> > something goes wrong when i try to add a configuration file for the
> > servlet:
> >
> >         public void init() throws ServletException {
> >             this.log = new SimpleLog("FOP/Servlet");
> >             log.setLevel(SimpleLog.LOG_LEVEL_WARN);
> >             this.uriResolver = new
> >     ServletContextURIResolver(getServletContext());
> >             this.transFactory = TransformerFactory.newInstance();
> >             this.transFactory.setURIResolver(this.uriResolver);
> >             //Configure FopFactory as desired
> >             this.fopFactory = FopFactory.newInstance ();
> >             File temp = new File("E:/FOPCONF/testconfig.xml");
> >             this.fopFactory.setUserConfig(temp);
> >             this.fopFactory.setFontBaseURL("file:///E:/FOPCONF/");
> >              this.fopFactory.setURIResolver (this.uriResolver);
> >             configureFopFactory();
> >         }
> >
> >
> > In particular its this line:
> >
> >        this.fopFactory.setUserConfig(temp);
> >
> >
> > That throws an "Unhandled exception type SAXException", compiling seems
> > to work do so errorless and placing the new war file as tomcat servlet
> > goes ok as well and the servlet still works without errors however
> > Trebuchet MS is still not recognized.
> >
> > Heres the E:/FOPCONF/testconfig.xml:
> >
> >     <?xml version="1.0"?>
> >     <fop version="1.0">
> >       <base>.</base>
> >       <source-resolution>72</source-resolution>
> >       <target-resolution>72</target-resolution>
> >       <default-page-settings height="11in" width="8.26in"/>
> >       <renderers>
> >         <renderer mime="application/pdf">
> >           <filterList>
> >             <value>flate</value>
> >           </filterList>
> >           <fonts>
> >       <font metrics-file="E:\FOPCONF\trebuc.xml" kerning="yes"
> >     embed-file="E:\FOPCONF\trebuc.ttf">
> >         <font-triplet name="Trebuchet MS" style="normal"
> weight="normal"/>
> >       </font>
> >       <font metrics-file="E:\FOPCONF\trebucbd.xml" kerning="yes"
> >     embed-file="E:\FOPCONF\trebucbd.ttf">
> >         <font-triplet name="Trebuchet MS" style="normal" weight="bold"/>
> >       </font>
> >       <font metrics-file="E:\FOPCONF\trebucbi.xml" kerning="yes"
> >     embed-file="E:\FOPCONF\trebucbi.ttf">
> >         <font-triplet name="Trebuchet MS" style="italic" weight="bold"/>
> >       </font>
> >       <font metrics-file="E:\FOPCONF\trebucit.xml" kerning="yes"
> >     embed-file="E:\FOPCONF\trebucit.ttf">
> >         <font-triplet name="Trebuchet MS" style="italic"
> weight="normal"/>
> >       </font>
> >            </fonts>
> >         </renderer>
> >         <renderer mime="application/postscript">
> >         </renderer>
> >         <renderer mime="application/vnd.hp-PCL">
> >         </renderer>
> >         <renderer mime="image/svg+xml">
> >           <format type="paginated"/>
> >           <link value="true"/>
> >           <strokeText value="false"/>
> >         </renderer>
> >         <renderer mime="application/awt">
> >         </renderer>
> >         <renderer mime="image/png">
> >         </renderer>
> >         <renderer mime="image/tiff">
> >         </renderer>
> >         <renderer mime="text/xml">
> >         </renderer>
> >         <renderer mime="text/plain">
> >           <pageSize columns="80"/>
> >         </renderer>
> >       </renderers>
> >     </fop>
> >
> > Could someone please guide me trough how to add "Trebuchet MS" to my PDF
> > output ?
> >
> > It would be much appreciated !
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to