I have problems with user defined fonts in FOP 0.20.5 embedded into Servlet.

Background:
----------

- Servlet works on Jboss + Tomcat pair,

- FOP user configuration is initialized in following way:

options = new 
Options(servletContext.getResourceAsStream("/WEB-INF/userconfig.xml"));

URL fontBaseURL = servletContext.getResource("/fonts/");

Configuration.put("fontBaseDir", fontBaseURL.toExternalForm());

Results:
-------

- under jboss + tomcat I get 'jndi:/server/context/fonts' as result
  of servletContext.getResource("/fonts/");

- when I'm trying to check configured fonts using: 

  Configuration.getFonts();

  I get my font data initialized as follows:

  configFontInfo.getMetricsFile() returns:
      'jndi:/server/context/fonts/fm/font.xml'

  configFontInfo.getEmbedFile() returns: 
      'jndi:/server/context/fonts/truetype/font.ttf'

- FOP cannot handle those URLs correctly, :(, I get no errors during processing
  but created PDF is corrupted, Acrobat is complaining:

  "Unable to extract the embedded font '6hexdigits + font name'. Some characters
  may not display or print correctly."

  and show only black dots instead of characters on screen

Related issues:
--------------

I've tested also following solution:

  Configuration.put("fontBaseDir", "http://server/context/fonts/";);

now my font is initialized: 
  metrics:    http://server/context/fonts/fm/font.xml
  embed file: http://server/context/fonts/truetype/font.ttf

both files are available through the browser under those two URLs, 

result is the same, :(, FOP doesn't complain at all, but PDF is corrupted 
the same way as above

is it FOP error or am I doing something wrong ?

thanks in advance

best regards
-- 
Michał "Yahoo" Jaśtak,
  [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
  http://www.ncac.torun.pl/~warlock

       "Try not. Do. Or do not. There is no try." (Yoda)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to