{****************************************************************************** ** ** Robert W. Bloom ** ** Function: This program reads input from the terminal and creates signs. ** The sign can be either horizontal or vertical in a number of ** formats. Output character fonts are read from an external file. ** ** Notes: Font files are created with MakeFont.Pas ** See Signs.DOC for more information ** *****************************************************************************} CONST Date = 'v4.1, 28 Oct 86'; {last revision of this program} Max_Length = 672; {max number of characters in a output line} { or 84dots/in * 8in/line = 672 dots/line} Max_Width = 40; {these must match then input file} Max_Height = 24; {and match CONSTs in makefont.pas!} Bit_Width = 5; {Max_Width/8 rounded up, for bit-mapped input} {default problem parameters - TurboPascal Initialized 'Constants'} font_fn : STRING[14] = 'Font1'; {font filename} sign_type : (sign,banner) = sign; {type of sign} block_type : (letter,block,overstrike,bit) = letter; {output type} block_char : CHAR = #127; {square block on IDS} os_strng : STRING[5] = '*XO'; {overstrike string} mult_w : INTEGER = 1; {height multiplier} mult_h : INTEGER = 1; {width multiplier} inter_spc : INTEGER = 1; {space between chars} input_device : (keyboard,text_file) = keyboard; {input from where?} in_fn : STRING[14] = 'Signs.in'; {input filename} num_copies : INTEGER = 1; {multiple copies?} output_device : (screen,printer,recd_file) = screen; {output to?} out_fn : STRING[14] = 'Signs.out'; {output filename} prt_cpi : (pica,elite,squeezed,tiny) = squeezed; {chars/inch} prt_lpi : (six,eight,ten,twelve) = twelve; {lines/inch} prt_color : (black,red,green,blue) = black; {color} device_size : (wide,normal) = normal; {is it wide?} dumb_prt : BOOLEAN = FALSE; {send codes} inv_video : BOOLEAN = FALSE; {inverse b/w?} given_offset : INTEGER = 0; {left margin} given_width : INTEGER = 0; {width of output} centering : BOOLEAN = TRUE; {should center output?} font_width : INTEGER = 0; font_height : INTEGER = 0; {size of font in use} TYPE CHARACTER_RECORD = RECORD {used for internal use} character : CHAR; {the character} width : INTEGER; {how wide is it} height : INTEGER; {how high} pic : ARRAY[1..Max_Height,1..Max_Width] OF CHAR {its 'picture'} END; {record} BIT_RECORD = RECORD {used for external font files (random access)} character : CHAR; width : INTEGER; height : INTEGER; bit_map : ARRAY[1..Max_height,1..Bit_Width] OF BYTE END; {record} OUT_FILE_TYPE = FILE OF BIT_RECORD; FONT_FILE_TYPE = FILE OF BIT_RECORD; {the font file} SIGN_ARRAY = ARRAY[1..Max_Height,1..Max_Length] OF CHAR; {note this creates a LARGE array, ~16k} S80 = STRING[80]; {for input} S14 = STRING[14]; {for filenames} S2 = STRING[2]; {for Hex input} SMAX = ARRAY[1..Max_Length] of CHAR; {for building output} VAR font_file : FONT_FILE_TYPE; {to define character pictures} in_file,out_file : TEXT; {files for input and output} avail_chars : INTEGER; {width of output device} char_rec : CHARACTER_RECORD; {global's easier than passing pointers!} disp : BOOLEAN; {true if should display avail_space} gout_line,out_line : SMAX; {global pass to/from out_char} bit_cnt : INTEGER; {graphics output line counter} {************************* Procedures called *********************************} PROCEDURE main; FORWARD; PROCEDURE inp_hex (VAR add_str : S80); FORWARD; PROCEDURE parm_menu (font_f_open : BOOLEAN); FORWARD; PROCEDURE input_menu; FORWARD; PROCEDURE ask_parm (VAR font_f_open : BOOLEAN); FORWARD; PROCEDURE avail_space; FORWARD; PROCEDURE out_sign (VAR inp_line : S80; VAR overflow_err : BOOLEAN); FORWARD; PROCEDURE out_banner (VAR inp_line : S80); FORWARD; FUNCTION check_sign (VAR inp_line : S80; VAR actual_width : INTEGER; VAR out_array : SIGN_ARRAY) : BOOLEAN; FORWARD; PROCEDURE find_rec (fchr : CHAR); FORWARD; PROCEDURE out_char (ochar : CHAR; VAR chr_pos : INTEGER); FORWARD; PROCEDURE putchr (chr : CHAR); FORWARD; PROCEDURE gdump; FORWARD; PROCEDURE set_up_prt (reset_prt : BOOLEAN); FORWARD; PROCEDURE disp_fs; FORWARD; {**************************** Program Start **********************************}