xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxime Bégnis <max...@neodoc.biz>
Subject Re: fonts URL resolution
Date Thu, 02 Sep 2010 08:23:29 GMT
Hi,

Finally I'm using a workaround in my URIResolver setting up a new prefix 
like "myfonts:/" which is replaced by the actual fonts base URL.

I wonder if the FOP behavior to use the URIResolver before the fonts 
base URL should be the standard one.

Thanks.

Maxime Bégnis

Le 01/09/2010 17:55, Eric Douglas a écrit :
> I don't know about a simple solution but there is a workaround.
> I solved this or a related issue by not using the setFontBaseURL method.
> I use the Renderer.setFontList method instead to manually load in the 
> custom font(s).
> Is there a point to using a BufferedOutputStream?  I use a 
> ByteArrayOutputStream, so I have the output in bytes so I can copy it 
> from server to client.
> I haven't figured out yet how to get it to resolve paths properly for 
> external image references.  So far I only need one image, so I found a 
> program to translate it to SVG code and copied it directly into my xsl.
>
> ------------------------------------------------------------------------
> *From:* Maxime Bégnis [mailto:maxime@neodoc.biz]
> *Sent:* Wednesday, September 01, 2010 11:37 AM
> *To:* fop-users@xmlgraphics.apache.org
> *Subject:* fonts URL resolution
>
> Hi list,
>
> I am using an URIResolver with FOP to resolve the URL of external 
> images. I found out that it tries to find fonts using the URIResolver 
> before using the font base URL specified with 
> fopFactory.getFontManager().setFontBaseURL("file:///path/to/fonts/")
>
> Is there a way to make it use the URIResolver after(or not at all) the 
> specified font base URL?
>
> Here is the code I'm using :
>
> fopFactory.getFontManager().setFontBaseURL("file:///path/to/fonts/");
> fopFactory.setUserConfig(new File(FOP_USER_CFG));
> OutputStream os = new 
> BufferedOutputStream(FileUtils.openOutputStream(result));
> FOUserAgent uagent = fopFactory.newFOUserAgent();
> uagent.setURIResolver(resolver);
> Fop fop = fopFactory.newFop(format, uagent, os);
>
> All this with FOP 1.0
>
> Thanks a lot!
>
> Maxime Bégnis

Mime
View raw message