This procedure is valid fromAmetys 4.2 onwards.

All occurrences in square brackets are to be replaced by your values.

Fonts folder

Create a fonts folder in the project under WEB-INF/param in which you put your various fonts.

Fonts must be in 'ttf' format.

fop-user-config file.xml

Create the following fop-user-config.xml file in the WEB-INF/param folder:

fop-user-config.xml

<?xml version="1.0" encoding="UTF-8"?> 
<fop version="1.0">    
    <renderers>    
        <renderer mime="application/pdf">    
            <fonts>    
                <font    
                    kerning="yes"    
                    embed-url="./WEB-INF/param/fonts/[MA-FONT]-REGULAR.TTF">    
                    <font-triplet name="[MaFont]" style="normal" weight="normal"/>    
                </font>   
                <font    
                    kerning="yes"    
                    embed-url="./WEB-INF/param/fonts/[MA-FONT]-BOLD.TTF">    
                    <font-triplet name="[MaFont]" style="normal" weight="bold"/>    
                </font>   
                <font    
                    kerning="yes"    
                    embed-url="./WEB-INF/param/fonts/[MA-FONT]-ITALIC.TTF">    
                    <font-triplet name="[MaFont]" style="italic" weight="normal"/>    
                </font>   
                <font    
                    kerning="yes"    
                    embed-url="./WEB-INF/param/fonts/[MA-FONT]-BOLDITALIC.TTF">    
                    <font-triplet name="[MaFont]" style="italic" weight="bold"/>    
                </font>    
            </fonts>    
        </renderer>   
    </renderers>    
</fop>    

You need to replace the TTF files with the correct ones and match the name, style and weight attributes. The name attribute quoted in the file will be the one used to retrieve the font in the font-family attribute in CSS.

Light font
To declare a light font, use weight="100" rather than weight="light".

Consideration

Due to the integration of a new XML file, it is necessary to restart the server for any additions or modifications to the fop-user-config file.xml.

Back to top