You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Ian Rowlands <ia...@viridian.com.au> on 2002/08/26 00:21:42 UTC

Suggestions on embedding barcode fonts

Hi,

I'm trying to use FOP to produce barcodes (EAN-13) in a PDF document.
I've used a number of different fonts to try to do this but have had a
few hassles:

1. Fonts from Chaos Microsystems. They work, but don't allow you to be
able to adjust sizes etc very well. Also, the printing of the numbers
doesn't seem to be the same as other fonts (and other barcodes I've
seen).

2. Fonts from IDAutomation. They seem great but when I try to embed
them, it complains that the font can't be found. The font is on the
path, and in the C:\Windows\Fonts directory (although I'm not
referencing it there). I use a similar configuration to the one I used
above, so the fonts should be found.

3. Fonts from ABRI. Used a similar configuration but it complains that
the PDF is not constructed correctly.

Does anybody have experience with embedding fonts for producing EAN-13
barcodes? We haven't settled on a purchase yet (but would like to do so
once we can produce the PDF's we need to).

Thanks,

Ian Rowlands

RE: Suggestions on embedding barcode fonts

Posted by Ian Rowlands <ia...@viridian.com.au>.
The XSL you pointed out seems to do the trick. It looks a little bit
uglier, but it definitely works. Thanks for the suggestion.

Regards,

Ian

> -----Original Message-----
> From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
> Sent: Tuesday, 27 August 2002 05:22
> To: fop-user@xml.apache.org
> Subject: Re: Suggestions on embedding barcode fonts
> 
> 
> Ian Rowlands wrote:
> > I'm trying to use FOP to produce barcodes (EAN-13) in a PDF 
> document.
> 
> Commercial barcode fonts seem to be the cause of much
> harm and trouble...
> 
> > 2. Fonts from IDAutomation. They seem great but when I try to embed
> > them, it complains that the font can't be found. The font is on the 
> > path, and in the C:\Windows\Fonts directory (although I'm not 
> > referencing it there). I use a similar configuration to the 
> one I used 
> > above, so the fonts should be found.
> 
> Whatever path you mean, FOP does not search it. It will
> look up exactly the file (for embed) or the URL (for metrics) 
> which you gave. If you supplied absolute path/URL, than 
> either the font *not* there. Note that the presence of a font 
> in C:\Windows\Fonts does *not* necessarily mean the font file 
> can be accessed with "C:\Windows\Fonts\foo.ttf", it can be in 
> any other directory as long as you used Window's font 
> installer to make it known to the system. There could also be 
> some obscure failure modes when reading the font file which 
> are reported as "file not found", but you'll have to check 
> for this in the source yourself.
> 
> > 3. Fonts from ABRI. Used a similar configuration but it 
> complains that
> > the PDF is not constructed correctly.
> Whats the complete error message?
> 
> > Does anybody have experience with embedding fonts for 
> producing EAN-13 
> > barcodes? We haven't settled on a purchase yet (but would 
> like to do so 
> > once we can produce the PDF's we need to).
> The usual problem is that many barcode fonts do not have
> Unicode maps or seem to violate other parts of the TTF spec.
> If you've generated a metric file successfully, it should
> work though. FOP does not look into the font file itself,
> only the metrics generator does.
> 
> A simple and cheap work around is use XSLT to generate an
> embedded SVG or a FO table representing the barcode:
>   http://www.renderx.com/barcodes.html
> 
> J.Pietschmann
> 
> 

RE: Suggestions on embedding barcode fonts

Posted by Keiron Liddle <ke...@aftexsw.com>.
On Tue, 2002-08-27 at 08:53, Ian Rowlands wrote:
> Ian Rowlands wrote:
> > I'm trying to use FOP to produce barcodes (EAN-13) in a PDF document.
> 
> Commercial barcode fonts seem to be the cause of much
> harm and trouble...

There is a simple example in CVS using the free barcode font mentioned
earlier. It was quite easy to get working.

> Personally, I've heard that producing the fonts yourself is the cause of
> much trouble, but only before I tried using commercial fonts!
> 
> Whatever path you mean, FOP does not search it. It will
> look up exactly the file (for embed) or the URL (for metrics) which you
> gave. If you supplied absolute path/URL, than either the font *not*
> there. Note that the presence of a font in C:\Windows\Fonts does *not*
> necessarily mean the font file can be accessed with
> "C:\Windows\Fonts\foo.ttf", it can be in any other directory as long as
> you used Window's font installer to make it known to the system. There
> could also be some obscure failure modes when reading the font file
> which are reported as "file not found", but you'll have to check for
> this in the source yourself.
> 
> 
> I'm not relying on the fonts being installed correctly - I'm trying to
> use complete paths to the fonts. I was wondering why it can't be found
> when I have specified the full path. Doesn't make sense to me!

There seems to be a bit of a problem with the path used to load fonts
and the other info.



RE: Suggestions on embedding barcode fonts

Posted by Ian Rowlands <ia...@viridian.com.au>.
Thanks for your suggestions. Comments below...


Ian Rowlands wrote:
> I'm trying to use FOP to produce barcodes (EAN-13) in a PDF document.

Commercial barcode fonts seem to be the cause of much
harm and trouble...


Personally, I've heard that producing the fonts yourself is the cause of
much trouble, but only before I tried using commercial fonts!


