#!/usr/local/bin/perl -w # # txt2ps # # Convert a text file to a postscript file. # # The home for this program is at: # http://mordred.ao.com/phone.list/ # # Dave Regan # 9 May 2000 # regan@mordred.ao.com # use strict; use vars qw($Linenum $Nlines $Npoints); ### ### Main program ### $Nlines = 66; $Npoints = 72 * 11 - 20; print "%!\n"; #print "/Times-Roman findfont 12 scalefont setfont\n"; print "/Courier findfont 10 scalefont setfont\n"; print "0 0 0 setrgbcolor\n"; $Linenum = 1; while (<>) { chomp; emitline($_); } print "showpage\n"; # Write out an entire line sub emitline { my($line) = @_; if ($line =~ /\f/) { $line =~ s/\f//; print "showpage\n"; $Linenum = 1; } $line =~ s/([()\\])/\\$1/g; print "50 ", $Npoints - $Linenum++ * ($Npoints / $Nlines), " moveto ($line) show\n"; }