Posted on 2005-08-18 13:54
ravenix 阅读(1296)
评论(1) 编辑 收藏 所属分类:
XML-XSL-FO
今天用FOP的TTFReader工具创建字体影射文件,结果报FileNotFoundException
D:\fop-0.20.5>ttfreader.bat c:\WINDOWS\Fonts\simfang.ttf simfang.xml TTF Reader v1.1.1
Reading c:\WINDOWS\Fonts\simfang.ttf...
Number of glyphs in font: 7580 Postscript format 3 Creating xml font file...
Creating CID encoded metrics Writing xml font file simfang.xml...
javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\D :\fop-0.20.5\simfang.xml (文件名、目录名或卷标语法不正确。) 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:\D:\fop-0.20.5\simfang.xml (文件 名、目录名或卷标语法不正确。) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.createResultCont entHandler(TransformerIdentityImpl.java:253) ... 3 more --------- java.io.FileNotFoundException: file:\D:\fop-0.20.5\simfang.xml (文件名、目录名或 卷标语法不正确。) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.createResultCont entHandler(TransformerIdentityImpl.java:253) 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) This font contains no embedding license restrictions
|
在google上搜索到apache的邮件列表里有相关讨论,说是FOP只能在jdk 1.4上运行。
jdk1.5内置了xerces和xalan,这是和1.4不同的地方。
我修改了ttfreader.bat,把CLASSPATH里xml-apis.jar,xercesImpl-2.2.1.jar,xalan-2.4.1.jar注释掉,再运行,成功!