Affects Version/s: 1.8
Fix Version/s: None
Component/s: SVG Rasterizer
Environment:Operating System: Linux
From batik-users mailing list:
> I'm using Batik to dynamically generate and rasterize some graphics
> from a tomcat servlet. I supply my own truetype font to make sure the
> correct font gets used.
> The problem is that something, presumably Batik, is copying this font
> file to a temporary file (in the tomcat temp directory), and fails to
> remove it. Over time, I get hundreds of copies of the same file there
> (with names like +~JF4554.tmp), and have to delete them manually.
I'm fairly certain that it is not Batik, we use Font.createFont
which takes an InputStream. I would suspect that this method is
copying the file so it can use some sort of native library to read
the font... Not that this helps you, I'm just "passing the buck" to
> Am I doing something wrong? I am certain that I am not telling anyone
> to do the copying, so I can't see how to make file go away when not
I have two suggestions.
2) Add a font cache similar to our Image cache into Batik.
This way as long as the same URL was used each time for the font, you
would only create one instance of the font. This would probably make
a minor speed improvement. I could point out the places where changes
would need to be made (I don't think this would be difficult).
Even if you decide to go with #1 for now could you file a Bugzilla
requesting #2 so it's not forgotten (I think it's a good idea).