1 | #!/usr/bin/env perl -w |
---|
2 | |
---|
3 | # these can be changed. |
---|
4 | $chars_per_line=4; |
---|
5 | $lines_per_page=5; |
---|
6 | |
---|
7 | $font_size_plu=(2 * 1016); |
---|
8 | |
---|
9 | # height and width of paper in gl/2 plotter units minus enough for |
---|
10 | # fonts. |
---|
11 | $plu_height=(1016 * 11) - $font_size_plu; |
---|
12 | $plu_width=(1016 * 8.5) - $font_size_plu; |
---|
13 | |
---|
14 | # use this if control character should print associated character and |
---|
15 | # not perform their associated funtion. |
---|
16 | $transparent_data_command="TD1;"; |
---|
17 | |
---|
18 | # uncomment first scale command a comment the second for stick font. |
---|
19 | # Comment first scale command and uncomment the second for arc fonts. |
---|
20 | # stick font pitch 3 characters per inch |
---|
21 | |
---|
22 | # the 2,0 selection fixed space 3,.5 select 1/2 char per inch. |
---|
23 | #$scale_command="SD2,0,3,.5"; |
---|
24 | #$scale_command="SD2,0,3,.5"; |
---|
25 | # the 2,1 select proportion 4 selects font height |
---|
26 | $scale_command="SD2,1,4,144;"; |
---|
27 | # $scale_command="SD4,144,2,1,7,4101;"; |
---|
28 | |
---|
29 | # stroke weight - use the 9999 weight value to take on the current pen |
---|
30 | # width |
---|
31 | $stroke_weight="SD6,9999;"; |
---|
32 | #$stroke_weight=""; |
---|
33 | # the rest should not need to be changed. |
---|
34 | $line_height=$plu_height/$lines_per_page; |
---|
35 | $col_width=$plu_width/$chars_per_line; |
---|
36 | |
---|
37 | # draw a plus sign - used at the origin of each character |
---|
38 | $horizontal_tick="PA;PD;PW1;PR-4,0,8,0,-4,0;PW0;PA;"; |
---|
39 | $vertical_tick="PA;PD;PW1;PR0,-4,0,8,0,-4;PW0;PA;"; |
---|
40 | |
---|
41 | $header="\033E\033%1BINSP1;PW0;$scale_command$transparent_data_command$stroke_weight"; |
---|
42 | $trailer="\033%1A\033E"; |
---|
43 | |
---|
44 | for( $sym=32; $sym < 256; $sym++ ) { |
---|
45 | # calculate position |
---|
46 | $line = int( ($sym-32) / $chars_per_line ); |
---|
47 | $ypos = $plu_height - (( $line % $lines_per_page ) * $line_height); |
---|
48 | $xpos = (($sym-32) % $chars_per_line) * $col_width; |
---|
49 | |
---|
50 | if ( (($sym-32) % ($lines_per_page * $chars_per_line)) == 0 ) { |
---|
51 | # don't need a trailer on the first page. |
---|
52 | if ( ($sym-32) != 0 ) { |
---|
53 | print $trailer; |
---|
54 | } |
---|
55 | print $header; |
---|
56 | } |
---|
57 | # print the tick marks and character |
---|
58 | print "PU$xpos,$ypos;$horizontal_tick,$vertical_tick"; |
---|
59 | printf "LB%c\003", $sym; |
---|
60 | } |
---|
61 | |
---|
62 | # done - no harm if printed twice |
---|
63 | print $trailer |
---|