Bug 21265 - referencing a custom font (TTF or Adobe Type 1) for a pdf document fails witch fop-0.20.4
Summary: referencing a custom font (TTF or Adobe Type 1) for a pdf document fails witc...
Status: NEEDINFO
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.4
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL: http://marc.theaimsgroup.com/?l=fop-u...
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-02 07:58 UTC by Markus Sch
Modified: 2012-04-01 16:18 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Sch 2003-07-02 07:58:31 UTC
Fop fails by trying to use a ttf font and reference it within a pdf document.

I first embedded a True Type Font into my documents. Thats works great. Here is 
a snippet from my userconfig.xml file:

<font
metrics-file="file:D:/Asfr/unchangedfopsrc/fop-0.20.4/conf/ARIALUNI.XML" 
   kerning="yes" 
   embed-file="file:D:/Asfr/unchangedfopsrc/fop-0.20.4/conf/ARIALUNI.TTF">
      <font-triplet name="ArialUnicodeMS" style="normal" weight="normal"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="normal" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="normal"/>
</font>


But if I remove the embed-file attribute I end up with an error.

This is my changed userconfig.xml file:

<font
metrics-file="file:D:/Asfr/unchangedfopsrc/fop-0.20.4/conf/ARIALUNI.XML" 
   kerning="yes" 
      <font-triplet name="ArialUnicodeMS" style="normal" weight="normal"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="normal" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="normal"/>
</font>


This is the error message I get:

[INFO] FOP 0.20.4
[INFO] building formatting object tree
[ERROR] Failed to read font metrics file
D:/Asfr/unchangedfopsrc/fop-0.20.4/conf
/ARIALUNI.XML : null
[INFO] [1]
[ERROR] unknown font ArialUnicodeMS,normal,normal so defaulted font to any
[ERROR] unknown font ArialUnicodeMS,normal,normal so defaulted font to any
[ERROR] unknown font ArialUnicodeMS,normal,normal so defaulted font to any
[INFO] [2]


Please note: I only changed the userconfig.xml. The font-metrics file is
still there.


If I use

<font
metrics-file="file:D:/Asfr/unchangedfopsrc/fop-0.20.4/conf/ARIALUNI.XML" 
   kerning="yes" 
   embed-file=""
      <font-triplet name="ArialUnicodeMS" style="normal" weight="normal"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="normal" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="normal"/>
</font>


fop generates the pdf document, but with this error message at the end:

[INFO] Parsing of document complete, stopping renderer
[ERROR] Failed to embed font [65] ArialUnicodeMS:
D:\Asfr\unchangedfopsrc\fop-0.
20.4 (Access is denied)

I can open the pdf document, but I get the error message "A font required
for font substitution is missing".

And if I use the following in my userconfig.xml I end up with the same error
message as the one above.

<font
metrics-file="file:D:/Asfr/unchangedfopsrc/fop-0.20.4/conf/ARIALUNI.XML" 
   kerning="yes" 
   embed-file="*.ttf"
      <font-triplet name="ArialUnicodeMS" style="normal" weight="normal"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="normal" weight="bold"/>
      <font-triplet name="ArialUnicodeMS" style="italic" weight="normal"/>
</font>


I'm using jdk 1.4.0.

I also tested this with fop-0.20.5rc3a and it seems that the issue has been 
fixed for Adobe Type 1 fonts. But with True Type fonts it still doesn't work. 
Just the fop error messages are different with 0.20.5rc3a.
I tested the issue with arialuni.ttf and tahoma.ttf
Comment 1 Pascal Sancho 2007-11-20 00:11:30 UTC
Bug fixed in FOP 0.94
Comment 2 Pascal Sancho 2007-11-20 00:14:53 UTC
Sorry, that was a mistake, I've not tested this bug
Comment 3 Glenn Adams 2012-04-01 16:18:08 UTC
please provide (1) input FO file for testing, (2) fop.xconf file, (3) output PDF file (if any), (4) any console output in a file form