Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache FOP and Arial font

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?

like image 966
kenny Avatar asked Feb 16 '23 13:02

kenny


1 Answers

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> 
like image 85
kenny Avatar answered Feb 23 '23 14:02

kenny