home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / post_468.lzh / Post / README < prev    next >
Text File  |  1991-03-09  |  19KB  |  405 lines

  1. Postscript interpreter - README
  2. ===============================
  3.  
  4. Post V1.5 Copyright Adrian Aylward 1989, 1991
  5.  
  6. This distribution was released as the archive file "post15.lzh", 01-Mar-91
  7.  
  8. Files in this distribution:
  9.  
  10. README            This file
  11. Post.info         Icon file
  12. post              User interface
  13. post.doc          Documentation file
  14. postband          Band printing driver
  15. postband.doc      Documentation file
  16. postlj            LaserJet printing driver
  17. postlj.doc        Documentation file
  18. post.library      Shared library for Amiga 500/1000/2000
  19. post.library.2620 Shared library for Amiga 2500 etc. (68020/030, 68881/2)
  20. init.ps           Standard postscript startup file
  21. icon.ps           The postscript program that built the icon
  22.  
  23. Source files (user interface only), for programmers:
  24.  
  25. post.c            User interface, C main program
  26. postband.c        Band printing driver, C main program
  27. postlj.c          LaserJet printing driver, C main program
  28. postasm.a         User interface, assembler support
  29. postlib.h         Library interface header
  30. postlib.doc       Documentation file
  31. makefile          Make file
  32.  
  33. Font files
  34.  
  35. FunkyFont         Tiny font, courtesy of Radical Eye software
  36. FunkyFont.afm     Metric file for the above
  37.  
  38. You will also need:
  39.  
  40. arp.library       Arp library, V39+
  41. conman            ConMan, V1.3+
  42.  
  43. You should find these on "All Good BBS's/disk libraries"
  44.  
  45. I have tested Post under WorkBench V1.3 only.  If you have 2.0 it should
  46. work, but you may need a more recent version of ConMan.  You may also need
  47. to use the CONDEV option to use ConMan instead of the standard console
  48. handler.
  49.  
  50. You will need at least a megabyte of memory.  Even with a megabyte you
  51. will have not be able to generate a full page in colour on the screen.
  52. For high density printer output (A4 at 300 dpi.) you will need 2 megabytes!  If memory is very tight, try running from the CLI, before workbench has
  53. been loaded.
  54.  
  55. Examples
  56. ========
  57.  
  58. There are some PostScript examples and demo programs that are being
  59. distributed separately, as they do not change from release to release.
  60. Look out for the file "psdemos1.lzh".
  61.  
  62. The PostScript Language
  63. =======================
  64.  
  65. If you don't know any PostScript I recomend obtaining a suitable tutorial
  66. book.  Try the "blue book" from Adobe:
  67.  
  68.     "PostScript Language Tutorial and Cookbook"
  69.     Adobe Systems Incorporated,
  70.     Addison-Wesley 1985, ISBN 0-201-10179-3
  71.  
  72. If you want to learn PostScript, Post is a valuable learning tool, as you
  73. run it interactively and view the output one the screen.  Without some basic
  74. knowledge you may find it difficult to understand what is happening if you
  75. have problems getting started.
  76.  
  77. Installation
  78. ============
  79.  
  80. Make sure you have installed arp.library in your libs: directory.  You will
  81. also need to install ConMan.  These packages are both freely available.  If
  82. you don't have them already any decent BBS or public domain disk library
  83. should have them.
  84.  
  85. Before using Post you will need to copy the library into your libs:
  86. directory.  If you have an Amiga A3000, or an accelerator card with a 32 bit
  87. cpu (68020/030/040) and a floating point unit (68881/68882 or 68040) you can
  88. use the 2620 version of the library instead.  This is compiled to use
  89. hardware floating point instructions and runs about twice as fast.
  90. Otherwise you must use the standard library - if you try the 2620 version
  91. it will refuse to open.  If you have an earlier version of Post installed
  92. be sure to update the library.
  93.  
  94. To use FunkyFont, set up a directory "PSFonts:" and copy FunkyFont into it.
  95. Make a directory "PSFonts:afms" and then copy FunkyFont.afm into it.  (This
  96. file is not actually used by Post, but may be needed by other applications
  97. using FunkyFont).  If you want to make FunkyFont your default font, then edit
  98. the file "init.ps".  You need to comment out the line near the end that
  99. defines Courier as the default and uncomment the one that defines FunkyFont
  100. instead.  (In a PostScript source file a percent symbol ("%") means that
  101. the rest of the line is a comment.)  FunkyFont was written by Tomas Rokicki
  102. of Radical Eye Software; it is included by kind permission and is freely
  103. distributable.
  104.  
  105. If you have any other PostScript fonts copy them into "PSFonts:" too.  (Do
  106. not confuse these with Amiga bitmapped fonts - these will NOT work, nor will
  107. .afm font metric files)  Their names should be the same as their PostScript
  108. names - e.g. "PSFonts:Times-Roman", "PSFonts:Times-Bold".  The files can
  109. either be ASCII text or in IBM PostScript font format.  If you have copied
  110. them from an IBM disk you will have to change the names; since MSDOS can only
  111. handle 8 character names its stores Times-Roman as "TI______.PFB" and
  112. Times-Bold as "TIB_____.PFB".  Then Post will load the fonts automatically
  113. as they are needed.
  114.  
  115. The startup file
  116. ================
  117.  
  118. The standard startup file "init.ps" should be run before most programs.  You
  119. should read it and the comments within it, as you may wish to customise it.
  120. It defines useful operators to mimic a standard PostScript printer.  It also
  121. handles automatic font downloading (see below).
  122.  
  123. Getting started
  124. ===============
  125.  
  126. Make sure that you have ConMan and the ARP library and you have installed
  127. Post as described above.
  128.  
  129. From the CLI you can just type "post init.ps screen", assuming that all the
  130. files are in the current directory.  You should see a new screen with a big
  131. requestor window appear.  Click on "OK" and wait while Post executes the
  132. startup file, then you are ready to go.
  133.  
  134. If it says that it can't get enough memory (if you have only 1 megabyte)
  135. try selecting "Black and White" on the requestor window, and selecting
  136. the "Close WBench" option.
  137.  
  138. For a quick check of the graphics, pick File/Interactive on the menu.  Then
  139. type into the narrow window at the top:
  140.  
  141.     200 200 150 0 360 arc stroke
  142.  
  143. The result should be a circle appearing in the lower window.
  144.  
  145. To erase the page type:
  146.  
  147.     erasepage
  148.  
  149. If you don't have any fonts yet all text output will just print as big dots.
  150. To make your text appear properly you need to set up a PSFonts: directory
  151. as described in the installation section.  To see if your fonts are working
  152. try:
  153.  
  154.     /FunkyFont findfont 20 scalefont setfont
  155.     10 10 moveto (Hello) show
  156.  
  157. To check your DefaultFont is set up properly try:
  158.  
  159.     /AnyFontYouDontHave findfont 20 scalefont setfont
  160.     10 30 moveto (This is the default font) show
  161.  
  162. When you have finished playing, type "quit".  Then "Project/Quit" will
  163. return you to the CLI.
  164.  
  165. To use the workbench startup click on the icon.  You will probably want to
  166. set up the tooltypes to execute the startup file "init.ps"; for now you can
  167. enter it in the requestor.
  168.  
  169. Fonts
  170. =====
  171.  
  172. As there are no fonts built in to the interpreter, all fonts must be loaded
  173. from the disk, as PostScript source.  The standard startup file redefines
  174. the findfont operator to automatically load fonts from the disk the first
  175. time they are referenced.  It first searches the directory "PSFonts:" for
  176. a file whose name is the same as the PostScript name (without the "/").  If
  177. it finds one it assumes it is a font definition and runs it.  Otherwise it
  178. tries the directory "PSFonts:OtherFonts".  (On my machine I keep all my Adobe
  179. fonts in PSFonts: and all my PD fonts in PSFonts:OtherFonts.)  You can change
  180. the list of directories to be searched by editing the startup file; you can
  181. also make it add a suffix to the font file names.
  182.  
  183. The startup file also defines a default font, which will be substituted if
  184. the font your program requests cannot be found.  The initial default font
  185. as set up by the standard startup file is a dummy font that just prints big
  186. dots.  It isn't readable, but at least allows most text operations to proceed
  187. without producing errors.  This means that if you don't have the font loading
  188. set up properly the only text output you will get is big dots.  So if that is
  189. what you see when you run Post it probably means that you don't have any
  190. fonts, rather than a problem with Post itself.
  191.  
  192. I have included a freely distributed font called "FunkyFont".  It is simple
  193. and takes up very little memory, but is quite readable.  If you don't have
  194. all the standard fonts it makes a useful default font.
  195.  
  196. Since a font is loaded into the vm just like any other PostScript code, it
  197. will be discarded when the vm is restored.  This means that in a multiple
  198. page document the fonts will likely be reloaded on every page.  To save time,
  199. it is usually much better to preload the fonts you are going to need.  You
  200. can do this using the "load font" menu command, or you can write yourself
  201. a little PostScript program to load your favourite fonts.  (Exercise for
  202. the user: write a driver to extract the font names from a conforming
  203. PostScript program and preload them.)
  204.  
  205. There are a number of commercial sources for fonts.  Both the Adobe type 1
  206. (encrypted) fonts and type 3 (standard downloadable) fonts are supported.
  207. Since type 1 fonts can contain special "hints" to improve the quality at
  208. small point sizes on low or medium resolution devices they usually give
  209. much higher quality results.  You can get type 1 fonts from Adobe, or a
  210. number of other vendors.
  211.  
  212. A good source of the standard set of 35 fonts as come on most PostScript
  213. printers is the Adobe Type Manager (13 fonts) and its associated Plus Pack
  214. (22 fonts).  The IBM version contains the fonts in a format which can be read
  215. by Post.  Various utility programs (e.g. CROSSDOS) are available to copy file
  216. from IBM 3.5 inch disks onto Amiga files.  Just copy the .PFB files into your
  217. PSFonts: directory, changing the names to their PostScript names. The Mac
  218. version contains the fonts too, but you need a utility program to change the
  219. file format.  The quality of the Adobe fonts is excellent; the printed
  220. output from Post on my LJIIP rivals that of a LaserWriter.
  221.  
  222. If you have any of the additional CompuGraphic outline fonts supplied by
  223. Gold Disk for use with their DTP programs you can generate type 3 fonts
  224. from them using their conversion program.  The quality is not as good as
  225. the original Compugraphic fonts but is acceptable for proofing purposes.
  226.  
  227. There are some freely copyable fonts that were originally distributed with
  228. the GhostScript project (another freeware PostScript interpreter available
  229. on Unix).  The quality of these is rather poor, as they appear to have been
  230. generated by tracing bitmap outlines.  However they will serve to get you
  231. started, and they are free.
  232.  
  233. There are also various shareware and PD fonts available.  Many of these were
  234. derived from the Mac or IBM.  They may still be in a foreign file format.
  235. The file should be converted to readable ASCII, with no strange control
  236. characters. Some of the fonts have Mac encoding vectors.  You won't notice
  237. the difference for the standard ASCII characters, as they are the
  238. same, but you may have to convert to the standard encoding to get
  239. more unusual characters like the trademark sign to work.  (Programs
  240. like Adobe illustrator do their own font encoding anyway.)  You
  241. will need to know some PostScript to make this change.  If you
  242. see the sequence "/Helvetica findfont /Encoding get" or
  243. "<dictionary> /MacVec get" try replacing it with "StandardEncoding".
  244.  
  245. You are recommended to ensure all your fonts have UniqueID's.  This makes
  246. the font caching code more efficient.  Often all you have to do is uncomment
  247. them in the source.  Any number will do for the ID (up to 2**24 - 1), as long
  248. as it is different for each of your fonts.  Make it a multiple of 4, as Adobe
  249. recommend adding 1 or 2 to the ID when modifying the font.
  250.  
  251. Each font should have a FontName entry.  This isn't actually required by
  252. Adobe, but certain programs such as Adobe Illustrator copy the font directory
  253. when recoding the font.  If the name is missing, you get a dictionary full
  254. error after the name has been added.
  255.  
  256. WorkBench 2.0
  257. =============
  258.  
  259. I don't have 2.0 myself, so I am not able to test Post under it.  But I
  260. understand that it works OK.  You need to set up ConMan it you want to
  261. run interactively.  It you mount it as "CNC:" then you can use the CONDEV
  262. option to access it.  Otherwise you will find the console output is going
  263. to the WorkBench screen.
  264.  
  265. Common problems
  266. ===============
  267.  
  268. Printers
  269. --------
  270.  
  271. Some people have difficulty in getting Post to work correctly with printer
  272. output.  The first thing to check is that you have your printer preferences
  273. set up properly.  Post uses the printer values to set the size and density
  274. of its page buffer, so if you have silly values set it may pick a silly
  275. value for its buffer size and fail due to running out of memory.  So Run
  276. Preferences, go to the graphic 2 screen, and check the page limits.  If you
  277. set the limits to "Absolute" then width and height should be in inches; if
  278. you choose "Pixels" then the dimensions are in dots.  Turn smoothing and
  279. centering off.  On the graphic 1 screen, set the Aspect to horizontal, the
  280. image to positive, and the shade to black and white or colour according to
  281. your printer.  If the output comes out distorted, to a silly scale, or with
  282. circles turned into ellipses, and takes forether to print, it is probably
  283. because the page size is wrong and the printer device is laboriously scaling
  284. it to fit.  N.B. the WB 1.3 Preferences program appears to have a bug in it:
  285. after typing a value into the size gadgets you need to hit the return key;
  286. if you simply exit with the mouse teh value you typed gets lost.
  287.  
  288. If you are having problems with the printer setup, it is better to run Post
  289. interactively.  Then you can look at the values in the page size gadgets
  290. in the requestor window to check they are all sensible.
  291.  
  292. Most page printers (lasers, DeskJet) will give the best quality with density
  293. set to the highest value.  For matrix printers try both the highest and the
  294. next highest - as the pins usually overlap at high densities the quality may
  295. not be any better.  If you are very tight on memory then a lower density
  296. will reduce the amount needed for the page buffer.
  297.  
  298. The Workbench printer drivers print bitmapped graphics dumps within the
  299. text margins, whereas PostScript expects it bitmaps to begin right at the
  300. edges of the paper.  You can line things up properly by setting the page
  301. offset gadgets in the requestor window.  Once you have experimented to
  302. determine the proper values to can put them in a shell script, or set them
  303. in the WorkBench icon, so you don't have to type them every time.
  304.  
  305. If you have a LaserJet printer or one that emulates it, you should use the
  306. special driver "postlj".  It is faster, supports all the paper sizes in
  307. both portrait and landscape orientation, and avoids all the problems with
  308. the standard Workbench drivers interface.  I have tested it on my HP LJIIP,
  309. but it should work on other LaserJet compatibles.
  310.  
  311. If you attempt to print a page that is larger than the maximum graphics dump
  312. size that the driver will handle, it will be truncated rather than scaled to
  313. fit.  N.B. the Workbench 1.3 LaserJet and DeskJet drivers do not support
  314. dumps larger than 8 by 10 inches.
  315.  
  316. Fonts
  317. -----
  318.  
  319. Most of the remaining troubles relate to fonts.  I personally recommend
  320. the Adobe fonts: the quality is excellent and you are assured of maximum
  321. compatability.  There are many other sources for fonts.  Even the shareware
  322. fonts normally work.  However being constructed slightly differently from the
  323. Adobe ones, they sometimes fail when programs attempt to modify them to
  324. change the character set encoding or character widths or obtain special
  325. effects.
  326.  
  327. Other troubles with fonts usually relate to not not being able to find the
  328. font file on the disk.  Read the comments in the init.ps file to see
  329. what directories in you filing system it is searching, also check whether
  330. you font files have extensions.  I prefer to keep my fonts without
  331. extensions, so for example on my machine "Times-Roman" is in the file
  332. "PSFonts:Times-Roman".  But you may want to keep the ".PFB" extension on
  333. your font filesif they are in IBM format - if you have other packages that
  334. like them that way.  You can easily change this by editing init.ps.
  335.  
  336. N.B. if you have some files with ".AFM" extensions they are NOT PostScript
  337. fonts.  The are font metric files that define the character widths and other
  338. data for use by application programs; they do not define the characters
  339. outlines themselves.  They are of no use to Post.
  340.  
  341. Use with other packages
  342. -----------------------
  343.  
  344. I have used Post extensively with PPage (V1.3).  I find that printing using
  345. postlj is about five times faster than printing direct from PPage.  It solves
  346. the page offset problem.  Also, it gives access to the Adobe type 1 font
  347. range, which is considerably more extensive than the hinted versions of the
  348. Compugraphic fonts that are presently available.  If you have the
  349. Helvetica-Narrow fonts (or if you don't have Helvetica) use the alternative
  350. prologue (alt_psprlg) so it won't waste time building them algorithmically
  351. (whether they are needed or not).
  352.  
  353. I have tested a PageStream file.  There was a problem with the prologue
  354. not being compatable with downloaded Adobe fonts.  If you load all your
  355. fonts beforehand, using the "Load font" menu selection, it should work OK.
  356. Hopefully this will be fixed soon.
  357.  
  358. I have printed Excellence! files successfully.
  359.  
  360. AmigaTeX with the PostScript driver should work OK.  I have seen a TeX
  361. example (from another system) that failed - it was trying to define a font
  362. with an encoding vector only 128 entries long.  If you meet this problem
  363. you can fix it if you are prepared to edit the PostScript file.
  364.  
  365. Debugging
  366. ---------
  367.  
  368. If your PostScript program is failing, if you know a little PostScript
  369. is usually quit easy to find out what is going wrong.  In fact if you are
  370. developing PostScript code Post is a much better debugging tool than your
  371. average PostScript printer.
  372.  
  373. It is normally best to use interactive mode for debugging.  Start up Post
  374. on the screen and pick the "interactive" option.  Then run you program
  375. from the interactive window.
  376.  
  377. To run your program, type:
  378.  
  379.     > (filename.ps) run
  380.  
  381. If it fails with an error message, you can then type interactive commands
  382. to see what happened.
  383.  
  384. To display the contents of the operand stack, type:
  385.  
  386.     > pstack
  387.  
  388. To display the contents of the execution stack at the point of the last
  389. error, type:
  390.  
  391.     > $error /estack get ==
  392.  
  393. To display the contents of any named variable, type:
  394.  
  395.     > varname ==
  396.  
  397. To see what is in the current dictionary, type:
  398.  
  399.     > currentdict {== ==} forall
  400.  
  401. If you have no idea how far your program got before it failed, try adding a
  402. few lines "1001 ==" "1002 ==" "1003 ==" to trace how far it got.  As
  403. PostScript files are pure ASCII text they are easy to inspect any modify
  404. with any editor.
  405.