xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas S." <ths-nab...@cm4all.com>
Subject Embedding fonts from JAR: Bug in FOURIResolver.resolve() ?
Date Thu, 10 Jul 2008 15:48:14 GMT

J.Pietschmann wrote:
>> java.lang.RuntimeException: Cannot load font: failed to create Source
>> from
>> metrics file
>> jar:file:/var/lib/ [snip]
> The embedded file URL ist malformed, maybe the recursive URL resolver 
> doesn't like this. Try jar:file:///var/lib/... and check whether this
> helps.

Ok, now I stepped down into the  code of FOP 0.94...

Loading the configuration and images uses relative URLs, 
in FOURIResolver.resolve(String href, String base) we see
  href="fonts/News_Gothic_MT.ttf" and
as an example.

But laterly while FO-Processing, FOURIResolver.resolve(String href, String
base) is
indirectly called from LazyFont.load() line: 79, now href is an absolute

So FOURIResolver.resolve(String href, String base) is called with

The problem is, that lines 194-196 remove "jar:" from href, and we run into
the problem,
that  in line 208 new URL(URL basURL, String href) is called with  a href
still containing a
protocol (file:), which is different from the protocol of the baseURL
(jar:), so 
  absoluteURL = new URL(baseURL, href);

This URL doesn't work, of course, it's is missing the proper protocol
specification (jar:)! 
Who can I talk to for getting around this problem?
View this message in context: http://www.nabble.com/Embedding-fonts-tp18238271p18385572.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

View raw message