Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Adding fonts to FOP

Adding fonts to FOP

Adding fonts to FOP

I´m trying to create a barcode in my xsl:fo-file. I´ve downloaded a font file, free3of9.ttf which I´ve saved in the windows/font-folder. I have generated a font metrics xml-file in the fop/config-folder. In the config-folder I´ve changed the userconfig.xml to contain the following:

 <font metrics-file="C:\Temp\fop-0.94\conf\Free3of9.xml" kerning="yes" embed-file="C:\WINDOWS\Fonts\free3of9.ttf">
    <font-triplet name="Free 3 Of 9" style="normal" weight="normal"/>

I try to use this font in my xsl-file by writing the following lines:
<fo:block font-family="Free 3 Of 9">S090127</fo:block>

I start a command-line window and I try to run the following:
fop -c conf/userconfig.xml xml Myxml.xml -xsl Myxsl.xsl -pdf Output.pdf

I get a message that the font 'Free 3 of 9",normal,400' not found. Substituting with 'any,normal,400'.

What am I doing wrong?

Best regards/

RE: Adding fonts to FOP

Hello, thanks for your reply.
I tried to describe the paths with file: protocol instead but it didn´t make any difference. Fop says exactly the same as before, font not found.


RE: Adding fonts to FOP

Try put the font files in the same directory as the input and fo documents. (Just to make sure c:\windows accessibility is not a problem.)

RE: Adding fonts to FOP

It didn´t help either. sad

RE: Adding fonts to FOP

[0] >It didn´t help either.
I can confirm that. Without file: protocol, on windows os, it should work as well (as of 0.94 and 0.95). And I won't even say one is of better practice.

[1] I think, first and foremost, should make sure the gneration of the metrics file is flawless. What command line eventually are you using to generate it. (Make sure all the jar(s) are included in the classpath -cp.)

[1.1] I have made a quick test case, and it works correctly for free3of9 ttf. For some intriguing ttf/ttc, the generation of the metrics file does result in some bugs and has to be rectified manually, as of the present 0.94/0.95. So I can say in a good degree of confidence, free3of9 ttf should work.

RE: Adding fonts to FOP

Hello again. I´ve generated a new metrics file and now everything works fine. Thank´s for your help!!!  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close