FOP ExampleFO2PDFPreparing...
Input: XSL-FO (.\xml\fo\helloworld.fo)
Output: PDF (.\out\ResultFO2PDF.pdf)Transforming...
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Font "simhei,normal,400" not found. Substituting with "any,normal,400".
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Glyph "中" (0x4e2d) not available in font "Times-Roman".
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Glyph "文" (0x6587) not available in font "Times-Roman".
PageSequence <no id> generated 1 pages.
Generated 1 pages in total.
Success!
Input: XSL-FO (.\xml\fo\helloworld.fo)
Output: PDF (.\out\ResultFO2PDF.pdf)Transforming...
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Font "simhei,normal,400" not found. Substituting with "any,normal,400".
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Glyph "中" (0x4e2d) not available in font "Times-Roman".
2011-9-28 11:37:09 org.apache.fop.events.LoggingEventListener processEvent
警告: Glyph "文" (0x6587) not available in font "Times-Roman".
PageSequence <no id> generated 1 pages.
Generated 1 pages in total.
Success!
去看fop字体配置。
<auto-detect/>
使用这个可以不?
<fop version="1.0">
<base>.</base>
<renderers>
<renderer mime="application/pdf">
<filterList>
<value>flate</value>
</filterList>
<fonts>
<font metrics-url="simhei.xml" kerning="yes" embed-url="file:///c:\windows\fonts\simhei.ttf">
<font-triplet name="simhei" style="normal" weight="normal"/>
<font-triplet name="simhei" style="normal" weight="bold"/>
<font-triplet name="simhei" style="italic" weight="normal"/>
<font-triplet name="simhei" style="italic" weight="bold"/>
</font>
<font metrics-url="simsun.xml" kerning="yes" embed-url="file:///c:\windows\fonts\simsun.ttc">
<font-triplet name="simsun" style="normal" weight="normal"/>
<font-triplet name="simsun" style="normal" weight="bold"/>
<font-triplet name="simsun" style="italic" weight="normal"/>
<font-triplet name="simsun" style="italic" weight="bold"/>
</font>
</fonts>
</renderer>
</renderers>
</fop>
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory> <!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
</renderers>