Debian Codegraph @

texmf-dist/fonts/source/public/kixfont/kix.mf

raw
1 % KIX, a font for typesetting snail mail zipcodes.
2 %
3 % The KIX code is a barcodish format used to encode country codes, zip codes
4 % and street numbers in a machine-readable format. If printed below the
5 % address line on bulk mailings, a discount can be obtained.
6 %
7 % This font is according to the Dutch specifications. The sizes are
8 % optimal for printing on a printer with a resolution which is a multiple
9 % of 150dpi. This optimisation means that the sizes in the TFM file for
10 % this font match almost exactly on an integer number of pixels.
11 %
12 % Install this font in your TeX distribution and update any distro caches.
13 % Include this file with \font\kix=kix and use it to format properly coded
14 % KIX-information, for instance {\kix 1234AB56} for zipcode 1234AB and street
15 % number 56. For more information on the data to encode in KIX, please refer
16 % to the following site in Dutch:
17 % http://www.tpgpostbusiness.nl/kix/
18 % KIX is also used in a few other countries, but not worldwide.
19 %
20 % Metafont scripting by Rick van Rein, KIX-knowledge from Ivo Terhorst.
21 %
22 % Available for any purpose, no warranties.
23
24
25 mode_setup;
26 font_identifier "kix";
27
28
29 % The bar in the code is barw# wide, spaces are #spcw wide
30 % The sync portion is synch# high, plus additional stickh# to either side
31 barw# := 0.508mm#;
32 spcw# := 0.677mm#;
33 synch# := 1.27mm#;
34 stickh# := 2.08mm#;
35
36 define_pixels (barw, spcw, synch, stickh);
37
38
39 % Character dimensions:
40 % wd, ht, dp
41
42 wd# := 4 * (barw# + spcw#);
43 ht# := synch# + stickh# + 2mm#;
44 dp# := stickh#;
45
46 define_pixels (wd, ht, dp)
47
48
49 % Routine to start a character definition
50
51 def defchar (expr ch) =
52 beginchar (ch, wd#, ht#, dp#);
53 x := 0;
54 enddef;
55
56 % Routine to draw a sync alone
57
58 def sync =
59 fill (x,0)--(x+barw,0)--(x+barw,synch)--(x,synch)--cycle;
60 x := x + barw + spcw
61 enddef;
62
63 % Routine to draw a stick down
64
65 def down =
66 fill (x,-stickh)--(x+barw,-stickh)--(x+barw,synch)--(x,synch)--cycle;
67 x := x + barw + spcw
68 enddef;
69
70 % Routine to draw a stick up
71
72 def up =
73 fill (x,0)--(x+barw,0)--(x+barw,synch+stickh)--(x,synch+stickh)--cycle;
74 x := x + barw + spcw
75 enddef;
76
77 % Routine to draw a long line
78
79 def updown =
80 fill (x,-stickh)--(x+barw,-stickh)--(x+barw,synch+stickh)--(x,synch+stickh)--cycle;
81 x := x + barw + spcw
82 enddef;
83
84 defchar ("1"); sync; down; up; updown; endchar;
85 defchar ("2"); sync; down; updown; up; endchar;
86 defchar ("3"); down; sync; up; updown; endchar;
87 defchar ("4"); down; sync; updown; up; endchar;
88 defchar ("5"); down; down; up; up; endchar;
89 defchar ("6"); sync; up; down; updown; endchar;
90 defchar ("7"); sync; updown; sync; updown; endchar;
91 defchar ("8"); sync; updown; down; up; endchar;
92 defchar ("9"); down; up; sync; updown; endchar;
93 defchar ("0"); sync; sync; updown; updown; endchar;
94 defchar ("A"); down; up; down; up; endchar;
95 defchar ("B"); down; updown; sync; up; endchar;
96 defchar ("C"); sync; up; updown; down; endchar;
97 defchar ("D"); sync; updown; up; down; endchar;
98 defchar ("E"); sync; updown; updown; sync; endchar;
99 defchar ("F"); down; up; up; down; endchar;
100 defchar ("G"); down; up; updown; sync; endchar;
101 defchar ("H"); down; updown; up; sync; endchar;
102 defchar ("I"); up; sync; down; updown; endchar;
103 defchar ("J"); up; down; sync; updown; endchar;
104 defchar ("K"); up; down; down; up; endchar;
105 defchar ("L"); updown; sync; sync; updown; endchar;
106 defchar ("M"); updown; sync; down; up; endchar;
107 defchar ("N"); updown; down; sync; up; endchar;
108 defchar ("O"); up; sync; updown; down; endchar;
109 defchar ("P"); up; down; up; down; endchar;
110 defchar ("Q"); up; down; updown; sync; endchar;
111 defchar ("R"); updown; sync; up; down; endchar;
112 defchar ("S"); updown; sync; updown; sync; endchar;
113 defchar ("T"); updown; down; up; sync; endchar;
114 defchar ("U"); up; up; down; down; endchar;
115 defchar ("V"); up; updown; sync; down; endchar;
116 defchar ("W"); up; updown; down; sync; endchar;
117 defchar ("X"); updown; up; sync; down; endchar;
118 defchar ("Y"); updown; up; down; sync; endchar;
119 defchar ("Z"); updown; updown; sync; sync; endchar;
120
121 end