> 2. Fonts from IDAutomation. They seem great but when I try to embed
> them, it complains that the font can't be found. The font is on the 
> path, and in the C:\Windows\Fonts directory (although I'm not 
> referencing it there). I use a similar configuration to the one I used

> above, so the fonts should be found.

Whatever path you mean, FOP does not search it. It will
look up exactly the file (for embed) or the URL (for metrics) which you
gave. If you supplied absolute path/URL, than either the font *not*
there. Note that the presence of a font in C:\Windows\Fonts does *not*
necessarily mean the font file can be accessed with
"C:\Windows\Fonts\foo.ttf", it can be in any other directory as long as
you used Window's font installer to make it known to the system. There
could also be some obscure failure modes when reading the font file
which are reported as "file not found", but you'll have to check for
this in the source yourself.


I'm not relying on the fonts being installed correctly - I'm trying to
use complete paths to the fonts. I was wondering why it can't be found
when I have specified the full path. Doesn't make sense to me!


> 3. Fonts from ABRI. Used a similar configuration but it complains that
> the PDF is not constructed correctly.
Whats the complete error message?


The full error message is "There was an error processing a page. There
was a problem reading this document (122)". This happens on all pages
(including ones where I don't have a barcode).


> Does anybody have experience with embedding fonts for producing EAN-13

> barcodes? We haven't settled on a purchase yet (but would like to do
so 
> once we can produce the PDF's we need to).
The usual problem is that many barcode fonts do not have
Unicode maps or seem to violate other parts of the TTF spec.
If you've generated a metric file successfully, it should
work though. FOP does not look into the font file itself,
only the metrics generator does.


I've failed to produce a metrics file from the TTF fonts (getting the
errors that you mentioned above) - generally, a PFM file has come with
the font and I've tried to generate a metric from that. Maybe that's the
root cause (the TTF font is not constructed correctly). 


A simple and cheap work around is use XSLT to generate an
embedded SVG or a FO table representing the barcode:
  http://www.renderx.com/barcodes.html


I will investigate this option as well.

Thanks again,

Ian


Re: Suggestions on embedding barcode fonts

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ian Rowlands wrote:
> I'm trying to use FOP to produce barcodes (EAN-13) in a PDF document. 

Commercial barcode fonts seem to be the cause of much
harm and trouble...

> 2. Fonts from IDAutomation. They seem great but when I try to embed 
> them, it complains that the font can't be found. The font is on the 
> path, and in the C:\Windows\Fonts directory (although I'm not 
> referencing it there). I use a similar configuration to the one I used 
> above, so the fonts should be found.

Whatever path you mean, FOP does not search it. It will
look up exactly the file (for embed) or the URL (for metrics)
which you gave. If you supplied absolute path/URL, than
either the font *not* there. Note that the presence of a
font in C:\Windows\Fonts does *not* necessarily mean the
font file can be accessed with "C:\Windows\Fonts\foo.ttf",
it can be in any other directory as long as you used Window's
font installer to make it known to the system.
There could also be some obscure failure modes when reading
the font file which are reported as "file not found", but
you'll have to check for this in the source yourself.

> 3. Fonts from ABRI. Used a similar configuration but it complains that 
> the PDF is not constructed correctly.
Whats the complete error message?

> Does anybody have experience with embedding fonts for producing EAN-13 
> barcodes? We haven't settled on a purchase yet (but would like to do so 
> once we can produce the PDF's we need to).
The usual problem is that many barcode fonts do not have
Unicode maps or seem to violate other parts of the TTF spec.
If you've generated a metric file successfully, it should
work though. FOP does not look into the font file itself,
only the metrics generator does.

A simple and cheap work around is use XSLT to generate an
embedded SVG or a FO table representing the barcode:
  http://www.renderx.com/barcodes.html

J.Pietschmann


RE: Suggestions on embedding barcode fonts

Posted by "Jason E. Kafer" <je...@ritvax.isc.rit.edu>.
Ian,
 
            I experienced similar problems, ended up writing a Barcode
Servlet to producer barcode images, it works great..
 
Jason
 
 
 
-----Original Message-----
From: Ian Rowlands [mailto:ianr@viridian.com.au] 
Sent: Sunday, August 25, 2002 6:22 PM
To: fop-user@xml.apache.org
Subject: Suggestions on embedding barcode fonts
 
Hi, 
I'm trying to use FOP to produce barcodes (EAN-13) in a PDF document.
I've used a number of different fonts to try to do this but have had a
few hassles:
1. Fonts from Chaos Microsystems. They work, but don't allow you to be
able to adjust sizes etc very well. Also, the printing of the numbers
doesn't seem to be the same as other fonts (and other barcodes I've
seen).
2. Fonts from IDAutomation. They seem great but when I try to embed
them, it complains that the font can't be found. The font is on the
path, and in the C:\Windows\Fonts directory (although I'm not
referencing it there). I use a similar configuration to the one I used
above, so the fonts should be found.
3. Fonts from ABRI. Used a similar configuration but it complains that
the PDF is not constructed correctly. 
Does anybody have experience with embedding fonts for producing EAN-13
barcodes? We haven't settled on a purchase yet (but would like to do so
once we can produce the PDF's we need to).
Thanks, 
Ian Rowlands