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!

解决方案 »

  1.   

    http://xmlgraphics.apache.org/fop/1.0/fonts.html
    去看fop字体配置。
      

  2.   

    simhei是黑体,一般windows自带了。<!-- automatically detect operating system installed fonts -->
    <auto-detect/>
    使用这个可以不?
      

  3.   

    <?xml version="1.0"?>   
    <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>   
      

  4.   

    文档里不是有这段例子
    <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>
      

  5.   

    现在不需要使用 TTFReader/PFMReader 生成字体描述文件了。