xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Douglas" <edoug...@blockhouse.com>
Subject RE: fonts URL resolution
Date Wed, 01 Sep 2010 15:55:48 GMT
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/" <file:///path/to/fonts/>

Is there a way to make it use the URIResolver after(or not at all) the specified font base

Here is the code I'm using :

fopFactory.getFontManager().setFontBaseURL("file:///path/to/fonts/" <file:///path/to/fonts/>
fopFactory.setUserConfig(new File(FOP_USER_CFG));
OutputStream os = new BufferedOutputStream(FileUtils.openOutputStream(result));
FOUserAgent uagent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(format, uagent, os);

All this with FOP 1.0

Thanks a lot!

Maxime Bégnis

View raw message