Andy96
Andy96

Reputation: 1

FOP- 1.1 Adding new Fonts

Im trying to generate a pdf with an XSL Stylesheet
and a XML file with a fop.bat ( I am using the 1.1 Version). Now I need to add a custom Font to my FOP but I doesnt seem to work. I just have a TTF-File of the Font and installed it already. I tried to add the Font to the Confi File but maybe I did it wrong. I tried to give the path (C:\Windows\Fonts\Trade Gothic bd.ttf) and to use the but I still cant use the font-family in the Stylesheet and it rolls back to TimesNewRoman.

       <font kerning="yes" embed-url="'C:/Windows/Fonts/Trade Gothic bd.ttf'" embedding-mode="subset">
           <font-triplet name="TradeGothic" style="normal" weight="normal"/>
   </font>

The message from the Commandline

WARNUNG: Font "TradeGothic,normal,400" not found. Substituting with "any,normal,400".
Okt 21, 2015 11:10:10 AM org.apache.fop.events.LoggingEventListener processEvent

These lines are from my Stylesheet

        <fo:block color="rgb(0,108,183)" font-family="TradeGothic" font-style="normal" font-weight="normal">
                <xs:value-of select="headdescription"/>
            </fo:block>

Can someone give me a Step by Step Introduction on how to add fonts? Or a correction of my try?

Upvotes: 0

Views: 1136

Answers (1)

Andy96
Andy96

Reputation: 1

I've found a solution for my Problem!

I needed to add inside the conf file (fop.xconf) :

 <font kerning="yes" embedurl="/Users/alisch/desktop/TradeGothicbold.ttf" embedding-mode="subset">
    <font-triplet name="TradeGothic" style="normal" weight="bold"/>
    </font>
    <directory>/Users/alisch/desktop/TradeGothicbold.ttf</directory>

in between the :

 <renderer mime="application/pdf">
 <fonts>

  </fonts>
</renderer>

after that I needed to add

 -c "C:\Users\alisch\Desktop\xml xsl test\conf\fop.xconf"

to my command line and it worked !

Upvotes: 0

Related Questions