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
 
base="jar:file:/path/CMBilling-0.0.1-SNAPSHOT.jar!/layouts/LIVINGNET_2008_06_05/"
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
URL.

So FOURIResolver.resolve(String href, String base) is called with
href="jar:file:/path/CMBilling-0.0.1-SNAPSHOT.jar!/layouts/LIVINGNET_2008_06_05/fonts/ttfnewsgothic.xml"
and 
base="jar:file:/path/CMBilling-0.0.1-SNAPSHOT.jar!/layouts/LIVINGNET_2008_06_05/"

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);
sets
absoluteURL=file:/path/CMBilling-0.0.1-SNAPSHOT.jar!/layouts/LIVINGNET_2008_06_05/fonts/ttfnewsgothic.xml.

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


Mime
View raw message