Fonts.xml c...">

Apache FOP and Arial Font

My XSL style uses the font Arial

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

Fonts.xml configuration file:

<?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 always get:

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

What should I fix to use the font Arial?

+3
source share
1 answer

This worked for me, I need to explicitly specify the Arial font in the 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> 
+7
source

Source: https://habr.com/ru/post/1546797/


All Articles