Apache FOP and Arial font

此生再无相见时 提交于 2019-12-10 10:05:49

问题


My XSL style uses Arial font

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

Configuration file fonts.xml:

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

also tried using this:

 <auto-detect/>

and

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

I am always getting:

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

What should I fix in order to use Arial font?


回答1:


This worked for me, need to specify the Arial font explicitly in configuration file:

<?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> 


来源:https://stackoverflow.com/questions/16548090/apache-fop-and-arial-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!