2013-05-14 143 views
3

我的XSL樣式使用Arial字體的Apache FOP和Arial字體

<fo:block font-family="Arial" font-size="8pt" font-weight="normal"> 

配置文件fonts.xml:

<?xml version="1.0"?> 
<fop> 
    <renderers> 
    <renderer mime="application/pdf"> 
     <fonts> 
     <base>file:///C:/windows/fonts</base> 
     </fonts> 
    </renderer> 
    </renderers> 
</fop> 

使用這個也試過:

<auto-detect/> 

<directory>C:\windows\fonts</directory> 

我總是得到:

WARNING: Font "Arial,normal,400" not found. Substituting with "any,normal,400". 

我應該怎麼解決才能使用Arial字體?

+2

爲了統一起見,你可以編輯這是一個問題的形式? – BlackVegetable 2013-05-14 16:19:40

回答

7

這爲我工作,需要在配置文件中明確指定的Arial字體:

<?xml version="1.0"?> 
    <fop> 
     <renderers> 
     <renderer mime="application/pdf">  
      <fonts>       
       <font kerning="yes" embed-url="file:///C:/windows/fonts/arial.ttf"> 
         <font-triplet name="Arial" style="normal" weight="normal"/> 
        </font>      
      </fonts> 
     </renderer> 
     </renderers>  
</fop>