home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / printer / post17b.lzh / README < prev   
Text File  |  1992-03-13  |  18KB  |  385 lines

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