The SILC Project

source navigation ]
identifier search ]
freetext search ]
file search ]

silc/scripts/html2ps

  1 : # Use perl
  2 eval 'exec perl -S $0 "$@"'
  3   if $running_under_some_shell;
  4 
  5 # This is html2ps version 1.0 beta3, an HTML-to-PostScript converter.
  6 #   Copyright (C) 1995-2000 Jan Karrman.
  7 #
  8 #   This program is free software; you can redistribute it and/or modify
  9 #   it under the terms of the GNU General Public License as published by
 10 #   the Free Software Foundation; either version 2 of the License, or
 11 #   (at your option) any later version.
 12 #
 13 #   This program is distributed in the hope that it will be useful,
 14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16 #   GNU General Public License for more details.
 17 #
 18 #   You should have received a copy of the GNU General Public License
 19 #   along with this program; if not, write to the Free Software
 20 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 21 #
 22 # Author: Jan Karrman, Dept. of Scientific Computing, Uppsala University,
 23 #         Sweden, e-mail: jan@tdb.uu.se.
 24 
 25 
 26 # Set the name of the global configuration file. See the installation notes
 27 # and manual page for more details on configuration files.
 28 
 29 $globrc='/usr/local/lib/html2ps/html2psrc';
 30 $ug='/usr/local/lib/html2ps/html2ps.html';
 31 
 32 $conf=<<'EOR';
 33 @html2ps {
 34   package {
 35     PerlMagick: 0;
 36     ImageMagick: 0;
 37     pbmplus: 0;
 38     netpbm: 0;
 39     djpeg: 0;
 40     Ghostscript: 0;
 41     TeX: 0;
 42     dvips: 0;
 43     libwww-perl: 0;
 44     jfriedl: 0;
 45     geturl: "";
 46     check: "";
 47     path: "";
 48   }
 49   paper {
 50     type: A4;
 51     height: "";
 52     width: "";
 53   }
 54   option {
 55     twoup: 0;
 56     base: "";
 57     check: 0;
 58     toc: "";
 59     debug: 0;
 60     DSC: 0;
 61     encoding: "ISO-8859-1";
 62     rcfile: "";
 63     frame: 0;
 64     grayscale: 0;
 65     help: 0;
 66     hyphenate: 0;
 67     scaleimage: 1;
 68     cookie: "";
 69     language: "";
 70     landscape: 0;
 71     scalemath: 1;
 72     number: 0;
 73     startno: "";
 74     output: "";
 75     original: 0;
 76     rootdir: "";
 77     xref: 0;
 78     scaledoc: 1;
 79     style: "";
 80     titlepage: 0;
 81     text: 0;
 82     underline: 0;
 83     colour: 0;
 84     version: 0;
 85     web: "";
 86     duplex: "";
 87   }
 88   margin {
 89     middle: 2cm;
 90   }
 91   xref {
 92     text: "[p $N]";
 93     passes: 1;
 94   }
 95   quote {
 96     en {
 97       open: "&ldquo;";
 98       close: "&rdquo;";
 99       open2: "`";
100       close2: "'";
101     }
102     sv {
103       open: "&rdquo;";
104       close: "&rdquo;";
105       open2: "'";
106       close2: "'";
107     }
108     da {
109       open: "&raquo;";
110       close: "&laquo;";
111     }
112     no {
113       open: "&laquo;";
114       close: "&raquo;";
115     }
116     fr {
117       open: "&laquo;&nbsp;";
118       close: "&nbsp;&raquo;";
119     }
120     de {
121       open: "&bdquo;";
122       close: "&ldquo;";
123       open2: "&sbquo;";
124       close2: "`";
125     }
126     fi: sv;
127     es: en;
128     it: no;
129     nn: no;
130     nb: no;
131   }
132   toc {
133     heading: "<H1>Table of Contents</H1>";
134     level: 6;
135     indent: 1em;
136   }
137   titlepage {
138     content: "<DIV align=center>
139       <H1><BIG>$T</BIG></H1>
140       <H2>$[author]</H2></DIV>";
141     margin-top: 4cm;
142   }
143   font {
144     times {
145       names: "Times-Roman
146               Times-Italic
147               Times-Bold
148               Times-BoldItalic";
149     }
150     new-century-schoolbook {
151       names: "NewCenturySchlbk-Roman
152               NewCenturySchlbk-Italic
153               NewCenturySchlbk-Bold
154               NewCenturySchlbk-BoldItalic";
155     }
156     helvetica {
157       names: "Helvetica
158               Helvetica-Oblique
159               Helvetica-Bold
160               Helvetica-BoldOblique";
161     }
162     helvetica-narrow {
163       names: "Helvetica-Narrow
164               Helvetica-Narrow-Oblique
165               Helvetica-Narrow-Bold
166               Helvetica-Narrow-BoldOblique";
167     }
168     palatino {
169       names: "Palatino-Roman
170               Palatino-Italic
171               Palatino-Bold
172               Palatino-BoldItalic";
173     }
174     avantgarde {
175       names: "AvantGarde-Book
176               AvantGarde-BookOblique
177               AvantGarde-Demi
178               AvantGarde-DemiOblique";
179     }
180     bookman {
181       names: "Bookman-Light
182               Bookman-LightItalic
183               Bookman-Demi
184               Bookman-DemiItalic";
185     }
186     courier {
187       names: "Courier
188               Courier-Oblique
189               Courier-Bold
190               Courier-BoldOblique";
191     }
192   }
193   hyphenation {
194     min: 8;
195     start: 4;
196     end: 3;
197     en {
198       file: "";
199       extfile: "";
200     }
201   }
202   header {
203     left: "";
204     center: "";
205     right: "";
206     odd-left: "";
207     odd-center: "";
208     odd-right: "";
209     even-left: "";
210     even-center: "";
211     even-right: "";
212     font-family: Helvetica;
213     font-size: 8pt;
214     font-style: normal;
215     font-weight: normal;
216     color: black;
217     alternate: 1;
218   }
219   footer {
220     left: "";
221     center: "";
222     right: "";
223     odd-left: "";
224     odd-center: "";
225     odd-right: "";
226     even-left: "";
227     even-center: "";
228     even-right: "";
229     font-family: Helvetica;
230     font-size: 8pt;
231     font-style: normal;
232     font-weight: normal;
233     color: black;
234     alternate: 1;
235   }
236   frame {
237     width: 0.6pt;
238     margin: 0.5cm;
239     color: black;
240   }
241   justify {
242     word: 15pt;
243     letter: 0pt;
244   }
245   draft {
246     text: DRAFT;
247     print: "";
248     dir: 0;
249     font-family: Helvetica;
250     font-style: normal;
251     font-weight: bold;
252     color: F0F0F0;
253   }
254   colour {
255     black: 000000;
256     green: 008000;
257     silver: C0C0C0;
258     lime: 00FF00;
259     gray: 808080;
260     olive: 808000;
261     white: FFFFFF;
262     yellow: FFFF00;
263     maroon: 800000;
264     navy: 000080;
265     red: FF0000;
266     blue: 0000FF;
267     purple: 800080;
268     teal: 008080;
269     fuchsia: FF00FF;
270     aqua: 00FFFF;
271   }
272   html2psrc: "$HOME/.html2psrc";
273   imgalt: "[IMAGE]";
274   datefmt: "%e %b %Y  %R";
275   locale: "";
276   doc-sep: "<!--NewPage-->";
277   ball-radius: 0.25em;
278   numbstyle: 0;
279   showurl: 0;
280   seq-number: 0;
281   extrapage: 1;
282   break-table: 0;
283   forms: 1;
284   textarea-data: 0;
285   page-break: 1;
286   expand-acronyms: 0;
287   spoof: "";
288   ssi: 1;
289   prefilled: 0;
290 }
291 
292 BODY {
293   font-family: Times;
294   font-size: 11pt;
295   text-align: left;
296   background: white;
297 }
298 
299 H1, H2, H3, H4, H5, H6 {
300   font-weight: bold;
301   margin-top: 0.8em;
302   margin-bottom: 0.5em;
303 }
304 H1 { font-size: 19pt }
305 H2 { font-size: 17pt }
306 H3 { font-size: 15pt }
307 H4 { font-size: 13pt }
308 H5 { font-size: 12pt }
309 H6 { font-size: 11pt }
310 
311 P, OL, UL, DL, BLOCKQUOTE, PRE {
312   margin-top: 1em;
313   margin-bottom: 1em;
314 }
315 
316 P {
317   line-height: 1.2em;
318   text-indent: 0;
319 }
320 
321 OL, UL, DD { margin-left: 2em }
322 
323 TT, KBD, PRE { font-family: Courier }
324 
325 PRE { font-size: 9pt }
326 
327 BLOCKQUOTE {
328   margin-left: 1em;
329   margin-right: 1em;
330 }
331 
332 ADDRESS {
333   margin-top: 0.5em;
334   margin-bottom: 0.5em;
335 }
336 
337 TABLE {
338   margin-top: 1.3em;
339   margin-bottom: 1em;
340 }
341 
342 DIV.noprint { display: none }
343 
344 DEL { text-decoration: line-through }
345 
346 A:link, HR { color: black }
347 
348 @page {
349   margin-left: 2.5cm;
350   margin-right: 2.5cm;
351   margin-top: 3cm;
352   margin-bottom: 3cm;
353 }
354 
355 EOR
356 
357 eval "require POSIX";
358 $posix = !$@;
359 
360 %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1);
361 %fal=("serif","times", "sans_serif","helvetica", "monospace","courier");
362 @fo=("p","pre","h1","h2","h3","h4","h5","h6","i","b","tt","kbd","cite","samp",
363  "address","blockquote","ol","ul","dl","dt","dd","table","header","footer");
364 %quote=('','en');
365 %valid=('font',1, 'font_files',1, 'margin,left',1, 'margin,right',1,
366  'margin,top',1, 'margin,bottom',1);
367 %cm=('cm',1, 'mm',0.1, 'in',2.54, 'pt',2.54/72, 'pc',2.54/6);
368 %pt=('cm',72/2.54, 'mm',72/25.4, 'in',72, 'pt',1, 'pc',12);
369 %space=('thinsp',6, '#8201',6, 'ensp',2, '#8194',2, 'emsp',1, '#8195',1);
370 $space=join('|',keys %space);
371 %vars=("T","Ti", "N","Pn", "U","UR", "H","h", "A","Au");
372 %height=("letter",27.9, "legal",35.6, "arche",121.9, "archd",91.4, "archc",61,
373  "archb",45.7, "archa",30.5, "flsa",33, "flse",33, "halfletter",21.6,
374  "11x17",43.2, "ledger",27.9);
375 %width=("letter",21.6, "legal",21.6, "arche",91.4, "archd",61, "archc",45.7,
376  "archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14,
377  "11x17",27.9, "ledger",43.2);
378 
379 $version="html2ps version 1.0 beta3";
380 $opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|k:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|t|T|u|"
381  ."U|v|W:|x:";
382 %optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d',
383  'DSC','D', 'encoding','e', 'rcfile','f', 'frame','F', 'grayscale','g',
384  'help','h', 'hyphenate','H', 'scaleimage','i', 'cookie','k', 'language','l',
385  'landscape','L', 'scalemath','m', 'number','n', 'startno','N', 'output','o',
386  'original','O', 'rootdir','r', 'xref','R', 'scaledoc','s', 'style','S',
387  'titlepage','t', 'text','T', 'underline','u', 'colour','U', 'version','v',
388  'web','W', 'duplex','x');
389 %type=( 'paper,height',2, 'paper,width',2, 'option,i',3, 'option,m',3,
390  'option,N',4, 'option,s',3, 'option,x',4, 'xref,passes',4, 'draft,print',5);
391 
392 $usage=<<EOU;
393 Usage:
394  html2ps [-2cdDFghHLnORtTuUv] [-b URL] [-C string] [-e encoding]
395   [-f file[:file[:...]]] [-i num] [-k file] [-l lang] [-m num] [-N num]
396   [-o file] [-r path] [-s num] [-S string] [-W string] [-x num]
397   [file|URL [file|URL [...]]]
398 
399 EOU
400 
401 $usage.="The html2ps users guide is available as $ug\n\n" if(-r $ug);
402 
403 $args="@ARGV";
404 &Getopts($opts) || die $usage;
405 
406 if($opt_d) {
407   open(DBG,">html2ps.dbg") || die "Error opening debug file: html2ps.dbg\n";
408   print STDERR "***** Writing debug info to html2ps.dbg\n";
409   print DBG "***** $version\n***** Command: $0 $args\n***** Perl: $]\n";
410   print DBG "***** HTML2PSPATH=$ENV{'HTML2PSPATH'}\n";
411 }
412 undef $/;
413 $user=0;
414 $V='(-?\d+\.?\d*|-?\d*\.?\d+)';
415 &getconf($conf);
416 &pagedef;
417 undef %AT_page;
418 for(@fo,"draft") {
419   eval "\$deffnt{'$_'}=defined \$$_\{'font-family'\}?"
420       ."\$$_\{'font-family'\}:\$body{'font-family'}";
421 }
422 $user=1;
423 if(open(RC,$globrc)) {
424   $conf=<RC>;
425   print DBG "***** Global file $globrc:\n$conf" if($opt_d);
426   &getconf($conf);
427   close RC;
428 } else {
429   &dbg("Warning: cannot open the global resource file: $globrc\n") if($globrc);
430 }
431 $html2psrc=~s/^(~|\$HOME)/$ENV{"HOME"}/;
432 $prc=$html2psrc;
433 if($opt_f) {
434   ($prc=$opt_f)=~s/^:/$html2psrc:/;
435   $prc=~s/:$/:$html2psrc/;
436   $prc=~s/::/:$html2psrc:/;
437 }
438 $cwd=$posix?POSIX::getcwd():"";
439 opendir(DIR,$cwd);
440 @local=readdir DIR;
441 closedir DIR;
442 $globrc=~/html2psrc/;
443 $gdir=$`;
444 $hpath=$ENV{"HTML2PSPATH"}?$ENV{"HTML2PSPATH"}:".:";
445 $hpath=~s/^:/$gdir:/;
446 $hpath=~s/:$/:$gdir/;
447 $hpath=~s/::/:$gdir:/;
448 $cur=$hpath=~s/(^|:)\.($|:)/$1$cwd$2/;
449 @hpath=split(/:/,$hpath);
450 for(@hpath) {
451   if(opendir(DIR,$_)) {
452     @files=readdir DIR;
453     $files{$_}=" @files ";
454     closedir DIR;
455   }
456 }
457 @rc=split(/:/,$prc);
458 for $rc (@rc) {
459   $found=0;
460   S:for $dir (@hpath) {
461     if(-r $rc && !grep(/^$rc$/,@local) || $files{$dir}=~/ $rc /) {
462       chdir $dir if($files{$dir}=~/ $rc / && $cwd);
463       if(open(RC,$rc)) {
464         $conf=<RC>;
465         print DBG "***** Personal file $rc:\n$conf" if($opt_d);
466         &getconf($conf);
467         close RC;
468         $found=1;
469       }
470       last S;
471     }
472   }
473   &dbg("Error opening resource file: $rc\n") if($opt_f && !$found);
474 }
475 chdir $cwd if($cwd);
476 $user=2;
477 &getconf($opt_S) if($opt_S);
478 print DBG "*****\n" if($opt_d);
479 &pagedef;
480 ($pagew,$pageh)=split /\s+/, $AT_page{'size'} if(defined $AT_page{'size'});
481 
482 require Image::Magick if($package{'PerlMagick'});
483 $geturl=$package{'geturl'};
484 $ulanch="f";
485 $f=72/2.54;
486 $giftopm="giftopnm" if($package{'netpbm'});
487 $giftopm="giftoppm" if($package{'pbmplus'});
488 
489 for(keys %option){eval "\$opt_$_='$option{$_}' if(!defined \$opt_$_)"};
490 die $usage if $opt_h;
491 die "$version\n" if $opt_v;
492 &dbg("$version\n") if ($opt_v||$opt_d);
493 die "Ghostscript is required to generate DSC PostScript\n"
494  if($opt_D && !$package{'Ghostscript'});
495 die "Ghostscript is required to generate cross references\n"
496  if($opt_R && !$package{'Ghostscript'});
497 $tmpname=$posix?POSIX::tmpnam():"h2p_$$";
498 ($scr=$tmpname)=~/\w+$/;
499 $tempdir=$`;
500 
501 if($opt_u) {$ulanch="t"};
502 if(defined $opt_x && $opt_x!~/^[0-2]$/) {
503   die "Illegal duplex value: $opt_x\n";
504 }
505 $V='(-?\d+\.?\d*|-?\d*\.?\d+)';
506 for $o ($opt_s,$opt_i,$opt_m,$opt_N) {
507   die "Non numeric: $o\n" if(defined($o) && $o!~/^$V$/);
508 }
509 
510 $twoup=$opt_2?"t":"f";
511 $xp=$extrapage?"t":"f";
512 
513 die "Invalid option: -W $opt_W\n" if($opt_W!~/^[abflprsL\d]*$/);
514 $tocdoc=$opt_C=~/[ft]/;
515 if($tocdoc && !defined $opt_W) {$opt_W=4};
516 $mult=$#ARGV>0 || $opt_W;
517 $maxlev=$opt_W=~/(\d+)/?$1:4;
518 $link=$opt_W=~/l/;
519 $local=$opt_W=~/s/;
520 $rel=$opt_W=~/r/;
521 $below=$opt_W=~/b/;
522 $layer=$opt_W=~/L/;
523 $prompt=$opt_W=~/p/;
524 
525 if($opt_C && $opt_C!~/^(b?[ft]|[ft]b?|b?h|hb?)$/)
526   {die "Invalid option: -C $opt_C\n"};
527 $tc=$opt_C?"t":"f";
528 $rev=$opt_C=~/t/;
529 $first=$opt_C=~/b/ || $opt_R;
530 $th=$tocdoc?"f":"t";
531 $oeh=0;
532 $oef=0;
533 
534 @now=localtime;
535 @gmnow=gmtime;
536 POSIX::setlocale(&POSIX::LC_TIME,$locale) if($posix);
537 $R='(\s*>|[^a-zA-Z0-9>][^>]*>)';
538 $S='([\w.:/%-]+)|"([^"]*)"|\'([^\']*)\'';
539 $X='[\da-fA-F]';
540 $IM='(gif|jpeg|jpg|png|xbm|xpm|ps|eps)';
541 
542 for('odd-left','odd-center','odd-right','even-left','even-center','even-right')
543  {
544   $oeh=1 if defined $header{$_};
545   $oef=1 if defined $footer{$_};
546 }
547 %metarc=();
548 for $a ('left','center','right') {
549   if(defined $header{"odd-$a"} || defined $header{"even-$a"}) {
550     $oeh=1;
551   }
552   if(defined $footer{"odd-$a"} || defined $footer{"even-$a"}) {
553     $oef=1;
554   }
555   for('','odd-','even-') {
556     $apa=$header{$_.$a};
557     $numb=1 if($apa=~/(^|[^\$])\$N/);
558     &spec($header{$_.$a});
559     &spec($footer{$_.$a});
560     $header{$_.$a}="($apa)";
561     $apa=$footer{$_.$a};
562     $numb=1 if($apa=~/(^|[^\$])\$N/);
563     $footer{$_.$a}="($apa)";
564     &varsub($header{$_.$a},$footer{$_.$a});
565   }
566 }
567 if($oeh) {
568   $yz="/YY [[{$header{'odd-left'}}{$header{'even-left'}}]"
569      ."[{$header{'odd-right'}}{$header{'even-right'}}]"
570      ."[{$header{'odd-center'}}{$header{'even-center'}}]] D\n";
571 } else {
572   $ind=$header{'alternate'};
573   $yz="/YY [[{$header{'left'}}$ind][{$header{'right'}}".(1-$ind)
574      ."][{$header{'center'}}2]] D\n";
575 }
576 if($oef) {
577   $yz.="/ZZ [[{$footer{'odd-left'}}{$footer{'even-left'}}]"
578       ."[{$footer{'odd-right'}}{$footer{'even-right'}}]"
579       ."[{$footer{'odd-center'}}{$footer{'even-center'}}]] D";
580 } else {
581   $ind=$footer{'alternate'};
582   $yz.="/ZZ [[{$footer{'left'}}$ind][{$footer{'right'}}".(1-$ind)
583       ."][{$footer{'center'}}2]] D";
584 }
585 $number=$opt_n || !$numb && ($opt_C || $opt_N || $opt_R)?"t":"f";
586 $tih=$titlepage{'content'};
587 $toch=$toc{'heading'};
588 for ($imgalt,$xref{'text'},$tih,$toch,$inh,$draft{'text'}) {
589   &spec($_);
590 }
591 
592 for ($paper{'height'},$paper{'width'},$margin{'middle'},$frame{'margin'},
593      $mlr,$mrl,$mtl,$mbl,$mll,$mrr,$mtr,$mbr,$pagew,$pageh) {
594   &getval($_,1);
595 }
596 $opt_s*=0.65 if($opt_2 && $opt_L);
597 $opt_N=1 if(!defined $opt_N);
598 $opt_N=int($opt_N-1);
599 $mm=int($margin{'middle'}*$f);
600 $is=0.8*$opt_i;
601 $msc=1/$opt_s;
602 $mag=1200*$opt_m*$opt_s;
603 $xref=$opt_R?"t":"f";
604 $xref{'text'}=~s/\$N/) WB pN WB (/g;
605 
606 $d=int($f*$frame{'margin'});
607 for (0..10) {
608   $temp=2**(-$_/2);
609   $width{"a$_"}=int($temp*2**(-1/4)*1000+.5)/10;
610   $height{"a$_"}=int($temp*2**(1/4)*1000+.5)/10;
611   $width{"b$_"}=int($temp*1000+.5)/10;
612   $height{"b$_"}=int($temp*2**(1/2)*1000+.5)/10;
613 }
614 if(!$pagew || !$pageh) {
615   if($width{"\L$paper{'type'}"}) {
616     $paper{'width'}=$width{"\L$paper{'type'}"} if(!defined $paper{'width'});
617     $paper{'height'}=$height{"\L$paper{'type'}"} if(!defined $paper{'height'});
618     ($pagew,$pageh)=($paper{'width'},$paper{'height'});
619   } elsif($paper{'type'}) {
620     &dbg("Unknown paper type: $paper{'type'}\n");
621   }
622 }
623 if($opt_L) {
624   $wl=$pageh-$mll-$mrl;
625   $wr=$pageh-$mlr-$mrr;
626   $hl=int(($pagew-$mtl-$mbl)*$f+.5);
627   $hr=int(($pagew-$mtr-$mbr)*$f+.5);
628   $xl=int($mtl*$f+.5);
629   $xr=int($mtr*$f+.5);
630   $yl=int($mll*$f+.5);
631   $yr=int($mlr*$f+.5);
632   $rot=" 90 rotate";
633 } else {
634   $wl=$pagew-$mll-$mrl;
635   $wr=$pagew-$mlr-$mrr;
636   $hl=int(($pageh-$mtl-$mbl)*$f+.5);
637   $hr=int(($pageh-$mtr-$mbr)*$f+.5);
638   $xl=int($mll*$f+.5);
639   $xr=int($mlr*$f+.5);
640   $yl=int(($pageh-$mtl)*$f+.5);
641   $yr=int(($pageh-$mtr)*$f+.5);
642   $rot="";
643 }
644 
645 if($opt_2) {
646   $wl=($wl-$margin{'middle'})/2;
647   $wr=($wr-$margin{'middle'})/2;
648 }
649 $wl=int($wl*$f+.5);
650 $wr=int($wr*$f+.5);
651 $pag=int($pageh*$f+.5);
652 $fe=$opt_F?"t":"f";
653 $cf=$opt_U?"t":"f";
654 $tp=$opt_t?"t":"f";
655 $rm=$numbstyle?"t":"f";
656 $pa=$showurl?"t":"f";
657 $nh=$seq_number?"t":"f";
658 $bt=$break_table?"t":"f";
659 $ea=$expand_acronyms?"t":"f";
660 $fi=$prefilled?"t":"f";
661 $latin1=$opt_e=~/ISO-8859-1/i;
662 $lt=$del{'text-decoration'}=~/^line-through$/i?"SE":"WB";
663 if(!$opt_x && defined $opt_x) {
664   $dupl="[{false statusdict/setduplexmode get exec} stopped cleartomark";
665 }
666 if($opt_x) {
667   $dupl="[{true statusdict/setduplexmode get exec} stopped cleartomark";
668 }
669 if($opt_x==2) {
670   $dupl.="\n[{true statusdict/settumble get exec} stopped cleartomark";
671 }
672 
673 %head=("html",1, "head",1, "title",1, "base",1, "meta",1, "link",1, "style",1,
674  "script",1, "isindex",1);
675 %algn=("left",1, "center",2, "right",3, "justify",4, "char",5);
676 %f=("void",1, "above",2, "below",3, "hsides",4, "lhs",5, "rhs",6, "vsides",7,
677     "box",8, "border",9);
678 %r=("none",1, "groups",2, "rows",3, "cols",4, "all",5);
679 %v=("top",1, "middle",2, "bottom",3, "baseline",4);
680 %it=("radio",0, "checkbox",1, "text",2, "password",2, "image",3);
681 %ssy=(200,"\\", 201, "(", 202, ")");
682 %lity=("I",0, "i",1, "A",2, "a",3, "1",4, "disc",5, "square",6, "circle",7);
683 $ltr=join('|',keys %lity);
684 %tex=('`a',"\340", '\^a',"\342", '`e',"\350", '`e',"\350", 'c\{c\}',"\347",
685       "'e","\351", '\^e',"\352", '"e',"\353", '\^i',"\356", '"i',"\357",
686       '\^o',"\364", '`u',"\371", '\^u',"\373", '"u',"\374", '"y',"\377",
687       'aa',"\345", '"a',"\344", '"o',"\366", 'ae',"\346", 'oe',"\225");
688 @hind=(0,0,0,0,0,0);
689 $ltrs='A-Za-z\222-\226\300-\377';
690 %ent=(
691 "lsquo|#8216",96,
692 "rsquo|#8217",39,
693 "circ|#710",141,
694 "tilde|#732",142,
695 "permil|#8240",143,
696 "dagger|#8224",144,
697 "Dagger|#8225",145,
698 "Yuml|#376",146,
699 "scaron|#353",147,
700 "Scaron|#352",148,
701 "oelig|#339",149,
702 "OElig|#338",150,
703 "lsaquo|#8249",151,
704 "rsaquo|#8250",152,
705 "sbquo|#8218",153,
706 "bdquo|#8222",154,
707 "ldquo|#8220",155,
708 "rdquo|#8221",156,
709 "ndash|#8211",157,
710 "mdash|#8212",158,
711 "trade|#8482",159,
712 "nbsp",160,
713 "iexcl",161,
714 "cent",162,
715 "pound",163,
716 "curren",164,
717 "yen",165,
718 "brvbar",166,
719 "sect",167,
720 "uml",168,
721 "copy",169,
722 "ordf",170,
723 "laquo",171,
724 "not",172,
725 "reg",174,
726 "macr",175,
727 "deg",176,
728 "plusmn",177,
729 "sup2",178,
730 "sup3",179,
731 "acute",180,
732 "micro",181,
733 "para",182,
734 "middot",183,
735 "cedil",184,
736 "sup1",185,
737 "ordm",186,
738 "raquo",187,
739 "frac14",188,
740 "frac12",189,
741 "frac34",190,
742 "iquest",191,
743 "Agrave",192,
744 "Aacute",193,
745 "Acirc",194,
746 "Atilde",195,
747 "Auml",196,
748 "Aring",197,
749 "AElig",198,
750 "Ccedil",199,
751 "Egrave",200,
752 "Eacute",201,
753 "Ecirc",202,
754 "Euml",203,
755 "Igrave",204,
756 "Iacute",205,
757 "Icirc",206,
758 "Iuml",207,
759 "ETH",208,
760 "Ntilde",209,
761 "Ograve",210,
762 "Oacute",211,
763 "Ocirc",212,
764 "Otilde",213,
765 "Ouml",214,
766 "times",215,
767 "Oslash",216,
768 "Ugrave",217,
769 "Uacute",218,
770 "Ucirc",219,
771 "Uuml",220,
772 "Yacute",221,
773 "THORN",222,
774 "szlig",223,
775 "agrave",224,
776 "aacute",225,
777 "acirc",226,
778 "atilde",227,
779 "auml",228,
780 "aring",229,
781 "aelig",230,
782 "ccedil",231,
783 "egrave",232,
784 "eacute",233,
785 "ecirc",234,
786 "euml",235,
787 "igrave",236,
788 "iacute",237,
789 "icirc",238,
790 "iuml",239,
791 "eth",240,
792 "ntilde",241,
793 "ograve",242,
794 "oacute",243,
795 "ocirc",244,
796 "otilde",245,
797 "ouml",246,
798 "divide",247,
799 "oslash",248,
800 "ugrave",249,
801 "uacute",250,
802 "ucirc",251,
803 "uuml",252,
804 "yacute",253,
805 "thorn",254,
806 "yuml",255);
807 %symb=(
808 "alpha|#945",141,
809 "beta|#946",142,
810 "gamma|#947",147,
811 "delta|#948",144,
812 "epsilon|#949",145,
813 "zeta|#950",172,
814 "eta|#951",150,
815 "theta|#952",161,
816 "thetasym|#977",112,
817 "iota|#953",151,
818 "kappa|#954",153,
819 "lambda|#955",154,
820 "mu|#956",155,
821 "nu|#957",156,
822 "xi|#958",170,
823 "pi|#960",160,
824 "piv|#982",166,
825 "omicron|#959",157,
826 "rho|#961",162,
827 "sigma|#963",163,
828 "sigmaf|#962",126,
829 "tau|#964",164,
830 "upsilon|#965",165,
831 "upsih|#978",241,
832 "phi|#966",146,
833 "phiv",152,
834 "chi|#967",143,
835 "psi|#968",171,
836 "omega|#969",167,
837 "Alpha|#913",101,
838 "Beta|#914",102,
839 "Gamma|#915",107,
840 "Delta|#916",104,
841 "Epsilon|#917",105,
842 "Zeta|#918",132,
843 "Eta|#919",110,
844 "Theta|#920",121,
845 "Iota|#921",111,
846 "Kappa|#922",113,
847 "Lambda|#923",114,
848 "Mu|#924",115,
849 "Nu|#925",116,
850 "Xi|#926",130,
851 "Omicron|#927",117,
852 "Pi|#928",120,
853 "Rho|#929",122,
854 "Sigma|#931",123,
855 "Tau|#932",124,
856 "Upsilon|#933",125,
857 "Phi|#934",106,
858 "Chi|#935",103,
859 "Psi|#936",131,
860 "Omega|#937",127,
861 "fnof|#402",246,
862 "perp|#8869",136,
863 "plusmn|#177",261,
864 "cdot|#183",327,
865 "or|#8744",332,
866 "and|#8743",331,
867 "le|#8804",243,
868 "ge|#8805",263,
869 "equiv|#8801",272,
870 "cong|#8773",100,
871 "asymp|#8776",273,
872 "ne|#8800",271,
873 "sub|#8834",314,
874 "sube|#8838",315,
875 "sup|#8835",311,
876 "supe|#8839",312,
877 "isin|#8712",316,
878 "larr|#8592",254,
879 "rarr|#8594",256,
880 "uarr|#8593",255,
881 "darr|#8595",257,
882 "harr|#8596",253,
883 "lArr|#8656",334,
884 "rArr|#8658",336,
885 "uArr|#8657",335,
886 "dArr|#8659",337,
887 "hArr|#8660",333,
888 "forall|#8704","042",
889 "exist|#8707","044",
890 "infin|#8734",245,
891 "nabla|#8711",321,
892 "part|#8706",266,
893 "hellip|#8230",274,
894 "int|#8747",362,
895 "sum|#8721",345,
896 "prod|#8719",325,
897 "real|#8476",302,
898 "image|#8465",301,
899 "bull|#8226",267,
900 "prime|#8242",242,
901 "Prime|#8243",262,
902 "oline|#8254",140,
903 "frasl|#8260",244,
904 "weierp|#8472",303,
905 "alefsym|#8501",300,
906 "crarr|#8629",277,
907 "empty|#8709",306,
908 "notin|#8713",317,
909 "ni|#8715","047",
910 "minus|#8722","055",
911 "lowast|#8727","052",
912 "radic|#8730",326,
913 "prop|#8733",265,
914 "ang|#8736",320,
915 "cap|#8745",307,
916 "cup|#8746",310,
917 "sim|#8764",176,
918 "nsub|#8836",313,
919 "oplus|#8853",305,
920 "otimes|#8855",304,
921 "sdot|#8901",327,
922 "lceil|#8968",351,
923 "rceil|#8969",371,
924 "lfloor|#8970",353,
925 "rfloor|#8971",373,
926 "lang|#9001",341,
927 "rang|#9002",361,
928 "spades|#9824",252,
929 "clubs|#9827",247,
930 "hearts|#9829",251,
931 "diams|#9830",250,
932 "loz|#9674",340);
933 
934 $pc=')WB NL NP(';
935 $nimg=-1;
936 $nm=-1;
937 @font=();
938 @size=();
939 @styl=();
940 @alig=();
941 @colr=();
942 @topm=();
943 @botm=();
944 @lftm=();
945 @rgtm=();
946 @z1=();
947 @z2=();
948 @z3=();
949 &Subst($doc_sep);
950 ($toct=$toch)=~s|<[\w/!?][^>]*>||g;
951 $dh="/h0 [()($toct)] D\n";
952 &Subst($toch);
953 $toch=~s/  H\(/ -1 H(/g;
954 $toch="($toch)";
955 &varsub($toch);
956 &Subst($tih);
957 $tih=~s/  H\(/ -1 H(/g;
958 $tih="($tih)";
959 &varsub($tih);
960 $mn=0;
961 $nfont=0;
962 $mi=0;
963 for (@fo) {&setel($_)};
964 %arr=%draft;
965 &fs("draft");
966 
967 if(!$latin1 && !defined $fontid{"times"}) {
968   $fontid{"times"}=$nfont++;
969   @docfonts=(@docfonts,split(/\s+/,$font_names{"times"}));
970 }
971 $wind=0;
972 $wf="t";
973 if(!$latin1) {
974   $wind=$fontid{"times"};
975   $wf="f";
976 }
977 
978 for $k (keys %font_files){
979   @ff=split(/\s+/,$font_files{$k});
980   @fn=split(/\s+/,$font_names{$k});
981   for (0..3) {
982     if($ff[$_]) {
983       $ff{$fn[$_]}=$ff[$_];
984     } elsif(!$ff{$fn[$_]}) {
985       $ff{$fn[$_]}=$ff[0];
986     }
987     $fr{$fn[$_]}=$k;
988   }
989 }
990 $pta=defined $p{"text-align"}?$p{"text-align"}:$body{"text-align"};
991 $pal=0;
992 $pal=1 if($pta=~/^c/i);
993 $pal=2 if($pta=~/^r/i);
994 $pal=3 if($pta=~/^j/i);
995 $bgcol=&col2rgb($body{"background"});
996 if(!$bgcol) {$bgcol="[16#FF 16#FF 16#FF]"};
997 if(!$p{"color"}) {$p{"color"}="black"};
998 $tcol=&col2rgb($p{"color"});
999 $lcol=&col2rgb($a__link{"color"});
1000 if($lcol) {
1001   $Lc="/Lc t D\n/Dl $lcol D\n";
1002   $Lc.=$tcol ne $lcol?"/LX t D":"/LX f D";
1003 } else {
1004   $Lc="/Lc f D\n/LX f D";
1005 }
1006 $pcol=&col2rgb($pre{"color"});
1007 if(!$pcol) {$pcol="[0 0 0]"};
1008 $deftbg=&col2rgb($table{"background"});
1009 $hc=&col2rgb($hr{"color"});
1010 if(!$hc) {$hc="[0 0 0]"};
1011 $fcol=&col2rgb($frame{"color"});
1012 if(!$fcol) {$fcol="[0 0 0]"};
1013 for ($p{"font-size"},$pre{"font-size"},$header{"font-size"},$frame{'width'},
1014  $footer{"font-size"},$justify{'letter'},$justify{'word'},
1015  $titlepage{'margin-top'}) {
1016   &getval($_,2);
1017 }
1018 for ($p{"line-height"},$p{"text-indent"},$p{"margin-top"},$toc{'indent'},
1019      $ball_radius) {
1020   &getval($_,0);
1021 }
1022 $fl="/FL [/".join("\n/",@docfonts)."] D";
1023 for $k (keys %ff) {
1024   $f=$ff{$k};
1025   if(defined $fontid{$fr{$k}} && !defined($cont{$f})) {
1026     open(FONT,$f) || &dbg("Error opening fontfile $f\n");
1027     ($cont{$f}=<FONT>)=~s/(^|\r?\n|\r)%.*//g;
1028     close FONT;
1029   }
1030 }
1031 $fontdef="";
1032 for (keys %cont) {
1033   $fontdef.=$cont{$_};
1034 }
1035 &ent($yz);
1036 &ent($xref{'text'});
1037 &ent($draft{'text'});
1038 
1039 $lnum=0;
1040 for (keys %quote_open) {
1041   $lid{$_}=$lnum++;
1042   if(!defined $quote_close{$_}) {$quote_close{$_}=$quote_open{$_}};
1043   if(!defined $quote_open2{$_}) {$quote_open2{$_}=$quote_open{$_}};
1044   if(!defined $quote_close2{$_}) {$quote_close2{$_}=$quote_close{$_}};
1045   &ent($quote_open{$_});
1046   &ent($quote_close{$_});
1047   &ent($quote_open2{$_});
1048   &ent($quote_close2{$_});
1049   push(@qo,$quote_open{$_});
1050   push(@qc,$quote_close{$_});
1051   push(@qo2,$quote_open2{$_});
1052   push(@qc2,$quote_close2{$_});
1053 }
1054 $qo=join(')(',@qo);
1055 $qc=join(')(',@qc);
1056 $qo2=join(')(',@qo2);
1057 $qc2=join(')(',@qc2);
1058 $hyphenation_file{''}=$hyphenation_file{'en'};
1059 $br=$collapse_br?"f":"t";
1060 $gd=0;
1061 $ddr=defined $draft{'print'};
1062 if($ddr) {
1063   if($draft{'print'}==0) {
1064     $draft="f";
1065   } else {
1066     $gd=1;
1067     $draft="t";
1068   }
1069 }
1070 if(-e '/dev/null' || !-e 'nul') {
1071   $pathsep=':';
1072   $gs='gs';
1073 } else {
1074   $pathsep=';';
1075   $gs='gswin32c';
1076 }
1077 $gb=$gs_bug?"t":"f";
1078 for (keys %quote) {$lid{$_}=$lid{$quote{$_}}};
1079 $ENV{'PATH'}.="$pathsep$package{'path'}" if($package{'path'});
1080 $delim="%-- End of variable part --";
1081 $cd="/Cd {aload length 2 idiv dup dict begin {D} repeat currentdict end} D";
1082 
1083 $mysymb=<<EOF;
1084 /MySymbol 10 dict dup begin
1085  /FontType 3 D /FontMatrix [.001 0 0 .001 0 0 ] D /FontBBox [25 -10 600 600] D
1086  /Encoding 256 array D 0 1 255{Encoding exch /.notdef put}for
1087  Encoding (e) 0 get /euro put
1088  /Metrics 2 dict D Metrics begin
1089   /.notdef 0 D
1090   /euro 651 D
1091  end
1092  /BBox 2 dict D BBox begin
1093   /.notdef [0 0 0 0] D
1094   /euro [25 -10 600 600] D
1095  end
1096  /CharacterDefs 2 dict D CharacterDefs begin
1097   /.notdef {} D
1098   /euro{newpath 114 600 moveto 631 600 lineto 464 200 lineto 573 200 lineto
1099    573 0 lineto -94 0 lineto 31 300 lineto -10 300 lineto closepath clip
1100    50 setlinewidth newpath 656 300 moveto 381 300 275 0 360 arc stroke
1101    -19 350 moveto 600 0 rlineto -19 250 moveto 600 0 rlineto stroke}d
1102  end
1103  /BuildChar{0 begin
1104   /char E D /fontdict E D /charname fontdict /Encoding get char get D
1105   fontdict begin
1106    Metrics charname get 0 BBox charname get aload pop setcachedevice
1107    CharacterDefs charname get exec
1108   end
1109  end}D
1110  /BuildChar load 0 3 dict put /UniqueID 1 D
1111 end
1112 definefont pop
1113 EOF
1114 
1115 $P0=<<EOC;
1116 %%Creator: $version
1117 %%EndComments
1118 save
1119 2000 dict begin
1120 /d {bind def} bind def
1121 /D {def} d
1122 /t true D
1123 /f false D
1124 $fl
1125 /WF $wf D
1126 /WI $wind D
1127 /F $opt_s D
1128 /IW $wr F div D
1129 /IL $hr F div D
1130 /PS $pag D
1131 /EF [@font] D
1132 /EZ [@size] D
1133 /Ey [@styl] D
1134 /EG [@alig] D
1135 /Tm [@topm] D
1136 /Bm [@botm] D
1137 /Lm [@lftm] D
1138 /Rm [@rgtm] D
1139 /EU [@colr] D
1140 /NO $number D
1141 $yz
1142 /Ts EZ 0 get D
1143 /TU $twoup D
1144 /Xp $xp D
1145 /AU $ulanch D
1146 /SN $opt_N D
1147 /Cf $cf D
1148 /Tp $tp D
1149 /Fe $fe D
1150 /TI $toc{'indent'} Ts mul D
1151 /Fm $d D
1152 /xL $xl D
1153 /xR $xr D
1154 /yL $yl D
1155 /yR $yr D
1156 /Wl $wl F div D
1157 /Wr $wr F div D
1158 /hL $hl F div D
1159 /hR $hr F div D
1160 /FE {newpath Fm neg Fm M CP BB IW Fm add Fm L IW Fm add IL Fm add neg L CP BB
1161  Fm neg IL Fm add neg L closepath} D
1162 /LA {PM 0 eq{/IW Wl D /IL hL D}{/IW Wr D /IL hR D}ie /W IW D /LL W D /LS W D
1163  /LE IL D TU PM 0 eq and{IW $mm F div add SA{Sf div}if 0 translate}
1164  {PM 0 eq{xL yL}{xR yR}ie translate$rot F SA{Sf mul}if dup scale
1165  CS CF FS Cf{CA CL get VC}if /Bb f D}ie 0 0 M
1166  TF not Tc or {Cf{gsave SA{1 Sf div dup scale}if Cb VC FE fill grestore}if}if}D
1167 /Pi $p{"text-indent"} Ts mul D
1168 /SG [$is $opt_i $msc] D
1169 /Ab $justify{'word'} D
1170 /J $justify{'letter'} D
1171 /Tc $tc D
1172 /NH $toc{'level'} D
1173 /Nf $nh D
1174 /Pa $pa D
1175 /LH $p{"line-height"} D
1176 /XR $xref D
1177 /Xr {/pN E D ( $xref{'text'} )WB} D
1178 /Db $bgcol D
1179 /Dt $tcol D
1180 /eA $ea D
1181 /Fi $fi D
1182 /bT $bt D
1183 $Lc
1184 /Br $ball_radius D
1185 /IA ($imgalt) D
1186 /DS {/PF f D($doc_sep)pop RC ZF} D
1187 /Gb $gb D
1188 /Mb $br D
1189 /Hc $hc D
1190 /Bl 3 D
1191 /MI -$mi D
1192 /DX ($draft{'text'}) D
1193 /Di $draft{'dir'} D
1194 /Tt $titlepage{'margin-top'} D
1195 /Th {$tih} D
1196 /tH {$toch} D
1197 /FD $fontid{"\L$font"} D
1198 /Dy $styl D
1199 /cD $col D
1200 /FW $frame{'width'} D
1201 /FU $fcol D
1202 /ET {/RM $rm D /A0 $pal D /PN SN D /OU t D /Ou t D /W IW D /LL W D D1
1203  Ms not TP and{Ip}if /TF f D} D
1204 $dupl
1205 $delim
1206 $mysymb
1207 EOC
1208 
1209 $reenc=<<EOD;
1210 WF{FL{reencodeISO D}forall}{4 1 FL length 1 sub{FL E get reencodeISO D}for}ie
1211 /Symbol dup dup findfont dup length dict begin
1212  {1 index /FID ne{D}{pop pop}ie}forall /Encoding [Encoding aload pop]
1213  dup 128 /therefore put D currentdict end definefont D
1214 EOD
1215 $defs=<<EOD;
1216 /reencodeISO {
1217  dup dup findfont dup length dict begin{1 index /FID ne{D}{pop pop}ie}forall
1218  /Encoding ISOLatin1Encoding D currentdict end definefont} D
1219 /ISOLatin1Encoding [
1220 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1221 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1222 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1223 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1224 /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright
1225 /parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
1226 /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon
1227 /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N
1228 /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright
1229 /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m
1230 /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde
1231 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1232 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1233 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1234 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1235 /.notdef/space/exclamdown/cent/sterling/currency/yen/brokenbar
1236 /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot
1237 /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior
1238 /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine
1239 /guillemotright/onequarter/onehalf/threequarters/questiondown
1240 /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
1241 /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
1242 /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
1243 /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute
1244 /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis
1245 /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave
1246 /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex
1247 /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis
1248 /yacute/thorn/ydieresis
1249 ] D
1250 [128/backslash 129/parenleft 130/parenright 141/circumflex 142/tilde
1251 143/perthousand 144/dagger 145/daggerdbl 146/Ydieresis 147/scaron 148/Scaron
1252 149/oe 150/OE 151/guilsinglleft 152/guilsinglright 153/quotesinglbase
1253 154/quotedblbase 155/quotedblleft 156/quotedblright 157/endash 158/emdash
1254 159/trademark]
1255 aload length 2 idiv 1 1 3 -1 roll{pop ISOLatin1Encoding 3 1 roll put}for
1256 /colorimage where{pop}{
1257  /colorimage {
1258   pop pop /Pr E D {/Cv Pr D /Gr Cv length 3 idiv string D 0 1 Gr length 1 sub
1259    {Gr E dup /i E 3 mul D Cv i get 0.299 mul Cv i 1 add get 0.587 mul add
1260     Cv i 2 add get 0.114 mul add cvi put}for Gr} image} D
1261 }ie
1262 /pdfmark where{pop}{userdict /pdfmark /cleartomark load put}ie
1263 EOD
1264 
1265 $P1=<<EOT;
1266 $cd
1267 /EX {EC cvx exec} D
1268 /DU {} d
1269 /BB {pop pop}d
1270 /ie {ifelse} d
1271 /E {exch} d
1272 /M {moveto} d
1273 /R {rmoveto} d
1274 /L {lineto} d
1275 /RL {rlineto} d
1276 /CP {currentpoint} d
1277 /SW {stringwidth} d
1278 /GI {getinterval} d
1279 /PI {putinterval} d
1280 /Sg {setgray} d
1281 /LW {setlinewidth} d
1282 /S {dup () ne OU and{0 Co R AT 3 eq LB and HF not and A1 0 ne A2 0 ne or and
1283  {A2 0 32 A1 0 6 -1 roll awidthshow}{show}ie 0 Co neg R}{pop}ie
1284  OU PH 3 eq or{/Ms t D}if} D
1285 /U {OU{gsave CP currentfont /FontInfo get /UnderlinePosition get
1286  0 E currentfont /FontMatrix get dtransform E pop add newpath M dup SW pop
1287  CJ 0 RL stroke grestore}if} D
1288 /B {OU Br 0 gt and{CP Ts neg Ts .33 mul R gsave 0 Sg
1289  CP newpath Ts Br mul 0 360 arc closepath UI 2 mod 0 eq{stroke}{fill}ie
1290  grestore M CP E Ts Br 1 add mul sub E BB /Ms t D}if}D
1291 /NP {Ms TP not or PA and OU and{TP{OR}if f1{mF k2 /mF E D /YC 0 D}if
1292  TP TU not PM 0 eq or and{showpage}if DU Ip TE not{LA}if 0.6 LW
1293  /CI 0 D /TP t D /Hs f D /hl 6 D /Hv 6 D /HI hi D /Ms f D}if Bs XO BO M} D
1294 /Np {LE sub CP E pop gt PL 0 eq and{NP}if}D
1295 /Ip {/PN PN 1 add D /Pn RM{1}{4}ie PN Ns D /PM PN SN sub 2 mod D} D
1296 /GP {E dup 3 -1 roll get PN 1 add 2 mod get dup type /integertype eq
1297  {get 0 get}{E pop}ie}d
1298 /Fc {dup 2 GP exec SW pop /S1 E D dup 1 GP exec SW pop /S2 E D 0 GP exec SW
1299  pop /S3 E D S1 0 gt{S2 2 mul S1 add S3 2 mul S1 add 2 copy lt{E}if pop}{0}ie
1300  S2 S3 add 2 copy lt{E}if pop IW .9 mul div dup 1 gt{1 E div}{pop 1}ie}D
1301 /OR {Df{Sd}if tp not{gsave SA{1 Sf div dup scale}if Fe{Cf{FU VC}if FW LW
1302  1 setlinejoin FE stroke}if /YO {60 F div dup 40 gt{pop 40}if}D /cs CS D
1303  /cf CF D /CF 0 D /pf PF D /PF f D /Fn FN D /At AT D /AT 0 D /FN EF Hf 1 add
1304  get D Fz Fs FS ZZ Fc Fz mul Fs FS EU Hf 1 add get dup type /arraytype eq
1305  Cf and{VC}{pop 0 Sg}ie IW IL neg YO sub M ZZ 1 GP exec dup SW pop neg 0 R Sh
1306  0 IL neg YO sub M ZZ 0 GP exec Sh ZZ 2 GP exec dup SW pop IW E sub 2 div
1307  IL neg YO sub M Sh Fz Fs FS NO{/AW IW Pn SW pop sub D AW 2 div IL neg YO sub
1308  S1 0 gt S2 AW .45 mul gt or S3 AW .45 mul gt or{Fz 2 mul sub}if M Pn Sh}if
1309  EU Hf get dup type /arraytype eq Cf and{VC}{pop 0 Sg}ie YY Fc /FN EF Hf get D
1310  Hz mul HS FS IW YO M YY 1 GP exec dup SW pop neg 0 R Sh 0 YO M YY 0 GP exec Sh
1311  YY 2 GP exec dup SW pop IW E sub 2 div YO M Sh /FN Fn D /AT At D t Pb XO SZ
1312  SL get neg R /PF pf D grestore /CF 0 D cs cf FS}if}D
1313 /Sh {dup () ne{CP Hz 4 div sub BB show CP CS add BB}{pop}ie}D
1314 /Pb {/OU E D /Ou OU D /PB t D 0 0 M Ba{/Sa save D /BP t D /Fl t D RC /PL 0 D
1315  /PH 0 D /W IW D /LE IL .7 mul D /EO 0 D SI ZF /YA 0 D /BO 0 D /C1 () D
1316  BA 0 Ts neg R Bb{Xl Yl Xh Yh}if Bb CP Sa restore M
1317  {/Yh E D /Xh E D /Yl E D /Xl E D}if /Fl t D}if
1318  BL /OU t D /HM f D /Ou t D /PB f D} D
1319 /Bs {/BP Ba not D}D
1320 $defs$fontdef$reenc
1321 /SF {/CS E D SZ SL CS put FO SL FN put /YI CS LH neg mul D dup ST cvs ( ) join
1322  CS ST cvs join C1 E join ( NF ) join /C1 E D CS NF /Wf WF FN 0 gt or D
1323  /BW Wf{( ) SW pop}{0}ie D}D
1324 /NF {/cS E D /cF E D cF 0 ge{FL cF get}{cF -1 eq{/Symbol}{/MySymbol}ie}ie
1325  findfont cS scalefont setfont} D
1326 /FS {CF or /CF E D FR SL CF put CF CF 0 ge{FN 4 mul add}if E SF} D
1327 /PC {SH /BP f D fin not GL not and{NL}if /HM t D /LL LS D} D
1328 /BS {/TX E D Wf{/fin f D /CW 0 D /LK 0 D /SC 0 D
1329  /RT TX D {RT ( ) search{/NW E D pop /RT E D /WH NW SW pop D CW WH add LL gt
1330  {TX SC LK SC sub 1 sub NN GI GL{SH cF cS OC
1331  2 copy cS ne E cF ne or{NF}{pop pop}ie}{PC /CW WH BW add D}ie
1332  /SC LK D}
1333  {GL{JC}if
1334  /CW CW WH add BW add D /HM t D}ie /GL f D /Ph f D
1335  /LK LK NW length 1 add add D}{pop exit}ie}loop
1336  /fin t D TX SC LK SC sub GI SH RT () ne{GL not{CC}if}if
1337  /LC TX length D /WH RT SW pop D CW WH add Hy{HC SW pop add}if LL gt
1338  {RT GL{SH cF cS OC 2 copy cS ne E cF ne or{NF}{pop pop}ie
1339  Hy{/Ph t D}if /LL LS D}{NL /LL LS D SH}ie}
1340  {RT PC Hy{CC}if /Ph Ph Hy or D}ie RT () ne{/GL t D /HM t D}if}
1341  {TX SW pop LL le{TX SH}{/NW () D 0 2 TX length 1 sub
1342  {/CW E D TX 0 CW GI dup SW pop LL gt{pop NW SH /HM t D NL/LL W XO sub MR sub D
1343  /CW CW 2 sub NN D /TX TX CW TX length CW sub GI D TX BS exit}
1344  {/NW E D}ie}for}ie}ie /HM t D}D
1345 /CC {C0 length 0 gt{JC}if /C0 [C1 L1 YA YB Mf NS NB TB AF Bw] D
1346  /C1 () D /L0 L1 D /YA 0 D /YB 0 D /Mf 0 D /NS 0 D /NB 0 D}D
1347 /JC {C0 aload length 0 gt{pop pop pop NB add /NB E D NS add /NS E D
1348  dup Mf gt{/Mf E D}{pop}ie dup YB gt{/YB E D}{pop}ie
1349  dup YA gt{/YA E D}{pop}ie pop C1 join /C1 E D /C0 [] D}if}D
1350 /OC {C0 length 0 gt{C1 L1 L0 sub YA YB Mf NS NB TB AF Bw GL C0 aload pop
1351  /Bw E D /AF E D /TB E D /NB E D /NS E D /Mf E D /YB E D /YA E D /C0 [] D
1352  /L1 E D /C1 E D Ph{HC SH}if NL /GL E D /Bw E D /AF E D /TB E D /NB E D /NS E D
1353  /Mf E D /YB E D /YA E D /L1 E D /LL W L1 sub XO sub MR sub WH sub D /CW 0 D
1354  C1 E join /C1 E D}if}D
1355 /BT {/LB t D dup length string copy RS dup dup () ne E ( ) ne and
1356  {/CI 0 D /LS LL D /LL W L1 sub XO sub MR sub D BS}
1357  {dup ( ) eq{/GL f D}if dup () eq L1 0 eq or{pop}{SH /BP f D /Ph f D}ie}ie
1358  /LB f D} D
1359 /BL {CP E pop XO E M} D
1360 /NL {JC /GL f D /SK W XO sub MR sub L1 sub TB{Bw add}if D
1361  /YA LF{Mf HM Fl not and PF or{LH mul}if}{0 /LF t D}ie YA 2 copy lt{E}if pop D
1362  C1 () ne{/FB YB Mf SA{Sf mul}if 4 div 2 copy lt{E}if pop D}if Fl{/Ya YA D}if
1363  CP E pop YA sub YB sub LE neg lt Fl not and PB not and{NP}if NT TL BL
1364  OU PF not and PB or{/RE L1 TB{Bw sub}if
1365  W XO sub MR sub div YA YB add LE BO add div 2 copy lt{E}if pop D
1366  RE 1 gt{BL 1 RE div dup scale}if}if
1367  AT 2 le{SK AT mul 2 div YA neg R}if
1368  AT 3 eq{0 YA neg R TB{/NB NB 1 sub D /NS NS 1 sub D}if /NB NB 1 sub NN D
1369  /A3 NS 6 mul NB add D NS NB add 0 eq
1370   {/A1 0 D /A2 0 D}
1371   {NS 0 eq{/A1 SK NB div dup J gt{pop 0}if D /A2 0 D}{J A3 mul SK lt
1372    {/A1 J D /A2 SK J NB mul sub NS div dup Ab gt{/A1 0 D pop 0}if D}
1373    {/A1 SK A3 div D /A2 A1 6 mul D}ie}ie}ie /A1 A1 NN D /A2 A2 NN D}if
1374  AT 4 eq{0 YA neg R PH 2 le{PD 0 lt{/PD L1 D}if PD M1 gt{/M1 PD D}if
1375  L1 PD sub M2 gt{/M2 L1 PD sub D}if}{DV ID 1 sub get 0 ge{Lo 0 R}if}ie}if
1376  F0 cF ne Cs cS ne or{F0 Cs NF}if
1377  /ms Ms D /Ms f D CP FB sub
1378  C1 cvx exec XO EO sub L1 add TB{BW sub}if dup LM gt{/LM E D}{pop}ie
1379  PH 0 eq PH 4 eq or Ms and{HF not{/PO t D /AH t D}if
1380  BB CP YA add E AT 3 eq LB and{A1 sub}if TB{BW sub}if E BB}
1381  {pop pop}ie Ms HM PH 3 eq and or{/BP f D /Fl f D}if
1382  /Lo 0 D /L1 0 D /F0 cF D /Cs cS D BP not{0 YB NN neg R}if
1383  OU f1 and mF not and{k2 /f1 f D}if
1384  OU PF not and PB or{RE 1 gt{RE dup scale}if}if /Ms ms Ms or D
1385  /C1 AF{(Cp )}{()}ie D /YA 0 D /YB 0 D BL
1386  AT 4 eq LB not and PH 3 ge and
1387  {ID DV length lt{DV ID get dup 0 ge{DO E sub /Lo E D /L1 Lo D}{pop}ie
1388  /ID ID 1 add D}if}if /T t D CD{/LN LN 1 add D PD}if
1389  /PD -1 D /NS 0 D /NB 0 D /TB f D /Ph f D /Mf 0 D /HM f D} D
1390 /RS {/TM E D /CN 0 D TM{10 eq{TM CN ( ) PI}if /CN CN 1 add D}forall
1391  /CN 0 D /BK HM EN and{0}{1}ie D TM
1392  {dup 32 ne{TM CN 3 2 roll put /CN CN 1 add D /BK 0 D}
1393  {pop BK 0 eq{TM CN 32 put /CN CN 1 add D}if /BK 1 D}ie}forall
1394  TM 0 CN GI dup dup () ne E ( ) ne and
1395  {dup CN 1 sub get 32 eq{/EN f D}{/EN t D}ie}if} D
1396 /join {2 copy length E length add string dup 4 2 roll 2 index 0 3 index
1397  PI E length E PI}d
1398 /WR {(\\n) search{dup () ne BP not or
1399  {Li 4 le CP E pop YI Li mul add LE add 0 lt and PL 0 eq and{NP}if
1400  SH NL pop /Li Li 1 sub D WR}{pop pop WR}ie}{SH}ie /CI 0 D /BP f D} D
1401 /SH {dup dup () ne E ( ) ne and PF or CS Mf gt and{/Mf CS D}if
1402  T not Wf and{( ) E join /T t D}if dup BP{/MF CS D}if
1403  AT 3 eq{2 copy length dup 0 gt{/NB E NB add D
1404  {( ) search{/NS NS 1 add D pop pop}{pop exit}ie}loop}{pop pop}ie}if
1405  CD PD 0 lt and{dup DC search{SW pop /PD E L1 add D pop pop}{pop}ie}if
1406  0 Np dup SW pop L1 add /L1 E D dup () ne
1407  {C1 (\\() join E join (\\)) join AU AF and UF or Wf and{( U ) join}if
1408  sF{( s ) join}if ( S ) join
1409  /C1 E D dup length 1 sub get 32 eq /TB E D /Bw BW D}{pop pop}ie} D
1410 /BG {AI LG BC add add 0 eq} D
1411 /ON {OU{Ty AR AI NN get dup 1 add Ln Ns Ty 2 mod 0 eq{(.  )}{(\\)  )}ie join
1412  dup SW pop neg 0 R CP E 0 lt{0 E M}{pop}ie CP BB show /Ms t D}if} D
1413 /Ln {AR AI 3 -1 roll put}D
1414 /SP {dup CI lt BP not and{dup CI sub 0 E R /CI E D}{pop}ie} D
1415 /BN {PF{WR /HM f D}{BT NL}ie} D
1416 /NN {dup 0 lt{pop 0}if} D
1417 /h {(h) HI ST cvs join cvx exec dup 1 get E Nf{0 get E join}{pop}ie} D
1418 /H {/fn FN D /Hi E 1 add D 1 sub /HL E D /H2 HL 2 add D /GS EZ H2 get D
1419  E Tm H2 get GS mul BE dup 0 gt{1 sub}{pop EG H2 get dup 0 lt{pop AT}if}ie NA
1420  WW Np /SL SL 1 add D /FN EF H2 get D GS Ey H2 get FS
1421  EU H2 get Sc Hs not HL Hl lt and Hs HL hl lt and or Hi 0 eq or
1422  {/HI Hi D /Hs t D /hl HL D /Hv HL D}if HL Hl lt{/hi Hi D}if
1423  Nf HI 0 gt and{(h) Hi ST cvs join cvx exec 0 get WB}if
1424  /HF t D /AH f D /PO f D} D
1425 /EH {Bm H2 get GS mul BE OA /SL SL 1 sub NN D /CF 0 D /FN fn D
1426  SZ SL get FR SL get FS /HF f D /GS Ts D ()Ec} D
1427 /P {E PF{WR}{PO{EP}{BN}ie Ts 4 mul Np AE not{Tm 0 get Ts mul neg SP}if
1428  dup 0 ge AH and{Pi Pd}if}ie 1 sub dup 0 lt{pop AV AL get}if /AT E D /PO t D} D
1429 /EP {PF{WR}{BN Ts 4 mul Np}ie AE not{Bm 0 get Ts mul neg SP}if
1430  /AT AV AL get D /PO f D} D
1431 /BE {E PO{EP}{BN}ie Ts 4 mul Np neg SP} D
1432 /HR {/Aw W EO sub D /RW E dup 0 gt{Aw mul}{neg}ie dup Aw gt{pop Aw}if D /RZ E D
1433  E BN Ts neg SP 1 sub 2 div Aw RW sub mul EO add CP E pop M PF{0 Ps neg R}if
1434  0 Np OU{gsave RZ LW Cf{Hc VC}{0 Sg}ie CP BB RW 0 RL CP BB stroke grestore}if
1435  /CI 0 D /BP f D PF not{Ts neg SP}if /Ms t D} D
1436 /AD {I NL EG 14 get dup 0 lt{pop AT}if NA /AE t D Tm 14 get Ts mul neg SP
1437  Cf{EU 14 get dup -1 eq{pop CA CL get}if Sc}if} D
1438 /DA {BN ()ES OA /AE f D ()Ec Bm 14 get Ts mul neg SP} D
1439 /PR {/MW E D /Li E D Tm 1 get Ps mul BE 0 NA /FN Fp D /PF t D SI /SL SL 1 add D
1440  /CF 0 D Ps CS mul Ts div MW WC mul CS mul Ts div dup LL gt PL 0 eq and
1441  {LL div div}{pop}ie Ey 1 get FS CP E pop LE add YI neg div cvi dup Li lt
1442  AH and{4 lt YI Li mul 5 mul LE add 0 gt or PL 0 eq and{NP}if}{pop}ie
1443  EU 1 get Sc /GS Ps D}D
1444 /RP {WR NL () /PF f D SI /FN 0 D ES Bm 1 get Ps mul neg SP OA /GS Ts D} D
1445 /SI {/XO Lm 15 get BC NN mul Lm 16 get AI UI sub NN mul add
1446  Lm 17 get UI NN mul add Lm 20 get LG NN mul add Ts mul
1447  PF{Lm 1 get Ps mul add}if EO add D
1448  /MR Rm 15 get BC NN mul Rm 16 get AI UI sub NN mul add
1449  Rm 17 get UI NN mul add Rm 20 get LG NN mul add Ts mul
1450  PF{Rm 1 get Ps mul add}if D /LL W XO sub MR sub D} D
1451 /DT {/cC E D BN /LG LG 1 sub D SI /LG LG 1 add D WW 2 div Np BL} D
1452 /DD {WB Cc 0 eq cC 0 eq and L1 0 eq or Lm 20 get Ts mul L1 sub TB{BW add}if
1453  Ts 2 div lt or NL /LF E D SI BL /cC 0 D} D
1454 /DL {Dc LG Cc put /Cc E D BG{Tm 18 get Ts mul BE}{BN}ie /LG LG 1 add D BL} D
1455 /LD {BN LG 0 gt{/LG LG 1 sub D}if /Cc Dc LG get D SI
1456  BG{()Bm 18 get Ts mul BE}if BL} D
1457 /UL {BG{Tm 17 get Ts mul BE}{BN}ie NR AI NN 0 put /UI UI 1 add D
1458  /AI AI 1 add D SI BL} D
1459 /LU {BN /UI UI 1 sub D /AI AI 1 sub D SI BG{()Bm 17 get Ts mul BE}if BL} D
1460 /OL {E BG{Tm 16 get Ts mul BE}{BN}ie TR AI NN Ty put /Ty E D NR AI NN 1 put
1461  /AI AI 1 add D SI BL 1 Ln} D
1462 /LO {BN /AI AI 1 sub D /Ty TR AI get D SI BG{()Bm 16 get Ts mul BE}if BL} D
1463 /LI {E BN -1 SP /BP f D /CI 0 D 0 Np NR AI 1 sub NN get 1 eq
1464  {dup dup 0 gt E 4 le and{/Ty E D}{pop}ie
1465  /L1 L1 Ty AR AI NN get Ns SW pop XO sub dup 0 lt{pop 0}if add D ( ON )}
1466  {pop ( B )}ie C1 E join /C1 E D CS Mf gt{/Mf CS D}if BL} D
1467 /BQ {Tm 15 get Ts mul BE /BC BC 1 add D SI BL} D
1468 /QB {Bm 15 get Ts mul BE /BC BC 1 sub D SI BL} D
1469 /Al {E EP 1 sub dup 0 lt{pop AV AL get}if NA} D
1470 /Ea {EP OA} D
1471 /WB {PF{WR}{BT}ie} D
1472 /F1 {WB /FN 0 D CS 0 FS} D
1473 /F2 {WB /FN WI D CS 0 FS} D
1474 /HY {/Hy t D WB /Hy f D} D
1475 /YH {WB} D
1476 /A {/LT E D LT 1 eq{/RN E D}if /Lh E D WB /C1 C1 ( Cp ) join D
1477  Lc AF not and{Cl Sc}if /AF t D} D
1478 /EA {Lc AF and{Ec}{WB}ie TL Pa AF and Lh 0 ne and
1479  {( \\() Lh join (\\)) join /AF f D WB}if /AF f D} D
1480 /TL {C1 ( Tl ) apa /C1 E D} d
1481 /apa {AF OU and Lh 0 ne LT 1 eq or and{LT 1 eq{RN ( /) E ST cvs join}
1482  {(\\() Lh join (\\)) join}ie E join join}{pop}ie} d
1483 /Cp {/Xc CP /Yc E D D} D
1484 /SS {Cf{dup 0 ge{EU E get dup -1 eq{pop CA CL get}if}{pop CA CL get}ie Sc}
1485  {pop}ie SZ SL get /SL SL 1 add D} D
1486 /I {WB 8 SS 1 FS} D
1487 /EM {WB 8 SS /CF CF 1 xor D 0 FS} D
1488 /BD {WB 9 SS 2 FS} D
1489 /TT {WB 10 SS /FN Fp D 0 FS} D
1490 /KB {WB 11 SS /FN Fp D 2 FS} D
1491 /CT {WB 12 SS 1 FS} D
1492 /SM {WB 13 SS /FN Fp D 0 FS} D
1493 /Q {/QL QL 1 add D QO QL 2 mod get La get join WB} D
1494 /EQ {QC QL 2 mod get La get join WB /QL QL 1 sub D} D
1495 /RO {WB -1 SS /CF 0 D 0 FS} D
1496 /SY {WB -1 SS -1 FS} D
1497 /MY {WB -1 SS -2 FS} D
1498 /ES {WB /SL SL 1 sub NN D /CF 0 D /FN FO SL get D SZ SL get FR SL get FS ()Ec}D
1499 /FZ {3 sub 1.2 E exp GS mul E WB TL /C1 C1 ( Cp ) join D /SL SL 1 add D 0 FS} D
1500 /Ef {WB TL ()ES /C1 C1 ( Cp ) join D} D
1501 /BZ {dup /Bf E D FZ}D
1502 /Sc {dup -1 ne Cf and{/CL CL 1 add D dup 0 eq{pop [0 0 0]}if
1503  dup CA E CL E put VS ( VC ) join C1 E join /C1 E D}{pop}ie} D
1504 /Ec {WB Cf{/CL CL 1 sub NN D CA CL get VS ( VC ) join C1 E join /C1 E D}if} D
1505 /VS {dup type /arraytype eq{([) E {ST cvs join ( ) join}forall (]) join}if} D
1506 /VC {{255 div}forall setrgbcolor} D
1507 /Sl {dup type /integertype ne{Ds}if /La E D WB}d
1508 /UN {WB /UF t D} D
1509 /NU {WB /UF f D} D
1510 /SE {WB /sF t D} D
1511 /XE {WB /sF f D} D
1512 /sM {/C1 C1 ( k1 ) join D}d
1513