INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

helid (Programmer) (OP)
15 Mar 10 10:19
Hello!
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"/>
 </font>

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

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/
Helena
tsuji (TechnicalUser)
15 Mar 10 13:00
Have you read this?
    http://xmlgraphics.apache.org/fop/0.95/fonts.html#register
The paths are specified with file: protocol like these.
    file:///C:/Temp/fop-0.94/conf/Free3of9.xml
    file:///C:/WINDOWS/Fonts/free3of9.ttf
helid (Programmer) (OP)
16 Mar 10 1:30
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.

 
tsuji (TechnicalUser)
16 Mar 10 2:32
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.)
helid (Programmer) (OP)
16 Mar 10 5:21
It didn´t help either. sad
tsuji (TechnicalUser)
16 Mar 10 12:56
[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.
 
helid (Programmer) (OP)
26 Mar 10 9:35
Hello again. I´ve generated a new metrics file and now everything works fine. Thank´s for your help!!!  

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