home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / list / tsigns41.ark / SIGNS0.PAS < prev    next >
Pascal/Delphi Source File  |  1986-12-24  |  6KB  |  106 lines

  1. {******************************************************************************
  2. **
  3. **  Robert W. Bloom
  4. **
  5. **  Function:  This program reads input from the terminal and creates signs.
  6. **             The sign can be either horizontal or vertical in a number of
  7. **             formats.  Output character fonts are read from an external file.
  8. **
  9. **  Notes:  Font files are created with MakeFont.Pas
  10. **          See Signs.DOC for more information
  11. **
  12. *****************************************************************************}
  13.  
  14. CONST
  15.            Date = 'v4.1, 28 Oct 86'; {last revision of this program}
  16.      Max_Length = 672;         {max number of characters in a output line}
  17.                                {  or 84dots/in * 8in/line = 672 dots/line}
  18.       Max_Width = 40;          {these must match then input file}
  19.      Max_Height = 24;          {and match CONSTs in makefont.pas!}
  20.       Bit_Width = 5;           {Max_Width/8 rounded up, for bit-mapped input}
  21.  
  22. {default problem parameters - TurboPascal Initialized 'Constants'}
  23.       font_fn : STRING[14]                 = 'Font1';   {font filename}
  24.     sign_type : (sign,banner)              = sign;      {type of sign}
  25.    block_type : (letter,block,overstrike,bit)  = letter; {output type}
  26.    block_char : CHAR                       = #127;      {square block on IDS}
  27.      os_strng : STRING[5]                  = '*XO';     {overstrike string}
  28.        mult_w : INTEGER                    = 1;         {height multiplier}
  29.        mult_h : INTEGER                    = 1;         {width multiplier}
  30.     inter_spc : INTEGER                    = 1;         {space between chars}
  31.  input_device : (keyboard,text_file)       = keyboard;  {input from where?}
  32.         in_fn : STRING[14]                 = 'Signs.in'; {input filename}
  33.    num_copies : INTEGER                    = 1;         {multiple copies?}
  34. output_device : (screen,printer,recd_file) = screen;    {output to?}
  35.        out_fn : STRING[14]                 = 'Signs.out';  {output filename}
  36.       prt_cpi : (pica,elite,squeezed,tiny) = squeezed;  {chars/inch}
  37.       prt_lpi : (six,eight,ten,twelve)     = twelve;    {lines/inch}
  38.     prt_color : (black,red,green,blue)     = black;     {color}
  39.   device_size : (wide,normal)              = normal;    {is it wide?}
  40.      dumb_prt : BOOLEAN                    = FALSE;     {send codes}
  41.     inv_video : BOOLEAN                    = FALSE;     {inverse b/w?}
  42.  given_offset : INTEGER                    = 0;         {left margin}
  43.   given_width : INTEGER                    = 0;         {width of output}
  44.     centering : BOOLEAN                    = TRUE;      {should center output?}
  45.    font_width : INTEGER                    = 0;
  46.   font_height : INTEGER                    = 0;         {size of font in use}
  47.  
  48. TYPE
  49.     CHARACTER_RECORD = RECORD  {used for internal use}
  50.     character : CHAR;          {the character}
  51.         width : INTEGER;       {how wide is it}
  52.        height : INTEGER;       {how high}
  53.           pic : ARRAY[1..Max_Height,1..Max_Width] OF CHAR  {its 'picture'}
  54.     END; {record}
  55.  
  56.     BIT_RECORD = RECORD        {used for external font files (random access)}
  57.     character : CHAR;
  58.         width : INTEGER;
  59.        height : INTEGER;
  60.       bit_map : ARRAY[1..Max_height,1..Bit_Width] OF BYTE
  61.     END; {record}
  62.     OUT_FILE_TYPE = FILE OF BIT_RECORD;
  63.  
  64. FONT_FILE_TYPE = FILE OF BIT_RECORD;  {the font file}
  65.     SIGN_ARRAY = ARRAY[1..Max_Height,1..Max_Length] OF CHAR;
  66.                          {note this creates a LARGE array, ~16k}
  67.            S80 = STRING[80];   {for input}
  68.            S14 = STRING[14];   {for filenames}
  69.             S2 = STRING[2];    {for Hex input}
  70.           SMAX = ARRAY[1..Max_Length] of CHAR; {for building output}
  71. VAR
  72.          font_file : FONT_FILE_TYPE;   {to define character pictures}
  73.   in_file,out_file : TEXT;             {files for input and output}
  74.        avail_chars : INTEGER;          {width of output device}
  75.           char_rec : CHARACTER_RECORD; {global's easier than passing pointers!}
  76.               disp : BOOLEAN;          {true if should display avail_space}
  77. gout_line,out_line : SMAX;             {global pass to/from out_char}
  78.            bit_cnt : INTEGER;          {graphics output line counter}
  79.  
  80.  
  81. {************************* Procedures called *********************************}
  82.  
  83. PROCEDURE main;                                                   FORWARD;
  84. PROCEDURE inp_hex           (VAR add_str : S80);                  FORWARD;
  85. PROCEDURE parm_menu         (font_f_open : BOOLEAN);              FORWARD;
  86. PROCEDURE input_menu;                                             FORWARD;
  87. PROCEDURE ask_parm      (VAR font_f_open : BOOLEAN);              FORWARD;
  88. PROCEDURE avail_space;                                            FORWARD;
  89. PROCEDURE out_sign         (VAR inp_line : S80;
  90.                         VAR overflow_err : BOOLEAN);              FORWARD;
  91. PROCEDURE out_banner       (VAR inp_line : S80);                  FORWARD;
  92. FUNCTION  check_sign       (VAR inp_line : S80;
  93.                         VAR actual_width : INTEGER;
  94.                            VAR out_array : SIGN_ARRAY) : BOOLEAN; FORWARD;
  95. PROCEDURE find_rec                 (fchr : CHAR);                 FORWARD;
  96. PROCEDURE out_char                (ochar : CHAR;
  97.                              VAR chr_pos : INTEGER);              FORWARD;
  98. PROCEDURE putchr                    (chr : CHAR);                 FORWARD;
  99. PROCEDURE gdump;                                                  FORWARD;
  100. PROCEDURE set_up_prt          (reset_prt : BOOLEAN);              FORWARD;
  101. PROCEDURE disp_fs;                                                FORWARD;
  102.  
  103.  
  104. {**************************** Program Start **********************************}
  105.  
  106.