From: BERNT@EZINFO.VMSMAIL.ETHZ.CH (FISCHER,BERNT UWE)
Subject: Re: Generating Code 3 of 9 Barcode Fonts-CORRECTION!
Organization: ETH ZUERICH
Date: Mon, 14 Dec 1992 11:50:40 GMT
X-News-Reader: VMS NEWS 1.24

In <1992Dec2.012323.7156@cnplss5.cnps.philips.nl> schaik@cnplss5.cft.philips.nl writes:

> 
> Here is the promised code for a 3 of 9 barcode font:
> 
> ---8X===--------------------------------------------------------------
> %!PS-Adobe-2.0
> %%Title: barcode.ps
> %%Creator: Willem van Schaik
> %%CreationDate: aug 1992
> %%Pages: 1
> %%DocumentFonts: Helvetica Code39
> %%BoundingBox: 0 0 595 842
> %%EndComments
> 
> /newfont 10 dict def
> newfont begin
> /FontType 3 def
> /FontMatrix [0.01 0 0 0.01 0 0] def
> /FontBBox [0 0 100 100] def
>   %% Must read 'FontBBox' instead of 'FontBox'
> 
> /Encoding 256 array def
> 0 1 255 {Encoding exch /.notdef put} for
> Encoding 32 /barSpace put
> Encoding 36 /barDollar put
> Encoding 37 /barPercent put
> Encoding 42 /barAsterisk put
> Encoding 43 /barPlus put
> Encoding 45 /barHyphen put
> Encoding 46 /barPeriod put
> Encoding 47 /barSlash put
> Encoding 48 /bar0 put
> Encoding 49 /bar1 put
> Encoding 50 /bar2 put
> Encoding 51 /bar3 put
> Encoding 52 /bar4 put
> Encoding 53 /bar5 put
> Encoding 54 /bar6 put
> Encoding 55 /bar7 put
> Encoding 56 /bar8 put
> Encoding 57 /bar9 put
> Encoding 65 /barA put
> Encoding 66 /barB put
> Encoding 67 /barC put
> Encoding 68 /barD put
> Encoding 69 /barE put
> Encoding 70 /barF put
> Encoding 71 /barG put
> Encoding 72 /barH put
> Encoding 73 /barI put
> Encoding 74 /barJ put
> Encoding 75 /barK put
> Encoding 76 /barL put
> Encoding 77 /barM put
> Encoding 78 /barN put
> Encoding 79 /barO put
> Encoding 80 /barP put
> Encoding 81 /barQ put
> Encoding 82 /barR put
> Encoding 83 /barS put
> Encoding 84 /barT put
> Encoding 85 /barU put
> Encoding 86 /barV put
> Encoding 87 /barW put
> Encoding 88 /barX put
> Encoding 89 /barY put
> Encoding 90 /barZ put
> 
> /CharProcs 45 dict def
> CharProcs begin
> /.notdef {} def
> /barSpace {0 7 17 17 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barDollar {0 7 17 7 17 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barPercent {0 7 7 7 17 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barAsterisk {0 7 17 7 7 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barPlus {0 7 17 7 7 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barHyphen {0 7 17 7 7 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barPeriod {0 17 17 7 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barSlash {0 7 17 7 17 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar0 {0 7 7 7 17 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar1 {0 17 7 7 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar2 {0 7 7 17 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar3 {0 17 7 17 17 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar4 {0 7 7 7 17 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar5 {0 17 7 7 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar6 {0 7 7 17 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar7 {0 7 7 7 17 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar8 {0 17 7 7 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /bar9 {0 7 7 17 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barA {0 17 7 7 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barB {0 7 7 17 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barC {0 17 7 17 7 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barD {0 7 7 7 7 17 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barE {0 17 7 7 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barF {0 7 7 17 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barG {0 7 7 7 7 7 17 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barH {0 17 7 7 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barI {0 7 7 17 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barJ {0 7 7 7 7 17 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barK {0 17 7 7 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barL {0 7 7 17 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barM {0 17 7 17 7 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barN {0 7 7 7 7 17 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barO {0 17 7 7 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barP {0 7 7 17 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barQ {0 7 7 7 7 7 7 17 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barR {0 17 7 7 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barS {0 7 7 17 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barT {0 7 7 7 7 17 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barU {0 17 17 7 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barV {0 7 17 17 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barW {0 17 17 17 7 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barX {0 7 17 7 7 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barY {0 17 17 7 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> /barZ {0 7 17 17 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
> neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
> end
> 
> /BuildChar
> { 100 0 0 0 93 100 setcachedevice
>   exch
>   begin
>     Encoding exch get
>     CharProcs exch get
>     end
>   exec
> } def
> end
> 
> /Code39 newfont definefont pop
> 
> %%EndProlog
> 
> %%Page: - 1
> %%PageFonts:
> 
> 72 25.4 div dup scale
> 
> /Code39 findfont [5 0 0 15 0 0] makefont setfont
> 20 240 moveto (*CODE-39 BARCODES*) show
> 20 220 moveto (*WILLEM VAN SCHAIK*) show
> 
> /Helvetica findfont 3 scalefont setfont
> 150 240 moveto (CODE-39 BARCODES) show
> 150 220 moveto (WILLEM VAN SCHAIK) show
> 
> showpage
> 
> %%Trailer
> ---8X===------------------------------------------------------------------
> 
> Succes with the code and please let me know if it works!
> 
> Willem van Schaik
> schaik@cnplss5.cnps.philips.nl
>
I happened to read this message and found it to be very useful. Thanks a lot!
However, at first my printer would give me an 'invalid font' error, and I found
that there was a small error in the original file (maybe one B was lost during
transfer?), as I have marked in the file script. However, now the file seems to
work fine. Best regards,

Bernt Fischer
BERNT@EZINFO.VMSMAIL.ETHZ.CH 

Newsgroups: comp.fonts