operators (what other languages term functions) take their arguments from the stack, and place their results onto the stack. Literals (for example, numbers) have the effect of placing a copy of themselves on the stack. Sophisticated data structures can be built on the array and dictionary types, but cannot be declared to the type system, which sees them all only as arrays and dictionaries, so any further typing discipline to be applied to such user-defined "types" is left to the code that implements them. The character "%" is used to introduce comments in PostScript programs. As a general convention, every PostScript program should start with the characters "%!PS" as an interpreter directive so that all devices will properly interpret it as PostScript. "Hello world" A Hello World program, the customary way to show a small example of a complete program in a given language, might look like this in PostScript (level 2): %!PS /Courier % name the desired font 20 selectfont % choose the size in points and establish % the font as the current one 72 500 moveto % position the current point at % coordinates 72, 500 (the origin is at the % lower-left corner of the page) (Hello world!) show % stroke the text in parentheses showpage % print all on the page or if the output device has a console %!PS (Hello world!) = Units of length PostScript uses the point as its unit of length. However, unlike some of the other versions of the point, PostScript uses exactly 72 points to the inch. Thus: For example, in order to draw a vertical line of 4 cm length, it is sufficient to type: 0 0 moveto 0 113.385827 lineto stroke More readably and idiomatically, one might use the following equivalent, which demonstrates a simple procedure definition and the use of the mathematical operators mul and div: /cm {72 mul 2.54 div} def % 1 inch = 2.54 cm exactly 0 0 moveto 0 4 cm lineto stroke Most implementations of PostScript use single-precision reals (24-bit mantissa), so it is not meaningful to use more than 9 decimal digits to specify a real number, and performing calculations may produce unacceptable round-off errors. Software List of software which can be used to render the PostScript documents: Ghostscript pstoedit Zathura See also Adobe StandardEncoding (PostScript character set) Document Structuring Conventions Typeface Computer font Encapsulated PostScript PostScript Printer Description (PPD)