% Andrew Trevorrow, June 1988 % All my changes (both here and in .WEB file) are flagged with "AKT". % AKT: Text file Change file for Crudetype. @x *** Attach printer change file here *** @y \vskip 0.5in \centerline{The text file change file for Crudetype starts here} \vskip 0.5in @= device_ID = 'Text file'; @ Where will the printed file go to? @= set_string( print_end, '.TXT ' , ' ', 32 ) ; {AKT: was .PRI} @ The first lot of data describes the printer's overall style of carriage control. |fortran| means that the carriage control character gets put at the start of the line, and it is here assumed that it must be inserted explicitly. Note also that the program makes no attempt to check all these values for consistency. @= fortran = false ; list = true ; {AKT: was false} w_l_does_c_r = true ; {AKT: was false} b_feed_absolute = false ; b_feed_by_string = false ; feed_absolute = false ; b_feed_scream = true ; b_space_absolute = false ; b_space_by_string = false ; space_absolute = false ; abs_is_incr = false ; want_split = true ; is_header = false ; {each page needs a header} param_type = 'D' ; @ This batch is concerned with distances and resolutions. @= l_margin = 0 ; {AKT: was 6} top_margin = 0 ; {AKT: was 6} h_resolution = 10 ; {|h_steps| per inch} v_resolution = 6 ; {|v_steps| per inch} fixed_width = true ; {printers characters are fixed width} char_width = 1 ; {all printer characters are this width, in units of |h_step|. Normally, |space_dist| will be equal to this, but some printers are not normal!} gap_width = 1 ; {Intended minimum space between words} char_ht = 1 ; @ The general run of \TeX\ characters are narrower than line-printer chars. So we spread them out to make them fit. @= h_fudge := 7.227 {number of points per |h_step|} / 5.25 ; {A typical design width} v_fudge := 1.2 ; {AKT: was 2.0 to force double-spacing } @ @= h_fudge, v_fudge: real_num ; @ Next, some constants for rule-setting. @= rail_width = 1 ; {Height and width of rule chars, in steps} rail_height = 1 ; post_width = 1 ; post_height = 1 ; rail_types = 2 ; @ @= rail_chars[1] := codes[ 1, 95 ] ; rail_chars[2] := codes[ 1, 45 ] ; post_char := codes[ 1, 124] ; @ @= do_pause = false ; pause_steps = 20 ; pause_ask = 'PAUSED. Type to continue' ; @ The next batch are concerned with fonts. @= min_font = 1 ; {smallest and largest number of printers resident fonts} max_font = 1 ; only_one_font = true ; can_dl_font = false ; min_dl_font = 0 ; max_dl_font = 0 ; {printers down-loadable fonts} max_codes = 9 ; {AKT: was 8; no. of known \TeX\ coding schemes} max_char = 255 ; {AKT: was 127; max. no. of chars per \TeX\ or PS font} max_plain = 4 ; {Max number of a plain text font} @ Finally, consider command strings. These are intended to set options, but a line printer hasnt any. @= start_stuff := blank ; stop_stuff := blank ; page_top := blank ; pause_after := blank ; @* Character code data for the printer. Here we actually put data into the |codes| array. In general, I have merely replaced each character in the PLAIN.TEX coding schemes by the nearest equivalent in ASCII, when a reasonable one exists ; I have not tried to tackle either AMSY or AMATHEX ; clearly there will be some scope for doing so. First we give the scheme names, ( padded to |code_len|) then do stuff for each scheme in turn. @= set_string( known_schemes[ 0 ] , ' ' , ' ', 32 ) ; set_string( known_schemes[ 1 ] , 'TEX EXTENDED ASCII ' , ' ', 32 ) ; set_string( known_schemes[ 2 ] , 'TEX TYPEWRITER TEXT ' , ' ', 32 ) ; set_string( known_schemes[ 3 ] , 'TEX TEXT ' , ' ', 32 ) ; set_string( known_schemes[ 4 ] , 'TEX TEXT WITHOUT F-LIGATURES ' , ' ', 32 ) ; set_string( known_schemes[ 5 ] , 'AEFMNOT ONLY ' , ' ', 32 ) ; set_string( known_schemes[ 6 ] , 'TEX MATH ITALIC ' , ' ', 32 ) ; set_string( known_schemes[ 7 ] , 'TEX MATH SYMBOLS ' , ' ', 32 ) ; set_string( known_schemes[ 8 ] , 'TEX MATH EXTENSION ' , ' ', 32 ) ; set_string( known_schemes[ 9 ] , 'AKT: This scheme will be used for all unknown schemes; what a hack! ' , ' ', 32 ) ; @ Now do scheme 1 = EXTENDED ASCII @= alphabet( 32, 95, 1, 1, 32) ; row( ' . {|v} Z Z & ~ {LC-} Z ' ,1,0,1) ; row( ' Z Z Z {^|} {+_} {LO+} Z Z ' ,1,1,1) ; row( ' Z Z Z Z Z Z {LOx} Z ' ,1,2,1) ; row( ' [{L<-}-] [-{-L>}] {=/} Z {L<_} {L>_} {=_} [or] ' ,1,3,1) ; @ Now do scheme 2 = TYPEWRITER. Unfortunately, \.{TANGLE} imposes a limit of 69 on the length of quoted strings. This causes difficulty because several multi- character commands are too long for 8 of them to fit neatly into a string of that length. So I use the Z command to ( effectively) split any complicated |row_spec| into two. @= alphabet( 32, 95, 2, 1, 32) ; codes[2, 255].IM_char:= 34 ; {AKT: was 2, 127} row( ' Z [{/_}{_\}] {0-} [/\] Z Z Z Z ' ,2,0,1) ; {first half row} row( ' Z Z Z Z _}> LY ' ,2,0,1) ; {and second} row( ' {oI} {u|} Z {^|} {v|} Q ! ? ' ,2,1,1) ; row( ' i j ` Q Z Z ' ,2,2,1) ; row( ' , {LB_} [ae] [oe] {o/} [LALE] [LOLE] {LO/} ' ,2,3,1) ; @ The TEX TEXT scheme is nearly the same, so we start by copying it. @= for in_i := 0 to 255 do codes [3, in_i] := codes [2, in_i] ; {AKT: was 0 to 127} row( ' Z Z Z [ff] [fi] [fl] [ffi] [ffl] ' ,3,1,1) ; row( ' Z Z Z Z ! Z ? Z ' ,3,7,1) ; row( ' Z Z Z Z W Z Z ' ,3,11,1) ; row( ' Z Z Z - [--] W ~ W ' ,3,15,1) ; @ Recently there has appeared a scheme, called TEX TEXT WITHOUT F-LIGATURES. @= for in_i := 0 to 255 do codes [4, in_i] := codes [3, in_i] ; {AKT: was 0 to 127} row( ' {oI} {u|} Z {^|} {v|} Q ! ? ' ,4,1,1) ; @ and AEFMNOT ONLY (for the Metafont logo). @= row( ' Z LA Z Z Z LE LF Z ' ,5,8,1) ; row( ' Z Z Z Z Z LM LN LO ' ,5,9,1) ; row( ' Z Z Z Z LT Z Z Z ' ,5,10,1) ; @ The MATH ITALIC scheme is almost impossible. @= for in_i := 0 to 9 do codes [6, in_i] := codes [2, in_i] ; alphabet( 48, 43, 6, 1, 48) ; alphabet( 97, 26, 6, 1, 97) ; row( ' Z Z . , Z / Z * ' ,6,7,1) ; @ MATH SYMBOLS are messy, and no doubt the results will look unpleasant. @= alphabet( 65, 26, 7, 1, 65) ; row( ' - . {\/} * {-:} Z {+_} ' ,7,0,1) ; row( ' {LO+} {LO-} {LOx} {LO/} LO LO o o ' ,7,1,1) ; row( ' Z {=_} Z Z {L<_} {L>_} {L<_} {L>_} ' ,7,2,1) ; row( ' ~ Z Z [LL>] L< L> ' ,7,3,1) ; row( ' [{L<-}-] [-{L>-}] {|^} {|v} Z Z Z Z ' ,7,4,1) ; row( ' Z Z Z Z [{L<-}{-L>}] / \ {~_} ' ,7,4,1) ; row( ' [{L<=}=] [={L>=}] {|^} {|v} Z Z Z Z ' ,7,5,1) ; row( ' Z Z Z Z [{L<=}{=L>}] Z Z Z ' ,7,5,1) ; row( ' Q [oo] {L(-} {-L)} Z Z Z Z ' ,7,6,1) ; row( ' Z Z Z Z [{/_}{_\}] / Q ' ,7,6,1) ; row( ' [{\-}{-/}] ~ {0/} LR LT {|_}' ,7,7,1) ; row( ' Z Z Z LU Z {LU+} & [or] ' ,7,11,1) ; row( ' [{|-}-] [-{-|}] Z Z Z Z L{ L} ' ,7,12,1) ; row( ' L< L> | [||] {^|v} {^|v} \ Z ' ,7,13,1) ; row( ' [{LI_}{LI_}] <[__][\/]> Z Z Z Z ' ,7,14,1) ; @ And here is a first attempt at the MATH EXTENSION scheme. These codes look rather peculiar because characters in the Extension font (unlike all others) have their reference points at the top. Here the restriction of string length to 69 is a real pain. It seemed that the least bad way to arrange these |row|s was by splitting each into 2 halves; then most half-rows do fit into one rowstring. Here are the left hand halves. @= row(' ZZZZ',8,0,1); row(' ZZZZ',8,1,1); row(' ZZZZ',8,2,1); row(' ZZZZ',8,3,1); row(' ZZZZ',8,4,1); row(' |L}> ZZZZ',8,5,1); row(' ZZZZ',8,6,1); row(' ZZZZ',8,7,1); row(' ZZZZ',8,8,1); row(' <[__]\[{/_}_]> <[__][LILI]> ZZZZ',8,10,1); row(' ZZZZ',8,12,1); row(' ZZZZ',8,13,1); row(' / \ ZZZZ',8,15,1); @ Here are the right hand halves. @= row('ZZZZ ',8,0,1); row('ZZZZ ',8,1,1); row('ZZZZ ',8,2,1); row('ZZZZ ',8,3,1); row('ZZZZ ',8,4,1); row('ZZZZ ',8,5,1); row('ZZZZ ',8,6,1); row('ZZZZ ]|> ',8,7,1); row('ZZZZ ]/> ',8,8,1); row('ZZZZ ',8,10,1); row('ZZZZ ',8,12,1); row('ZZZZ ',8,13,1); row('ZZZZ \ / ',8,15,1); @ And here are the half rows that are so long that even half a row must be further split. @= row(' ZZZZ',8,9,1); row('ZZZZ ZZ',8,9,1); row('ZZZZZZ <[S_][{\/}S{/\}][|{\/}|][{/\}_{/\}]> ',8,9,1); @# row(' <[___]\[SL>][{/_}__]> <[___][|S|][|S|][|S|]> ZZZZZ',8,11,1); row('ZZZ <[S_][/S\][|S|][|S|]> ZZZ',8,11,1); row('ZZZZZ ',8,11,1); @# row(' ZZZZZ',8,14,1); row('ZZZ ZZZ',8,14,1); row('ZZZZZ ',8,14,1); @ AKT: Now do scheme 9 = unknown (eg. PostScript font). We simply use the TEX TEXT scheme. @= for in_i := 0 to 255 do codes [9, in_i] := codes [3, in_i] ; @ This must be done last of all: @= @ @z