home *** CD-ROM | disk | FTP | other *** search
/ Best Objectech Shareware Selections / UNTITLED.iso / boss / word / misc / 010 / language.doc < prev    next >
Text File  |  1992-09-10  |  15KB  |  381 lines

  1.    Copyright (C) 1989-1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.
  19.  
  20. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22. This file, language.doc, describes the Ghostscript language.
  23.  
  24. For an overview of Ghostscript and a list of the documentation files, see
  25. README.
  26.  
  27. The Ghostscript interpreter, except as noted below, is intended to execute
  28. properly any source program written in a language defined by reference to
  29. the December 1990 printing of the PostScript Language Reference Manual
  30. (Second Edition) published by Addison-Wesley (ISBN 0-201-18127-4).  The
  31. Ghostscript language includes the following elements of the PostScript
  32. (TM) language:
  33.  
  34.     - The full PostScript Level 1 language, as also defined in the
  35. first edition of the PostScript Language Reference Manual, ISBN
  36. 0-201-10174-2, Addison-Wesley, 1985.
  37.  
  38.     - The CMYK color, file system, version 25.0 language, and
  39. miscellaneous additions listed in sections A.1.4, A.1.6, A.1.7, and A.1.8
  40. of the Second Edition respectively.
  41.  
  42.     - The Display PostScript extensions listed in section A.1.3 of the
  43. Second Edition, but excluding the operators listed in section A.1.2, and
  44. also excluding setbbox, xshow, xyshow, and yshow.  These extensions are
  45. only available if the dps feature was selected at the time that
  46. Ghostscript was compiled and linked.
  47.  
  48.     - A few other PostScript Level 2 operators, listed below.
  49.  
  50. Ghostscript also includes a number of operators defined below that are not
  51. in the PostScript language.
  52.  
  53. Stub facilities
  54. ---------------
  55.  
  56. The following operators, while provided in the current release, have only
  57. a partial or dummy implementation.
  58.  
  59. Character and font operators:
  60.     cshow, rootfont, setcachedevice2
  61.  
  62. Graphics state operators:
  63.     currentblackgeneration, currentcmykcolor, currentcolorscreen,
  64.     currentcolortransfer, currenthalftonephase, currentundercolorremoval,
  65.     setblackgeneration, setcmykcolor, setcolorscreen,
  66.     setcolortransfer, sethalftonephase, setundercolorremoval,
  67.     currenthalftone, sethalftone,
  68.     setbbox
  69.  
  70. Interpreter parameter operators:
  71.     setucacheparams, ucachestatus
  72.  
  73. Path construction operators:
  74.     ucache
  75.  
  76. Virtual memory operators:
  77.     currentshared, scheck, setshared, setvmthreshold, shareddict,
  78.     SharedFontDirectory, vmreclaim
  79.  
  80. Level 2 operators
  81. -----------------
  82.  
  83. The following PostScript Level 2 operators are available in
  84. Ghostscript.  Unless otherwise noted, these are only available if the
  85. level2 feature was selected at the time that Ghostscript was compiled
  86. and linked.
  87.  
  88. File operators:
  89.        filter (not all filters are implemented, and most of the
  90.       implemented ones are only available if the filter feature was
  91.       selected when Ghostscript was built)
  92.  
  93. Graphics state operators:
  94.     currentcolor, currentcolorspace, setcolor, setcolorspace
  95.       (for DeviceGray, DeviceRGB, and DeviceCMYK only)
  96.     currentstrokeadjust, setstrokeadjust (even if level2 is
  97.       not selected)
  98.  
  99. In addition, Ghostscript supports the following Level 2 facilities:
  100.  
  101.     - Use of a string with the status operator (even if level2 is
  102. not selected);
  103.  
  104.     - Use of a dictionary with the image and imagemask operators;
  105.  
  106.     - Use of a string or a file as data source with the image,
  107. imagemask, and colorimage operators (even if level2 is not selected).
  108.  
  109. Ghostscript-specific additions
  110. ==============================
  111.  
  112. Miscellaneous
  113. -------------
  114.  
  115. ^Z is counted as whitespace.
  116.  
  117. run can take either a string or a file as its argument.  In the former
  118. case, it uses findlibfile to open the file (searching directories as
  119. needed).  In the latter case, it just runs the file, closing it at the
  120. end, and trapping errors just as for the string case.
  121.  
  122. Mathematical operators
  123. ----------------------
  124.  
  125.     <number> arccos <number>
  126.         Computes the arc cosine of a number between -1 and 1.
  127.  
  128.     <number> arcsin <number>
  129.         Computes the arc sine of a number between -1 and 1.
  130.  
  131. Dictionary operators
  132. --------------------
  133.  
  134.     <dict> <integer> setmaxlength -
  135.         Changes the capacity of a dictionary, preserving its
  136.           contents.  Causes a dictfull error if the requested
  137.           capacity is less than the current number of occupied
  138.           entries.
  139.  
  140. String operators
  141. ----------------
  142.  
  143.     <string|name|other> <patternString> stringmatch <boolean>
  144.         Determines whether the string or name matches the given
  145.           pattern.  In the pattern, `*' matches any substring of
  146.           the string, `?' matches any single character, and `\'
  147.           quotes the next character.  If the first argument is not
  148.           a string or name, stringmatch returns true if
  149.           patternString is a single *, and false otherwise.
  150.  
  151.     <state> <fromString> <toString> type1encrypt <newState> <toSubstring>
  152.         Encrypts fromString according to the algorithm for Adobe
  153.           Type 1 fonts, writing the result into toString.
  154.           toString must be at least as long as fromString or a
  155.           rangecheck error occurs.  state is the initial state of
  156.           the encryption algorithm (a 16-bit non-negative
  157.           integer); newState is the new state of the algorithm.
  158.  
  159.     <state> <fromString> <toString> type1decrypt <newState> <toSubstring>
  160.         Decrypts fromString according to the algorithm for Adobe
  161.           Type 1 fonts, writing the result into toString.  Other
  162.           specifications are as for type1encrypt.
  163.  
  164. Relational operators
  165. --------------------
  166.  
  167.     <number|string> <number|string> max <number|string>
  168.         Returns the larger of two numbers or strings.
  169.  
  170.     <number|string> <number|string> min <number|string>
  171.         Returns the smaller of two numbers or strings.
  172.  
  173. File operators
  174. --------------
  175.  
  176.     <string> findlibfile <foundstring> <file> true or <string> false
  177.         Opens the file of the given name for reading.  If the file
  178.           cannot be opened using the supplied name, searches
  179.           through directories as described in use.doc.  If the
  180.           search fails, findlibfile simply pushes false on the
  181.           stack and returns, rather than causing an error.
  182.  
  183.     <file> <integer> unread -
  184.          Pushes back the last-read character onto the front of the
  185.           file.  If the file is only open for writing, or if the
  186.           integer argument is not the same as the last character
  187.           read from the file, causes an ioerror error.  May also
  188.           cause an ioerror if the last operation on the file was not
  189.           a reading operation.
  190.  
  191.     <file> <device> writeppmfile -
  192.         Writes the contents of the device, which must be an image
  193.           device, onto the file, in Portable PixMap (ppm) format.
  194.           Does not close the file.
  195.  
  196. Path operators
  197. --------------
  198.  
  199.     <x> <y> <width> <height> rectappend -
  200.     <numarray> rectappend -
  201.     <numstring> rectappend -
  202.         Appends a rectangle or rectangles to the current path, in
  203.           the same manner as rectfill, rectclip, etc.  Only
  204.           defined if the dps option is selected.
  205.  
  206. Filters
  207. -------
  208.  
  209. Ghostscript supports all standard filters except DCTEncode and
  210. DCTDecode.  Ghostscript does not support the use of a procedure as a
  211. data source or sink, only a file or a string.  In addition,
  212. Ghostscript supports two non-standard filters:
  213.  
  214.     <file|string> <seed_integer> /eexecDecode filter <file>
  215.         Creates a filter for decrypting data that has been
  216.           encrypted using eexec encryption as described in the
  217.           Adobe Type 1 Font Format documentation.  The
  218.           seed_integer must be 55665 for proper operation.
  219.