www.archive-org-2014.com » ORG » T » TAILRECURSIVE

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

    Archived pages: 40 . Archive date: 2014-02.

  • Title: Tail Recursive
    Descriptive info: .. TailRecursive.. Welcome to TailRecursive, my personal website.. Due to a lack of material and in an effort to simplify my life, I've decided to take my old blog down.. I really don't have anything interesting to say in this forum any longer and don't have the time to keep patching my software to keep  ...   shutting it all off and going back to static HTML.. From time to time, I may add updates to these pages, but it won't be very often.. If you are looking for my.. First Guide to PostScript.. , it is still on the site at the URL it has had for the past few years..

    Original link path: /
    Open archive

  • Title: A First Guide to PostScript
    Descriptive info: A First Guide to PostScript.. This is the fifth edition of the.. It differs from the previous editions in that a number of errors which people have brought to my attention have been fixed and a number of common reader.. questions.. have been addressed.. I have also added some information on how to work with colors and raster graphics.. It is my hope that this document is now stable and reasonably error-free.. If you find an error, please send me.. e-mail.. and let me know.. I can t promise that I ll fix it right away, but I will at least add it to my list of things to do.. My sincere thanks goes out to everyone who has sent me e-mail concerning the guide.. Whether you were asking a question, or offering me a correction, I sincerely appreciate it.. My only regret is that I have not been able to be as responsive to questions and corrections as I would like.. I left Indiana University quite a long time ago (nearly ten years as of the time of this writing), and while I still have write access to my old account space I can not be sure that I always will have access.. I will maintain the original copy at Indiana University while I have access, but from now on the.. official copy.. will be maintained at my personal.. website.. , where you can also find out a.. little.. more about me, if you are so inclined.. About this Document.. This is meant to be a simple introduction to programming in the.. PostScript.. page description language from.. Adobe.. This document is not meant to be a comprehensive reference manual (although it does contain an.. index.. of some of PostScript s standard operators and a list of various.. errors.. ).. There are far better reference.. books.. , if  ...   document because I have noticed that many people on the Internet have been asking for some online document to get them started.. I decided that this was a good opportunity.. I have benefited from the free and open nature of the Internet (most of the software I use is freeware or shareware).. This is my opportunity to give something back to the community and to try to perpetuate something of the original community atmosphere that existed when I first started using it.. Contents.. What.. is.. PostScript?.. Graphics Concepts in PostScript.. Language Concepts in PostScript.. Programming in PostScript.. Drawing and Filling Shapes.. Putting Text on the Page.. Adding Color.. Transformations.. Clipping for Effect.. Raster Graphics.. Encapsulated PostScript.. Funky Stuff.. Index of Examples.. Index of Operators.. Listing of Errors.. TAR Archive of These Pages.. Note.. PostScript is a registered trademark of Adobe Systems Incorporated.. The copyright to the PostScript language is also held by Adobe Systems Incorporated.. Legal questions concerning these issues should be directed to them.. Please note that this site is not related to, supported by, or condoned by Adobe in any way.. It is an independent site and is not official.. Disclaimer.. No warranty or guarantee, either expressed or implied, is made as to the correctness of this document.. The author can not be held responsible for any damages that may occur through the use of any code contained herein.. You get what you paid for.. Copyright Information.. When I first started this guide, there was no convenient way to put something out there in such a way that you could keep the copyright, but still allow people to make copies or even derivative works.. Now there is, through the joys of the.. Creative Commons.. So, since the Creative Commons licenses are now available, this new version is licensed under a.. Creative Commons Attribution-NonCommercial-ShareAlike 2.. 5 License..

    Original link path: /postscript/index.html
    Open archive

  • Title: Frequently Asked Questions
    Descriptive info: Frequently Asked Questions.. Main Page.. I have received a number of questions from readers, and many of them are the same.. Since these seem to be popular questions, I thought I would list them here, along with my usual answers.. Of course, you will also find the.. FAQ.. for the comp.. lang.. postscript Usenet group to be useful.. There are far more.. s in that list than are here.. By the way, if anyone knows of a better answer to any of these question, let me.. know.. Is there a utility to convert a PostScript file into my favorite word processors format?.. I have a Hawat-Pickford 520xz ink jet printer without PostScript, is there anyway I can print PostScript files on it?.. Can you point me to a good previewer for my computer?.. Can you tell me X about Acrobat and.. PDF.. files?.. How do I print out a PostScript file from my computer?.. My company has an Acme Laz-o-Tron typesetter.. We're having problems printing out a set of color separations for a.. TIFF.. photograph processed by FotoWerks Pro+.. Why are the separations coming out wrong?.. I'm looking at two printers, one has PostScript while the other does not.. Which should I buy?.. Is it possible to concatenate two PostScript files together into a single file?.. Is it possible to create a.. from a PostScript file?.. Short answer: no.. Long answer: Maybe.. There is a utility to convert PostScript files into ASCII files (it tries to extract the text), but it can not work on every PostScript file.. The problem here is that PostScript is a full programming language, and there are many ways to accomplish a given thing.. It would be next to impossible for a program to look at some piece of PostScript and decide what the contents are.. It would be possible to write a program which would accept some subset of PostScript files and convert them to some useful format, but it would be difficult to write (and it could not handle all possible PostScript files).. Yep.. There are a number of PostScript interpreters which run on your computer and can print out PostScript files.. There are versions of these kinds of utilities for the Mac and for DOS/Windows machines.. I have never used one of these utilities, so I can not recommend any particular one.. Go to your friendly neighborhood dealer or your favorite catalog to see what they have.. There is a section in the PostScript.. on this issue.. You may also want to have a look at.. GhostScript.. GhostScript can print PostScript files on certain printers.. My first recommendation is.. Hey, it's free; and it does a good job.. It is also able to convert PostScript files to a number of other graphics formats, so it can be handy there.. There are also a number of commercial previewers.. I have not used any of these commercial packages, so I can not recommend any of them in particular.. Nope.. I don't know anything about Acrobat or.. files.. Check out the.. You may find the information you need there.. The procedures and tools vary, depending upon the machine.. I'm going to assume that you have a PostScript enabled printer and either received or wrote the PostScript file (if you have the application that generated the file, you should just use your application's print command or menu).. DOS/PC.. Assuming your PostScript printer is on port LPT1: (it really doesn't matter), all you need to do is:.. COPY FILE.. PS LPT1:.. where.. FILE.. PS.. is whatever your file is.. Mac OS X.. Mac OS X comes with a built-in utility to convert PostScript files to.. Just opening the PostScript file from the Finder is sufficient to start the conversion.. If you want to print the file and you do not have a PostScript printer, you can just print the.. file you got normally.. If you do have a PostScript printer, you will probably have to follow the instructions for Unix below.. UNIX and its cousins.. Depending upon your system, just printing the file as if it were a text file.. should.. send it to the printer correctly.. Most UNIX systems are clever enough to recognize the PostScript file from the.. %!.. comment at the beginning of the file.. For example,  ...   same PostScript file will look the same regardless of which PostScript printer you use, with one exception: if one printer is capable of better print quality (finer lines, smoother curves, gentler shades of grey) than the other, your document should benefit from these increased capabilities without the PostScript file's needing to be changed.. You are benefiting from PostScript's device independence.. As for graphics intensive work, I find the.. EPS.. format to be the best for line drawing type graphics (.. i.. e.. no bitmap images) that I will want to include in a document.. I very often want to print an image generated by one package when the word processor may be from a different vendor.. Many times (incredible to tell) I sometimes need to include a graphic made on one computer system in a document on a completely different system! In such a heterogeneous environment,.. graphics are just about the only reasonable option.. Also, many top-quality drafting/painting programs generate their best output in.. (on some windowing systems, the built-in graphic format can have a limited resolution that results in badly displaced elements in a printed image).. If you use.. graphics, you.. must.. have a PostScript enabled printer if you want to print them out with any quality at all.. As with most things in our complex universe, it all depends upon what you are going to do.. You must sit down and evaluate your needs and probable work habits.. If you think you will benefit from PostScript's unique characteristics enough to justify the cost, then go for it.. Yes and no.. If you do not care about being.. DSC.. compliant, then all you have to do is to slap the two files together into one.. If that does not work, you could wrap each in a save/restore pair:.. %! save % contents of the first file restore save % contents of the second file restore.. The problem with this approach is that it is not compliant with the.. , so you can not do anything with the concatenated file.. Previewers and print spoolers will have problems recognizing pages and would not be able to shuffle them appropriately.. Other post-processing engines would fail to work with them too (for instance, you would not be able to display the file in.. two up.. format.. If the two PostScript files are.. compliant, came from the same tool, and use the same resources (the acid test is if they have the same preamble.. the definitions at the start of the file before you get to the first page), then you could concatenate the files by starting with the common preamble, followed by the pages of the first file, followed by the pages of the second file.. You would have to recognize the pages by looking at the page comments much like we did in the post-processing examples.. You can not play this trick with files from different tools (or with different preambles).. The problem is that a page in a file depends upon the definitions in the preamble, if you miss a definition, or if two files have different definitions for the same name, you really can not concatenate the files and keep the result compliant with the.. There are various scripts available out there to do the concatenation under these restrictions.. Look around for tools like psmerge, psconcat, and the like, and see what might work for you (psmerge is part of the psutils package and is available on many Unix work-alikes, and comes bundled with Mac OS X).. Yes.. comes with a utility called ps2pdf which will do the job.. Also, Mac OS X has the ability built-in: just double-click on the PostScript file in the Finder, and it will convert the file to.. for you and give you an option to save the results.. I m sure there are other tools to do the job, too.. Is it true that you are one of the most stunningly attractive men on the net?.. Why, yes.. How did you know?.. Okay, so maybe no one has ever asked me that.. It was worth a shot.. Maybe you wouldn't have noticed.. By the way, you finished reading the.. , so here's a mailto link for you to send me.. if you don't see your question here..

    Original link path: /postscript/faq.html
    Open archive

  • Title: Contacting Me
    Descriptive info: Contacting Me.. If you wish to contact me with a question, comment, or uncontrollable adulation, please feel free to e-mail me.. My address is.. pjw@tailrecursive.. org.. I recommend that you check the.. first, however, since I have listed answers for many of the common questions I've received.. I must also warn you not to expect a quick answer.. I do not check my e-mail with notable frequency, so it may  ...   graduate student at Indiana University in lovely Bloomington, Indiana.. While there, I learned to love the closure and learned to hate the PDP-8 (well, not really).. Currently, I am wasting my talents as a software developer for a certain large company in California you've all heard about and generally discovering to my horror that Dilbert is 100% accurate.. Still, as a compensation, I get to live on the Pacific Rim..

    Original link path: /postscript/contacting.html
    Open archive

  • Title: A First Guide to PostScript
    Descriptive info: Peter Weingartner.. 24 February, 2006..

    Original link path: /postscript/postscript.html
    Open archive

  • Title: PostScript Operators
    Descriptive info: PostScript Operators.. Operator: add.. num1.. num2.. add.. num3.. This operator returns the addition of the two arguments.. stackunderflow.. typecheck.. undefinedresult.. See also:.. div.. mul.. sub.. Operator: arc.. x-coord.. y-coord.. r.. ang1.. ang2.. arc.. -.. This operator adds an arc to the current path.. The arc is generated by sweeping a line segment of length.. , and tied at the point (.. ), in a counter-clockwise direction from an angle.. to an angle.. Note: a straight line segment will connect the current point to the first point of the arc, if they are not the same.. limitcheck.. Operator: begin.. dict.. begin.. This operator pushes the dictionary.. onto the dictionary stack.. Where it can be used for.. def.. and name lookup.. This operator allows an operator to set up a dictionary for its own use (e.. g.. for local variables).. Errors:.. dictstackoverflow.. invalidaccess.. Operator: bind.. procedure1.. bind.. procedure2.. The bind operator goes through.. and replaces any operator names with their associate operators.. Names which do not refer to operators are left alone.. Operators within.. which have unrestricted access will have bind called on themselves before they are inserted into the procedure.. The new procedure with operators instead of operator names is returned on the stack as.. The main effect and use of this operator is to reduce the amount of name lookup done by the interpreter.. This speeds up execution and ties down the behavior of operators.. Operator: clip.. clip.. This operator intersects the current clipping path with the current path and sets the current clipping path to the results.. Any part of a path drawn after calling this operator which extends outside this new clipping area will simply not be drawn.. If the given path is open, clip will treat it as if it were closed.. Also, clip does not destroy the current path when it is finished.. it may be used for other activities.. It is important to note that there is no easy way to restore the clip path to a larger size once it has been set.. The best way to set the clip path is to wrap it in a.. gsave.. and.. grestore.. pair.. Operator: closepath.. -.. closepath.. This operator adds a line segment to the current path from the current point to the first point in the path.. This closes the path so that it may be filled.. Errors:.. Also see the following operators:.. newpath.. moveto.. lineto.. Operator: charpath.. string.. bool.. charpath.. This operator takes the given string and appends the path which the characters define to the current path.. The result is can be used as any other path for stroking, filling, or clipping.. The boolean argument informs charpath what to do if the font was not designed to be stoked.. If the boolean is true, the path will be modified to be filled and clipped (but not stroked).. If the boolean is false, the path will be suitable to be stroked (but not filled or clipped).. nocurrentpoint.. fill.. show.. stroke.. Operator: colorimage.. width.. height.. bppc.. data_1.. data_n.. separate.. channels.. colorimage.. This operator draws a color image in the unit square from (0,0) to (1, 1).. The source information is a raster image.. pixels wide by.. pixels high.. The image is composed of.. color channels (1, 3, or 4), and each pixel is represented by.. bits in each channel.. If.. is false, there will be only one.. data.. operand.. Otherwise, there will be one for each channel.. The.. operand can be a number of things, but is usually a procedure that returns a string of bytes with the channel data each time it is called.. The procedure will be called repeatedly until all pixels have been processed.. The image is processed from left-to-right, top-to-bottom.. ioerror.. rangecheck.. undefined.. image.. Operator: curveto.. x1.. y1.. x2.. y2.. x3.. y3.. curveto.. This operator draws a curve from the current point to the point (.. ,.. ) using points (.. ) and (.. ) as control points.. The curve is a Bézier cubic curve.. In such a curve, the tangent of the curve at the current point will be a line segment running from the current point to (.. ) and the tangent at (.. ) is the line running from (.. ) to (.. Operator: def..  ...   both operands are integers and the product is not out of range.. If the product is too big, or one of the operands is a real, the result will be a real.. Operator: newpath.. The newpath operator clears out the current path and prepares the system to start a new current path.. This operator should be called before starting.. any.. new path, even though some operators call it implicitly.. Operator: pop.. pop -.. This operator just removes the top-most item off of the operand stack.. Operator: restore.. state.. restore.. This restores the total state of the PostScript system to the state saved in.. invalidrestore.. save.. Operator: rlineto.. dx.. dy.. The line is from the current point to a point found by adding.. to the current.. x.. y.. After line is added to the path, the current point is set to the new point.. Operator: rmoveto.. This operator moves the current point of the current path by adding.. Operator: rotate.. angle.. rotate.. This operator has the effect of rotating the user space counter-clockwise by.. degrees (negative angles rotate clockwise).. The rotation occurs around the current origin.. scale.. translate.. Operator: save.. This operator gathers up the complete state of the PostScript system and saves it in.. See Also:.. Operator: scale.. sx.. sy.. This operator has the effect of scaling the user coordinates.. All coordinates will be multiplied by.. in the horizontal direction, and.. in the vertical.. The origin will not be affected by this operation.. Operator: scalefont.. size.. This operator takes the given font and scales it by the given scale factor.. The resulting scaled font is pushed onto the stack.. A.. of one produces the same sized characters as the original font, 0.. 5 produces half-size characters, and so on.. Operator: setfont.. This operator sets the current font to be.. This font can be the result of any font creation or modification operator.. This font is used in all subsequent character operations like.. Also see:.. Operator: setcymkcolor.. cyan.. magenta.. yellow.. black.. setcymkcolor.. Sets the color of the ink to the color in the.. CYMK.. color space specified by.. , and.. The components must be between 0 (none) to 1 (full).. See also:.. setgray.. setrgbcolor.. Operator: setgray.. gray-value.. - This operator sets the current intensity of the ink to.. must be a number from 0 (black) to 1 (white).. This will affect all markings stroked or filled onto the page.. This applies even to path components created before the call to.. as long as they have not yet been stroked.. Operator: setlinewidth.. setlinewidth.. - This operator sets the width of all lines to be stroked to.. , which must be specified in points.. A line width of zero is possible and is interpreted to be a hairline, as thin as can be rendered on the given device.. Operator: setrgbcolor.. red.. green.. blue.. RGB.. Operator: show.. This operator draws the given string onto the page.. The current graphics state applies, so the current font, fontsize, gray value, and.. current transformation matrix.. all apply.. The location for the text is set by the current point.. The current point will specify the leftmost point of the baseline for the text.. Operator: showpage.. showpage.. This operator commits the current page to print and ejects the page from printing device.. also prepares a new blank page.. Operator: stroke.. This operator draws a line along the current path using the current settings.. This includes the current line thickness, current pen color, current dash pattern, current settings for how lines should be joined, and what kind of caps they should have.. These settings are the settings at the time the stroke operator is invoked.. A closed path consisting of two or more points at the same location is a degenerate path.. A degenerate path will be drawn only if you have set the line caps to round caps.. If your line caps are not round caps, or if the path is not closed, the path will not be drawn.. If the path is drawn, it will appear as a filled circle center at the point.. Operator: sub.. This operator returns the result of subtracting.. from.. Operator: translate.. This operator has the affect of moving the origin to the point (.. ) in the current user space..

    Original link path: /postscript/operators.html
    Open archive

  • Title: Errors You Might Encounter
    Descriptive info: Errors You Might Encounter.. configurationerror.. setpagedevice request can not be satisfied.. dictionary is full.. too many.. s.. dictstackundeflow.. access attribute violated (e.. attempted to write a read-only object).. bad font name or dictionary.. the saved state object is too old to.. some kind of error during input or output.. some implementation-dependent size restriction has been exceeded..  ...   too small.. the stack was full before the last push.. you tried to pop from an empty stack.. syntaxerror.. PostScript's syntax has been violated.. operand is of the wrong type.. name is not defined in any dictionary on the stack.. the result of the last numeric operation is invalid (.. e.. division by zero).. virtual memory full..

    Original link path: /postscript/errors.html
    Open archive

  • Title: PostScript Books
    Descriptive info: PostScript Books.. There are a number of good books on PostScript.. If you do much PostScript programming at all, I highly recommend that you get one of these print books.. PostScript Language Reference Manual: Third Edition.. This book is put out by Adobe Systems Incorporated and is published by Addison Wesley.. It is.. the.. reference manual and pretty much defines the language.. The operator reference guide I have here pretty well follows Adobe's reference in this manual.. Their reference is, however, far more detailed (and accurate).. This book is known as the Red and White Book.. Adobe also provides other books (including the Blue tutorial and cookbook).. PLRM.. 's ISBN is: 0-201-37922-8.. PostScript Language Tutorial and Cookbook.. This book is  ...   of routines to set text in a circle and a simple text formatter).. This is the so-called blue book.. The ISBN is 0-201-10179-3.. Learning PostScript: a Visual Approach.. This book is a fine beginning text for PostScript.. The book emphasizes PostScript's fantastic graphics abilities while illustrating basic language constructs.. The language concepts are illustrated with graphic design examples, most of which you will be tempted to use in your own documents.. The book also includes a number of interesting and useful utilities.. Author: Ross Smith.. Publisher: Peachpit Press.. ISBN 0-938-151-12-6.. I do not know if this book is still in print, but there are copies available on Amazon at the time I write this.. You can probably find it elsewhere, too..

    Original link path: /postscript/books.html
    Open archive

  • Title: What is PostScript?
    Descriptive info: What is PostScript?.. Next Page.. PostScript is a programming language optimized for printing graphics and text (whether on paper, film, or.. CRT.. is immaterial).. In the jargon of the day, it is a.. page description language.. It was introduced by Adobe in 1985 and first (to my knowledge) appeared in the Apple LaserWriter.. The main purpose of PostScript was to provide a convenient language in which to describe images in a device independent manner.. This device independence means that the image is described without reference to any specific device features (.. printer resolution) so that the same description could be used on any PostScript printer (say, a LaserWriter or a Linotron) without modification.. In practice, some PostScript files do make assumptions about the target device (such as its resolution or the number of paper trays it has), but this is bad practice  ...   of the stack.. As an example, let us say we want to multiply 12 and 134.. We would use the following PostScript code:.. 12 134 mul.. The first two words 12 and 134 push the numbers 12 and 134 onto the stack.. mul.. invokes the multiply operator which pops two values off the stack, multiplies them, and then pushes the result back onto the stack.. The resulting value can be left there to be used by another operator later in the program.. To follow the conventions used by Adobe in their manuals, I will synopsize operators using the following scheme:.. arg-1.. arg-2.. operator.. result.. This scheme means that, to use.. , you must push arguments.. , and so on before invoking the operator.. will return the result:.. Many operators return no result (they have some side-effect); these will be shown as returning..

    Original link path: /postscript/what-is-it.html
    Open archive

  • Title: Graphics Concepts
    Descriptive info: Graphics Concepts.. Previous Page.. There are a few concepts that you need to know about before we dive into the language itself.. These concepts are the concepts PostScript uses to describe and manipulate images on a page.. There are really only a few.. Device Space.. This is the coordinate space understood by the printer hardware.. This coordinate system is typically measured in terms of the device s resolution.. There is really nothing else that can be said about this space, as PostScript programs are typically not expressed using it.. User Space.. This is the coordinate system used by PostScript programs to describe the location of points and lines.. User space is essentially the same as the first quadrant of the standard coordinate system used in high school math classes.. Point (0, 0) is in the lower left corner.. Coordinates are real numbers, so there is no set resolution in user space.. The interpreter automatically converts user space coordinates to device space.. Current Transformation Matrix.. The transformation of user space coordinates to device space coordinates is done through the current transformation matrix.. This matrix is a three by three matrix that allows the user to rotate, scale, and translate the entire user space within the device  ...   with ink (.. ), or clip out all future images that are outside the path (.. Current Path.. This is the path that the PostScript program is creating at the moment.. The current path is assembled piece by piece.. Clipping Path.. The PostScript rendering system will ignore any part of a line segment, curve, or bitmap that extends outside a certain region; it will only draw the parts of those elements which are within the region.. The region is described by a path called the clipping path.. The clipping path is usually a rectangle about a quarter of an inch in from the edge of the page, but it can easily be set by the user to an arbitrary path.. Graphics State.. This is a collection of various settings that describe the current state of the graphics system.. Things like the current path, the current font, and the current transformation matrix make up the graphics state.. Often, a program will need to temporarily save a graphics state to be used later.. There are a couple of ways of doing this, but the easiest is to push the state onto a special graphics state stack and pop it back later.. This can be accomplished with the.. operators..

    Original link path: /postscript/graphics.html
    Open archive

  • Title: Language Concepts
    Descriptive info: Language Concepts.. As a programming language, PostScript is particularly simple.. There are really only a few concepts that need to be sketched out.. Comment.. A comment in PostScript is any text preceded by a %.. The special comment %! as the first two characters of a PostScript program is seen as a tag marking the file as PostScript code by many systems (including Unix s.. lpr.. command).. It is a good idea to start every PostScript document with a %!.. doing so will ensure that every spooler and printer the document may encounter will recognize it as PostScript code.. Stack.. There are several stacks in a PostScript system, but only two are important for this guide: the operand stack, and the dictionary stack.. The operand stack is where arguments to procedures (or operators, in PostScript jargon) are pushed prior to use.. The dictionary stack is for dictionaries, and it provides storage for variables.. Dictionary.. A dictionary is a collection of name-value pairs.. All named variables are stored in dictionaries.. Also, all available operators are stored in dictionaries along with their code.. The dictionary stack is a stack of all currently open dictionaries.. When a program refers to some key, the interpreter wanders down the stack looking for the first instance of that key in a dictionary.. In this manner, names may be associated with variables and a simple form of scoping is implemented.. Conveniently, dictionaries may be given names and be stored in other dictionaries.. Name.. A name is any sequence of characters that can not be interpreted as a number.. With the exception of spaces and certain reserved characters (the characters ( , ) , [ , ] ,  ...   has no slash, the interpreter will look up its value in the dictionary stack.. If the value is a procedure object, the procedure will be evaluated.. If the value is not a procedure, the value will be pushed onto the operand stack.. Number.. PostScript supports integers and reals.. You can express numbers in two forms: radix form, and scientific notation.. Radix form is a number of the form.. radix.. #.. specifies the base for.. Scientific notation is the standard.. mantissa.. E.. exponent.. form used in most languages.. String.. Strings are, of course, just strings of characters.. There are two ways of expressing strings in Level 1 PostScript.. The most common way is to wrap your text in parentheses.. For example the string This is a string would be written as.. (This is a string).. You can also express a string as hexadecimal codes in angle brackets.. For example, the string ABC would be expressed as.. 414243.. There are several.. escape codes.. that may be used in the parenthesis format of strings.. Array.. Arrays in PostScript are like arrays in any other language.. Arrays may contain objects of different type, and they are written as a list of objects surrounded by brackets.. For instance,.. [12 /Foo 5].. is a three element array containing the number 12, the name Foo, and the number 5.. Procedure.. A procedure is your way of defining new operators.. A procedure is an array that is executable and is written with braces rather than brackets.. For example, a procedure to square the top element on the stack might be written as:.. {.. mul}.. We can define this procedure to be the square operator with:.. /square {dup mul}..

    Original link path: /postscript/language.html
    Open archive

  • Archived pages: 40