Solved

Apache FOP - problem using TTFReader to create font metrics file

Posted on 2006-06-29
5
808 Views
Last Modified: 2013-12-03
Experts,

I am trying to use Apace FOP to create font metrics (I am hoping that this is the correct category for this question).  I am using the following input to read the font file, then use TTFReader to convert it to XML metrics.  We have tried many different combinations.  Such as stating the path name explicitly, moving a few of the jars to different directories, etc.  It's always the same result (see Result).  Another question has been posted regarding this problem, but it looks like the solution posted didn't work for them and it didn't work for me.  Please help!

Input:
---------------------
java -cp build\fop.jar;lib\avalon-framework-cvs-20020806.jar;c:\progra~1\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\endorsed\xml-apis.jar;c:\progra~1\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\endorsed\xercesImpl-2.2.1.jar;lib\xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -enc ansi c:\windows\fonts\times.ttf times.xml
---------------------

Result:
---------------------
TTF Reader v1.1.1

Reading c:\windows\fonts\times.ttf...

Number of glyphs in font: 1674
Creating xml font file...

Creating WinAnsi encoded metrics
Writing xml font file times.xml...

javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\C:\Program%20Files\Altova\FOP\times.xml (The filename, directory name, or volume label syntax is incorrect)
        at org.apache.xalan.transformer.TransformerIdentityImpl.createResultCont
entHandler(TransformerIdentityImpl.java:263)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf
ormerIdentityImpl.java:296)
        at org.apache.fop.fonts.apps.TTFReader.writeFontXML(TTFReader.java:243)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:196)
Caused by: java.io.FileNotFoundException: file:\C:\Program%20Files\Altova\FOP\times.xml (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:253)
        ... 3 more
---------
java.io.FileNotFoundException: file:\C:\Program%20Files\Altova\FOP\times.xml (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:253)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:296)
        at org.apache.fop.fonts.apps.TTFReader.writeFontXML(TTFReader.java:243)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:196)
This font contains no embedding license restrictions
---------------------

Thanks,
- Chad
0
Comment
Question by:ctgilbert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 17015992
ctgilbert,

> java.io.FileNotFoundException: file:\C:\Program%20Files\Altova\FOP\times.xml
> (The filename, directory name, or volume label syntax is incorrect)

are these files where they should be? Can you try moving everythign to a folder that does not contain spaces?
0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 17016008
also replace all \ with / or \\ in your code

You can also try

file:///c:/
and
file:///c|/

instead of

file:\c:
0
 
LVL 2

Author Comment

by:ctgilbert
ID: 17017384
I have already tried moving the folder, but recieved the same result.  I will try replacing the slashes and let you know what happens.  

I also tried using FOP 0.92 Beta, but it didn't work either.

Thanks,
- Chad
0
 
LVL 2

Author Comment

by:ctgilbert
ID: 17020693
girionis,

This wasn't the exact solution, but it got me moving in the right direction.  As it turns out, the only way to get it to write the file was to move the file to the root (c:/) drive, then share that folder out.  So, instead of "times.xml", I used "\\ShareName\FOP\times.xml" and it created the file with no further problems.

Thanks for the help.  It is much appreciated.

- Chad
0
 
LVL 35

Expert Comment

by:girionis
ID: 17026240
Thank you for accepting, glad I was of help :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tomcat administrtor 12 68
jboss 7.1 start up error 1 63
How to configure empty element in XML Document parser? 15 44
Notify sent to other threads in Java 9 43
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question