home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PRINTING / ISIGNS50.ZIP / SIGNS50.DOC < prev    next >
Text File  |  1989-11-03  |  21KB  |  450 lines

  1.  
  2.  
  3.  
  4.                                   SIGNS.DOC
  5.                                  Version 5.0
  6.  
  7.                               by Robert W. Bloom
  8.                                   26 Sep 89
  9.  
  10. Release Notice:
  11.  
  12.      Signs and all associated files (Signs, MkFntNdx, font files, etc.) are
  13. freely released to the public for non-profit use.  If anybody's going to
  14. profit, it should be me!  Anywhat, this is my contribution for all the great
  15. programs I've received from the pipeline.  Thanks guys!
  16.  
  17.  
  18. Revision History:
  19.  
  20. Signs:
  21.      1.x - March 86, first versions, menu driven.  GSigns created.
  22.      2.x - May 86, all screen oriented.
  23.      3.x - Jun 86, bit mapped font files, released w/MakeFont Version 2.0. 
  24. New features: inverse video, user changeable single block character, inter-
  25. character spacing, block_char used for fill in inverse video.
  26.      4.x - Oct 86, added bit-mapped output, Library released with 3 font
  27. files (font1, font2, gothfont), MS-DOS version released and patched so that
  28. 'Gothfont' fit.
  29.      4.2 - Aug 89, patched to compile with TurboPascal v5.0.
  30.      5.0 - Sep 89, Redesign of font file interface to use HP LaserJet font
  31. files, elimination of MakeFont and Generic versions for CP/M, addition of a
  32. font index file generator, expanded Epson printer support.  Converted old font
  33. files into HP LaserJet-compatible font files.  TurboPascal v5.0 specific.
  34.  
  35.      Older versions are still workable, but why bother.  Though I still have
  36. my CP/M machine, it doesn't get turned on much. 
  37.  
  38. Background:
  39.  
  40.      I was never happy with the sign- and banner-making programs available
  41. for CP/M.  Sure there were a number of good ones, specially 'GOTHIC,' but none
  42. have enough variability to suit me.  By variability, I mean the capability to
  43. change sizes, fonts, and paper positioning to create whatever I wanted.  What
  44. I really wanted was a 'Print Shop' for CP/M-80.  Alas, it's not available and
  45. it looks as if no one is developing any new stuff for my (old) favorite OS.
  46.  
  47.      I though the problem was solved when I ran across a set of two
  48. programs by Ken Crook in Pascal.  I was just learning Pascal, so I thought
  49. this would be a good way to get some fun education.  Unfortunately, the
  50. program was not written very well - although some good options were present, I
  51. couldn't even compile the programs (called 'sign' and 'banner') as they
  52. wouldn't fit in memory.  (CP/M-80, TurboPascal v3.01, 63k, error messages
  53. off.)  The main problem was that all of the character fonts were held in
  54. memory at one time.  Even eliminating all the symbols and keeping just numbers
  55. and upper case letters yielded a com file of 36k.  (Besides, input was taken
  56. from a file not the console, which was a pain.)
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Features:
  64.  
  65.      So I decided to start over and write my own.  Major features of
  66. my program are:
  67.  
  68.           - Fonts are held in an external HP LaserJet-compatible 'soft' font
  69. file which is read by random access methods.  It reads only the required
  70. characters into memory when they are needed.  An index to the font file is
  71. required (contains character descriptor data and pointers into the HP file)
  72. which is created by the separate program MkFntNdx.
  73.  
  74.           - Signs and Banners are made by changing an option.  They may be
  75. output to the console, a file, or lst: device (printer).  Lots of other
  76. options are available.  (see below)
  77.  
  78.           - Any HP LaserJet-compatible 'soft' portrait font may be used. 
  79. Because of the very-high resolution 300dpi of the LaserJet, many soft fonts
  80. will be 'too big' for screen output.  I.e., each dot is turned into a
  81. character position limiting screen output to 80 'dots' wide.  To remedy this,
  82. two font sets are supplied: one with characters that are up to 12 units high
  83. counting a two block descender and up to 10 blocks wide; and one which is four
  84. times wider and twice as high.  Both are proportionally spaced.  The smaller
  85. of the two is readable only with a magnifying glass if actually downloaded to
  86. LaserJet - but it works fine with Signs.
  87.  
  88.           - Font editors are *not* supplied, editing an HP font file is a
  89. very tricky business.  'AlterFnt' and 'QFont' are two shareware-available
  90. editors available.  Many soft fonts are also available.  I designed one of
  91. supplied fonts, a friend (RK Sparks) did the other.
  92.  
  93.           - Four printers are supported: IDS, Epson, HP and 'dumb'.  Dumb
  94. printers can't output in graphics dot-mode.  There are four graphic output
  95. densities for the HP and Epson.
  96.  
  97.           - If printing, one can change the cpi and lpi from the menu which
  98. automatically adjusts the printer.  Input lines are checked to see if they
  99. will fit.  Normal (80) and wide (132) terminals, as well as small (8") and
  100. large (14") printers are correctly handled.  The user can even request output
  101. in "reverse video" (White letters, black background instead of black letters
  102. on a white background.)
  103.  
  104.           - The letters of the output sign/banner can be made of the letter
  105. itself, any single character, a 'overstrike' block to make a nice black solid
  106. block or individual dots using the graphics mode of the printer.  (Naturally
  107. the graphics dot-mode will create much smaller letters and is strongly printer
  108. dependent. 
  109.  
  110.      I think you'll find that the program is self-explanatory.  Once
  111. selected, a option does not change until manually changed.  This allows
  112. changing just one option quickly.  Some options eliminate others.
  113.  
  114.  
  115. Files:
  116.  
  117.      READ.ME - introduction to signs.
  118.  
  119.  
  120.  
  121.  
  122.      RWBFONT.FNT, RKSFONT.FNT - HP LaserJet compatible soft font files
  123.      RWBFONT.FNX, RKSFONT.FNX - index to above created by MkFntNdx and used
  124.           by Signs.
  125.      MkFntNdx.PAS - (Make Font Index) source code for font index generator -
  126.           asks for input filenames. 
  127.      SIGNS.PAS - source code for sign generator.  Also calls the include
  128.           files: CONST.PAS, ASK.PAS, DISP.PAS, PRT.PAS, UTIL.PAS
  129.      SIGNS.IN - sample file input, contains all printable characters.
  130.      SIGNS.OUT - sample output file from signs.in
  131.      SIGNS.DOC - this file.
  132.      SIGNS.EXE, MKFNTNDX.EXE - executables
  133.      PRINTER2.PAS, PRINTER2.TPU - TurboPascal v5 fix for LST output
  134.  
  135. Compiling:
  136.  
  137.      TurboPascal v 5.0 was used to compile the program, using the CRT and
  138. PRINTER2 'use' units.  A installed Ansi driver is required for the low/high
  139. video calls.
  140.  
  141.      I found a bug in TurboPascal v5.0: the default 'printer' unit in
  142. TURBO.TPL will not output a CHR(26) which is needed when one outputs graphics. 
  143. Borland provided the 'printer2' public domain unit which fixes the problem. 
  144. This problem was not in TurboPascal v3.
  145.  
  146. Running:
  147.  
  148.      As a minimum, one needs to have the following files in the default
  149. directory: Signs.exe, one HP LaserJet-compatible soft font file, and a index
  150. to the font file (created by mkfntndx.exe.)
  151.  
  152. Notes:
  153.  
  154.      - some options are disabled with other options.  For instance, if one
  155. selects console output, you don't see any printer options.  Or if you enter a
  156. given left margin to use, the output centering option is disabled.  (To center
  157. the output after zeroing a previously-given left margin, one has to manually
  158. enter 'y' to centering as a non-zero left margin sets centering to 'no'.) 
  159. Non-applicable menu items are not displayed.
  160.  
  161.      - beware of hardware differences in printers.  If in doubt, make the
  162. printer type 'dumb' and avoid bit-mapped graphics output.
  163.  
  164.      - Outputting to a file automatically sets the line width to the maximum. 
  165. You probably will want to reduce it to something reasonable - especially if
  166. you ask for auto-centering.
  167.  
  168.  
  169. Options:
  170.  
  171. Upon entry to the program one is placed directly in "change parameters" mode. 
  172. A options menu is shown:  (The actual menu will have inappropriate entries
  173. missing, they will appear as they become pertinent.)
  174.  
  175. Signs Version: v5.0, 10 Sep 89                            Mode: Change Parms
  176.                                                                                
  177.  
  178.  
  179.  
  180.  
  181. ------------------------ Options and I/O Parameters --------------------------
  182. T-         Sign type -> Sign            I-      Input Device -> File           
  183. B- Block/Letter type -> Letters         R-  FileName to Read -> Signs.in       
  184. F-         Font File -> Font.usp        N-  Number of Copies -> 1              
  185. W-  Width Multiplier -> 1               O-     Output device -> Printer        
  186. H- Height Multiplier -> 1               S-       Device Size -> Normal         
  187. V-     Inverse Video -> Off, Normal     Y-      Printer Type -> Epson          
  188. A-    Auto-Centering -> Yes             P-  Pitch chars/inch -> Squeezed [17]
  189. M- Given left margin -> none defined    L-        Lines/Inch -> Twelve         
  190. G-       Given Width -> not given       C-    Color of Print -> Black          
  191. Q- Quit and Return back to OS           D-  Graphics Density -> Single         
  192. X,<cr>- eXit Change Parm                E-  rEcord Output In -> Signs.out     
  193. -------------------------------------------------------------------------------
  194.      Width available -> 136             Font width:  10    Height:  12         
  195.                                         Enter option letter
  196. -------------------------------------------------------------------------------
  197.  
  198. On the options menu one can change:
  199.  
  200.      - Sign type:  Signs are horizontally printed across page, banners
  201. are vertically printed down page
  202.  
  203.      - Block type:  The character that makes up the signs can either be the
  204. letter printed, solid block, or a single 'dot' (bits).  Blocks may be made two
  205. ways, by over striking several characters or by sending a printer a single
  206. user-defined character.  (The default single block character is 177 which is
  207. defined as a block in the IBM-PC extended character set.  Your printer will
  208. probably print something else.  Mileage will vary.)  If one selects single
  209. block, it will ask what character to send.  Enter the decimal number of the
  210. character.  For bit-mapping, each 'block' becomes a single dot in the graphics
  211. mode on a printer.  When entering bit mode, the width of the output line is
  212. automatically set to whatever is appropriate for the printer defined.
  213.  
  214.      - Font file:  One can change the name of the font file to be used at any
  215. time.  If the filename entered it not found, an error message and '????' will
  216. be shown for the filename.  If found, the size of the font will be shown.  An
  217. filename extension of .FNT is assumed if not entered.  Program will complain
  218. if the file is not found or a associated index with a .FNX extension.
  219.  
  220.      - Mult w,Mult h:  The output may be doubled, tripled, etc. in both width
  221. and height.  Enter your choice, the program will simply not print any
  222. characters that overflow the output line.
  223.  
  224.      - Inverse video:  Does what you think:  spaces are printed as the block
  225. character, and the character is printed as a space.  Not available with 'bit-
  226. blocks.'  The single-strike block character (default 177) will be printed
  227. between characters.
  228.  
  229.      - Centering:  If no given offset, answer if output be centered on page
  230. or flush to left margin.
  231.  
  232.      - Given Margin:  Enter how many characters should be sent before
  233. printing signs or banner.  This has the effect of a left margin for signs or
  234. moving banner 'left' or 'right' on the output device.  (By playing with the
  235. given offset and reverse formfeed, one can get multiple lines in Banner
  236.  
  237.  
  238.  
  239.  
  240. format.)
  241.  
  242.      - Given width:  If not zero, the program will use this figure for the
  243. maximum number of characters per output line.  Also centering, if on, will be
  244. based on this width if not zero.  Automatically set to Max_Length upon
  245. entering bit-mapped mode (block_type = bit).
  246.  
  247.      - Quit:  one can quit from the options menu with a 'Q'.  One might need
  248. this if you forget the name of the font file to use and signs won't let you
  249. exit until you give it a good name.
  250.  
  251.      - eXit:  Upon entry of a 'X' or <cr>, one is placed in "input text"
  252. mode. 
  253.  
  254.      - Input device:  One can enter the output lines one at a time from the
  255. keyboard or take them in a bunch from a designated text file.  The default
  256. filename is SIGNS.IN.  If input from a file, one can specify how many copies
  257. you want.  A formfeed is sent between copies if output to a printer.
  258.  
  259.      - File to Read:  Name of the file to take input from, multiple lines are
  260. output separately.
  261.  
  262.      - Number: If reading from a file, how many copies to output.
  263.  
  264.      - Output device:  Specify output should be sent to the console screen, a
  265. text file, or the lst: device.  If recording output in a file, the default
  266. name is SIGNS.OUT.  If printing, one can:  enter what pitch should be used (10
  267. pica, 12 elite, 17 squeezed or 20 tiny [squeezed gives 132 characters per 8"
  268. line]); how many lines per inch should be used (6, 8, 10, or 12); and color
  269. (black, blue, green or red).
  270.  
  271.      - Device size:  If printing, indicate whether printer is 8" wide or 14"
  272. wide.  If displaying on screen, indicate whether terminal is 80 characters
  273. wide or 132.  Output width for file output is whatever was previously set with
  274. a maximum of Max_Length.  Specify a given width if you want centering to a
  275. different width.
  276.  
  277.      - Printer:  Either Epson, IDS, HP or 'dumb'.  Dumb printer are not sent
  278. any control codes and are not capable of dot-graphics. 
  279.  
  280.      - Pitch, Lines:  Set to whatever you want for best appearance.  Not
  281. available for dumb printers.  Dot-graphics reset this parameter to whatever is
  282. appropriate for graphics.
  283.  
  284.      - Color:  The IDS printers support color.
  285.  
  286.      - Density:  Epson and HP printers have different graphic output
  287. densities.  Characters will change size and shape as this is varied.
  288.  
  289.      - Output file:  Name of file to store output in.
  290.  
  291. Note that the size of the font in use is displayed after the font file has
  292. been opened, as well as the calculated available output space.
  293.  
  294. The input text mode has a menu of control characters:
  295.  
  296.  
  297.  
  298.  
  299.  
  300. -------------------------------------------------------------------------------
  301.    ^P: Change parameters     ^F,^L: Send Formfeed to LST    ^X: Restart Input  
  302. ^C,^D: Done, quit to OS      ^R,^T: Send Reverse Formfeed   ^H: Backspace      
  303. <ret>: Process Input            ^A: Alternate Input
  304. -------------------------------------------------------------------------------
  305.  
  306.      - send a formfeed to the printer ('^F' or '^L'),
  307.      - send a reverse formfeed to printer to return to TOF ('^T'),
  308.      - goto the options menu and change the program parameters ('^P'),
  309.      - exit program ('^C' or '^D'),
  310.      - backspace ('^H' or <del>),
  311.      - ask to redisplay the menu again ('^R'),
  312.      - delete entered line and start over ('^X'), or
  313.      - enter alternate input routine to enter non-ASCII characters ('^A')
  314.      - anything else is entered into the line to be printed.
  315.  
  316. (You CAN mix input and control characters, i.e. enter the input line, strike
  317. a ^P to change the parameters, and return to input line without losing
  318. anything.)
  319.  
  320. The alternate input routine (^A) prompts you to enter a DECIMAL code of a
  321. character.  These can be put to good use if the font file has defined more
  322. than the standard 96 ASCII characters.  Entries greater than 255 are rejected,
  323. others are appended to the input string.  The decimal value is echoed as the
  324. character is appended.  Enter a <cr> to return to normal input.
  325.  
  326.  
  327. Hardware: 
  328.  
  329.      There is hardware-specific code in the source in several procedures: 
  330. (I've tried to but them all in the prt.pas include file.)
  331.  
  332.      Procedure set_up_prt contains all the character sequences necessary to
  333. set and reset the printers in the various modes (10, 12, 17, 20 pitch.)  The
  334. code included in the distribution copy is for the IDS MicroPrism (or Prism),
  335. Epson, and HP LaserJet.  You will have to change it for any other printer
  336. model.  Note: the IDS printers can't do 20 pitch.
  337.  
  338.      Procedure calc_width contains the actual pitches for the
  339. various conditions.  Squeezed print on the IDS is 16.5 pitch, Squeezed print
  340. on the Epson is 17 pitch.  Tiny (20 pitch) is available on the Epson, not on
  341. the IDS.
  342.  
  343.      Procedure out_char outputs 'Block_Char', (defined as #127 in the CONST
  344. block as the default.)   This printers a single pass block for the IDS
  345. printer.  Apparently the standard mode on the Epson printer doesn't have a
  346. one-pass block character (only in 'IBM-mode'.)  I advise not to use block mode
  347. with the Epson, use overstrike mode to print blocks or define the single pass
  348. 'block' character as a '*' or 'X'.
  349.  
  350.      Procedure main outputs strings to the printer for formfeed (^L - that's
  351. pretty standard) and reverse formfeed (<esc>H0$<esc>G0$ - that's not
  352. standard).
  353.  
  354.  
  355.  
  356.  
  357.  
  358.      Procedure out outputs one graphics line. The graphics line is varying
  359. lengths, depending on the mode and is contained in the char array gout_1 and
  360. gout_2.  Triple and Quad density for the Epson interleaves the tow graphics
  361. lines.
  362.  
  363.      To change number or characters for creating the overstrike block,
  364. adjust the os-char string to the appropriate characters.  The length of
  365. os_char determines the number of strikes (currently the maximum length is 5).
  366.  
  367.  
  368. Notes on Programming Techniques:
  369.  
  370.      I have a tendency to write my Pascal procedures and functions too long
  371. according to classical thought.  (So much for classical thought.)  However,
  372. the long procedures all contain just one idea (or menu) and couldn't be easily
  373. and clearly broken.  Main, out_sign, out_banner, and check_sign are also too
  374. long according by my Pascal Perfesser.  (What does he know, anyhow? - how to
  375. spell professor for one!)  Anywhat, I'll somebody else figure a good way to
  376. break it up.
  377.  
  378.      I've even used a couple of GOTO's (heresy!) where it was easier to use
  379. one than to figure out how to loop it.  There's too many loops as it is. 
  380. Purists will complain that there are too many global variables and I should
  381. have passed the record variable by pointer.  Having learned by style from
  382. FORTRAN, I'm a long ways from being a purist.
  383.  
  384.      Speaking of style, my style of programming is different from most, I do
  385. a lot of dBase II programming so have picked up its style and translated it to
  386. Pascal.  In particular, BEGIN/END pairs are *not* necessarily matched up in
  387. indenting, but flow control statements more than two statements apart *are*
  388. and a terminator is used.  If there's a natural 'END' there, fine; otherwise a
  389. {end} is used.  Try it, I like it.
  390.  
  391.      One can change my defaults by changing the initialized 'constants' at
  392. the top of the file (actually in the include file const.pas).  Warning: if you
  393. make input from or output to a file the default, you will somehow have to open
  394. the file in procedure main - I opened the files when the user exits from
  395. ask_parameters.
  396.  
  397.      Most procedures are in 'natural', i.e. FORTRAN, order.  (Another
  398. throwback!)  Main comes first, followed by major subroutines, closed out with
  399. utilities.  This has the effect of causing all procedures and functions to be
  400. FORWARD declared.  (Or almost all - main isn't as it's first anyway.)  The
  401. real program at the end simply announces itself, calls main, and announces
  402. termination.  Pascal can be readable!  The disp_? and ask_? procedures are not
  403. in natural order and are not forward declared.  They are randomly accessed
  404. anyhow.
  405.  
  406.      Another warning:  the program may hang if the printer is the defined
  407. output and is off-line when you exit.  This happens because a reset string is
  408. sent to it even if no output is done.  (assuming the dumb printer switch is
  409. off.)  This may be a concern if the printer is the default output and one
  410. exits without any input.
  411.  
  412.      A carriage return to the entry prompt without any input characters will
  413.  
  414.  
  415.  
  416.  
  417. ask to exit.  Input a space<cr> if you want a blank line to be output.
  418.  
  419.      While outputting to a file, the file will remain open until program is
  420. exited or the output direction is changed.  This way, multiple output lines
  421. may be stored in one file.  Remember that when outputting to a file that the
  422. width is set whatever the previous maximum was.  The program can handle up to
  423. 3000-some character wide output.  Auto-centering may add more or not enough
  424. spaces than you want, so set a smaller/larger width with the given-width
  425. setting.
  426.  
  427. Bugs:
  428.  
  429.      I did not figure out how to handle negative left-offsets in the font
  430. files when outputting banners.  A negative left-offset means that the cursor
  431. should move LEFT that number of dots - for a banner that means 'taking back'
  432. lines that have already been output. 
  433.  
  434.      The algorithm that calculates the actual number of character across
  435. needed for a sign is not correct for all cases - negative left-offsets throw
  436. it off.  The effect is when outputting in inverse video, the border lines are
  437. not always the right length.
  438.  
  439.  
  440.  
  441.      Have fun.  If anyone adds new and exciting options, I would be
  442. interested in seeing it.  I 'think' all the bugs are out, but one never
  443. knows ...
  444.  
  445.  
  446.  
  447. Robert W. Bloom
  448. 46 Broadleaf Drive
  449. Newark, DE  19702
  450.