⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 language.txt

📁 实现并行算法
💻 TXT
📖 第 1 页 / 共 2 页
字号:
   Copyright (C) 1989, 1995, 1996 Aladdin Enterprises.  All rights reserved.
  
  This file is part of Aladdin Ghostscript.
  
  Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  or distributor accepts any responsibility for the consequences of using it,
  or for whether it serves any particular purpose or works at all, unless he
  or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  License (the "License") for full details.
  
  Every copy of Aladdin Ghostscript must include a copy of the License,
  normally in a plain ASCII text file named PUBLIC.  The License grants you
  the right to copy, modify and redistribute Aladdin Ghostscript, but only
  under certain conditions described in the License.  Among other things, the
  License requires that the copyright notice and this notice be preserved on
  all copies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This file, language.txt, describes the relationship between the Ghostscript
interpreter and the PostScript language.

For an overview of Ghostscript and a list of the documentation files, see
README.

The Ghostscript interpreter, except as noted below, is intended to execute
properly any source program written in the (Level 2) PostScript language as
defined in the December 1990 printing of the PostScript Language Reference
Manual (Second Edition) published by Addison-Wesley (ISBN 0-201-18127-4).
However, the interpreter is configurable in ways that can restrict it to
various subsets of this language.  Specifically, the base interpreter
accepts the Level 1 subset of the PostScript language, as defined in the
first edition of the PostScript Language Reference Manual, ISBN
0-201-10174-2, Addison-Wesley, 1985, plus the file system, version 25.0
language, and miscellaneous additions listed in sections A.1.6, A.1.7, and
A.1.8 of the Second Edition respectively, including allowing a string
operand for the 'status' operator.  The base interpreter may be configured
by adding any combination of the following:

	- The ability to process PostScript Type 1 fonts.  This facility is
normally included in the interpreter.

	- The CMYK color extensions listed in section A.1.4 of the Second
Edition (including colorimage).  These facilities are only available if the
color, dps, or level2 feature was selected at the time that Ghostscript was
compiled and linked.

	- The Display PostScript extensions listed in section A.1.3
of the Second Edition, but excluding the operators listed in section
A.1.2.  These facilities are only available if the dps feature or the
level2 feature was selected at the time that Ghostscript was compiled
and linked.

	- The composite font extensions listed in section A.1.5 of the
Second Edition, and the ability to handle Type 0 fonts.  These facilities
are only available if the compfont feature or the level2 feature was
selected at the time that Ghostscript was compiled and linked.

	- The ability to load TrueType fonts and to handle PostScript Type
42 (encapsulated TrueType) fonts.  These facilities are only available if
the ttfont feature was selected at the time that Ghostscript was compiled
and linked.

	- The PostScript Level 2 "filter" facilities aside from DCTEncode
and DCTDecode filters.  These facilities are only available if the filter,
dps, or level2 feature was selected at the time that Ghostscript was
compiled and linked.

	- The PostScript Level 2 DCTEncode and DCTDecode filters.  These
facilities are only available if the dct or level2 feature was selected at
the time that Ghostscript was compiled and linked.

	- All the other PostScript Level 2 operators and facilities listed
in section A.1.1 of the Second Edition and not listed in any of the other
A.1.n sections.  These facilities are only available if the level2 feature
was selected at the time that Ghostscript was compiled and linked.

Adding all of these produces a full Level 2 PostScript language
interpreter.

Ghostscript also includes the optional ability to interpret files in the PDF
1.1 format defined in the June 1993 printing of the Portable Document Format
Reference manual published by Addison-Wesley (ISBN 0-201-62628-4) as amended
by Adobe Technical Note #5156, except for the encryption features.  This
facility is only available if the 'pdf' feature was selected at the time
that Ghostscript was compiled and linked.

Ghostscript also includes a number of operators defined below that are not
in the PostScript language.

Implementation limits
=====================

The following implementation limits correspond to those in Table B.1 and
B.2 of the Second Edition.  Those marked with * are different from the ones
in the Second Edition.

Architectural limits
--------------------

integer		32-bit two's complement integer
real		single-precision IEEE float
*array
	On 16-bit systems:	8191 elements
	On 32-bit systems:	65535 elements
*dictionary
	On 16-bit systems:	8190 elements
	On 32-bit systems:	65534 elements
*string		65535 characters
*name		16383 characters
filename	100 characters
*save level	none (capacity of memory)
*gsave level	none (capacity of memory)

Typical memory limits in Level 1
--------------------------------

userdict		200
FontDirectory		100
*operand stack		800
dictionary stack	20
execution stack		250
*interpreter level	none (capacity of memory)
*path			none (capacity of memory)
dash			11
*VM			capacity of memory
*file			determined by operating system
*image			65535 values (samples x components) for 1, 2, 4,
			  or 8-bit samples; 32767 values for 12-bit samples

Other differences in VM consumption
-----------------------------------

Packed array elements occupy either 2 bytes or 8 bytes.  The average
element size is probably about 5 bytes.

Names occupy 12 bytes plus the space for the string.

Ghostscript-specific additions
==============================

Miscellaneous
-------------

^D and ^Z are self-delimiting tokens, like [ and ].  They are initially
defined as empty procedures so that they will be ignored in the input
stream.

run can take either a string or a file as its argument.  In the latter
case, it just runs the file, closing it at the end, and trapping errors
just as for the string case.

Mathematical operators
----------------------

	<number> arccos <number>
		Computes the arc cosine of a number between -1 and 1.

	<number> arcsin <number>
		Computes the arc sine of a number between -1 and 1.

