🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #64

Re: Zip Code "Bar Codes"

#64
From: R. Matthew Emerson
Date: Thu, 29 Oct 1992 19:37
62 lines
2630 bytes
In article <SILVUS.92Oct29124450@vauxhall.ece.cmu.edu> silvus@vauxhall.ece.cmu.edu (Gregory Lee Silvus) writes:
>In article <1992Oct23.173146.20984@unlv.edu> robert@unlv.edu (Robert Cray) writes:
>   Does anyone have postscript code that will generate the zip+4 bar code
>   for a zip-code?  Actually I have the postscript code to generate the
>
>
>Zip Code Bar Code
>
>1.	The Zip Code Bar Code resides below all mailing information,
>	although this constraint is being relaxed.
>2.	The bar code is a distance 2 code capable of detecting one
>	error per number in the string.
>3.	The Zip Code is preceded and followed by a single tall stroke.
>4.	The last digit in the bar code is the number required
>	to make the Zip Code sum to a mod 10 number.
>5.	Each code word contains exactly two long strokes and three short
>	strokes.
>6.	The code appears to be both rotational and linear.
>
>0	11000
>1	00011
>2	00101
>3	00110
>4	01001
>5	01010
>6	01100
>7	10001
>8	10010
>9	10100


A while back, Michael Post (msp2@ellis.uchicago.edu) posted an explaination
of the zip-bar-code too.  I fooled around for a little while and wrote the
following code to draw the codes. It's *very* simplistic, but that's ok.

-matt

/long { currentpoint % save current location
        0 10 rlineto stroke
        moveto
        5 0 rmoveto  % set up for next line
} def

/short { currentpoint % save current location
        0 3 rlineto stroke
        moveto
        5 0 rmoveto  % set up for next line
} def

/zero { long long short short short } def
/one { short short short long long } def
/two { short short long short long } def
/three { short short long long short } def
/four { short long short short long } def
/five { short long short long short } def
/six { short long long short short } def
/seven { long short short short long } def
/eight { long short short long short } def
/nine { long short long short short } def

10 10 moveto
long seven seven zero zero six zero long
Technical Details
Message-ID: <1992Oct29.193722.18527@cis.ohio-state.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!hadrosaur.cis.ohio-state.edu!emerson
References: <1992Oct23.173146.20984@unlv.edu> <SILVUS.92Oct29124450@vauxhall.ece.cmu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!hadrosaur.cis.ohio-state.edu!emerson
From: emerson@hadrosaur.cis.ohio-state.edu (R. Matthew Emerson)
Subject: Re: Zip Code "Bar Codes"
Message-ID: <1992Oct29.193722.18527@cis.ohio-state.edu>
Sender: news@cis.ohio-state.edu (NETnews        )
Organization: The Ohio State University Dept. of Computer and Info. Science
References: <1992Oct23.173146.20984@unlv.edu> <SILVUS.92Oct29124450@vauxhall.ece.cmu.edu>
Distribution: usa
Date: Thu, 29 Oct 1992 19:37:22 GMT
Lines: 63