String operators
----------------

	<state> <fromString> <toString> .type1encrypt <newState> <toSubstring>
		Encrypts fromString according to the algorithm for Adobe
		  Type 1 fonts, writing the result into toString.
		  toString must be at least as long as fromString or a
		  rangecheck error occurs.  state is the initial state of
		  the encryption algorithm (a 16-bit non-negative
		  integer); newState is the new state of the algorithm.

	<state> <fromString> <toString> .type1decrypt <newState> <toSubstring>
		Decrypts fromString according to the algorithm for Adobe
		  Type 1 fonts, writing the result into toString.  Other
		  specifications are as for type1encrypt.

Relational operators
--------------------

	<number|string> <number|string> max <number|string>
		Returns the larger of two numbers or strings.

	<number|string> <number|string> min <number|string>
		Returns the smaller of two numbers or strings.

File operators
--------------

	<string> findlibfile <foundstring> <file> true
	<string> findlibfile <string> false
		Opens the file of the given name for reading, searching
		  through directories as described in use.txt.  If the
		  search fails, findlibfile simply pushes false on the
		  stack and returns, rather than causing an error.

	<file> <integer> unread -
	 	Pushes back the last-read character onto the front of the
		  file.  If the file is only open for writing, or if the
		  integer argument is not the same as the last character
		  read from the file, causes an ioerror error.  May also
		  cause an ioerror if the last operation on the file was not
		  a reading operation.

	<file> <device> writeppmfile -
		Writes the contents of the device, which must be an image
		  device, onto the file, in Portable PixMap (ppm) format.
		  Does not close the file.

Ghostscript also supports the following IODevice in addition to a subset of
those defined in the Adobe documentation: %pipe%command, which opens a pipe
on the given command.  This is only supported on operating systems that
provide popen (primarily Unix systems, and not all of those).

Path operators
--------------

	<x> <y> <width> <height> .rectappend -
	<numarray> .rectappend -
	<numstring> .rectappend -
		Appends a rectangle or rectangles to the current path, in
		  the same manner as rectfill, rectclip, etc.  Only
		  defined if the dps option is selected.

Painting operators
------------------

Ghostscript supports an experimental extension of the PostScript imaging
model to include RasterOp and some related facilities.  This extension is
only available if the rasterop option was selected when building
Ghostscript.

With the RasterOp extension, imaging operations compute a function D =
f(D,S,T) in RGB space, where f is an arbitrary 3-input Boolean function, D
is the destination (frame buffer or print buffer), S is the source
(described below), and T is the texture (the current PostScript color, which
may be a pattern).  The source and texture depend on the PostScript imaging
operation:

	- For fill and stroke, the source is solid black, covering the
	region to be painted; the texture is the current PostScript color.

	- For show and imagemask, the source is solid black, covering the
	pixels to be painted; the texture is the current PostScript color.

	- For image and colorimage, the source is the image data; the
	texture depends on an optional Boolean parameter, CombineWithColor,
	in the image dictionary.  If CombineWithColor is false (the
	default), the texture is solid black.  If CombineWithColor is true,
	the texture is the current color.  For the non-dictionary form of
	the image operator, CombineWithColor is considered to be false.

The rasterop option adds the following operators:

	<int8> .setrasterop -
		Sets the RasterOp function in the graphics state.
		  The default function is 252, Source | Texture.

	- .currentrasterop <int8>
		Returns the current RasterOp function.

	<bool> .setsourcetransparent -
		Sets source transparency in the graphics state.  When source
		  transparency is true, white source pixels prevent storing
		  into the destination, regardless of what the RasterOp
		  function returns.  The default source transparency is
		  false.

	- .currentsourcetransparent <bool> -
		Returns the current source transparency.

	<bool> .settexturetransparent -
		Sets texture transparency in the graphics state.  When texture
		  transparency is true, white texture pixels prevent storing
		  into the destination, regardless of what the RasterOp
		  function returns.  The default texture transparency is
		  false.

	- .currenttexturetransparent <bool> -
		Returns the current texture transparency.

For more information on RasterOp and transparency, please consult chapter 5
of the "PCL 5 Color Technical Reference Manual", Hewlett-Packard Manual Part
No. 5961-0635.

Filters
-------

Ghostscript supports all the standard PostScript Level 2 filters, except
that it does not currently support the EarlyChange key in the LZWEncode
filter.  Ghostscript also supports the as yet undocumented FlateEncode and
FlateDecode filters from PDF 1.2 and (presumably) PostScript Level 3, except
for the Effort key in FlateEncode.  In addition, Ghostscript supports the
following non-standard filters:

	<target> /BCPEncode filter <file>
	<source> /BCPDecode filter <file>
		Create filters that implement the Adobe Binary
		  Communications Protocol.  See Adobe documentation for
		  details.

	<target> <seed_integer> /eexecEncode filter <file>
		Creates a filter for encrypting data into the
		  eexec encrypted format described in the
		  Adobe Type 1 Font Format documentation.  The
		  seed_integer must be 55665 for proper operation.
		  This filter produces binary output and does not
		  include the initial 4 garbage bytes.

	<source> <seed_integer> /eexecDecode filter <file>
		Creates a filter for decrypting data that has been
		  encrypted using eexec encryption as described in the
		  Adobe Type 1 Font Format documentation.  The
		  seed_integer must be 55665 for proper operation.

	<source> /PCXDecode filter <file>
		Creates a filter that decodes data in the run-length
		  encoding used in the PCX graphics file format.

	<source> <hex_boolean> /PFBDecode filter <file>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -