Thinking in PostScript

Free Download

Authors:

ISBN: 0201523728, 9780201523720

Size: 827 kB (846435 bytes)

Pages: 239/239

File format:

Language:

Publishing Year:

Category:

Glenn C. Reid0201523728, 9780201523720

This hands-on guide shows readers how to “think” in PostScript, providing both new and experienced PostScript programmers with ideas and techniques to better manipulate and optimize PostScript functions and features.

Table of contents :
Preface……Page 13
PostScript as a Programming Language……Page 17
DESIGN FEATURES……Page 18
STRUCTURED PROGRAMMING TECHNIQUES……Page 19
WINDOW SYSTEMS, COMMUNICATIONS, AND DISPLAYS……Page 20
CONCLUDING THOUGHTS……Page 22
PostScript is Not Like C……Page 25
TIP A PostScript procedure is simply a set of oper………Page 27
EXPRESSING AN ALGORITHM AS A PROGRAM……Page 28
TIP Here’s a trick that you may find very helpful ………Page 29
INPUT, OUTPUT, AND THROUGHPUT……Page 30
CONCLUDING THOUGHTS……Page 31
Foundations……Page 33
POSTSCRIPT LANGUAGE SYNTAX……Page 35
SIMPLE PROGRAM STRUCTURE……Page 36
Make Definitions First……Page 37
Indentation Style……Page 38
SETTING UP TEMPLATES……Page 40
DECLARING AND USING VARIABLES……Page 42
Arithmetic with Numeric Variables……Page 43
Using the // Notation for Constants……Page 44
ALLOCATING MEMORY……Page 45
Arguments Operator Action……Page 46
OPENING AND CLOSING FILES……Page 47
COMPARISONS AND EQUALITY OF OBJECTS……Page 48
CONCLUDING THOUGHTS……Page 50
Some Typical Programs……Page 53
A TYPICAL PAGE DESCRIPTION PROGRAM……Page 54
FONT PROGRAMS……Page 56
PROGRAMS THAT READ DATA……Page 58
ENCAPSULATED POSTSCRIPT PROGRAMS……Page 59
PERSISTENTLY RESIDENT PROGRAMS……Page 62
TIP The exitserver operator is not a standard part………Page 64
CONCLUDING THOUGHTS……Page 65
A QUICK OVERVIEW OF DATA TYPES……Page 67
HOW OPERATORS USE THE STACK……Page 69
TIP When you define a variable in your PostScript ………Page 70
GROUPING AND VISUAL CHUNKING……Page 72
THINKING BACKWARD AND SIDEWAYS……Page 74
TIP When reading a PostScript program, find the ex………Page 76
COMPOSITE OBJECTS……Page 77
THE OTHER STACKS……Page 78
CONCLUDING THOUGHTS……Page 79
Trusting the Stack……Page 83
SAFETY OF DATA ON THE STACK……Page 84
WHERE ARE THE DATA GOING?……Page 85
Using the dup and index Operators……Page 87
Using the roll Operator……Page 88
CONDITIONALS AND LOOPS……Page 89
RECURSION AND LOCAL VARIABLES……Page 92
CONCLUDING THOUGHTS……Page 93
Building Conditional Statements……Page 95
SIMPLE CONDITIONALS……Page 96
SETTING UP THE CONDITION……Page 97
Arguments Operator Action……Page 98
TIP It is important to test both the true and fals………Page 101
CONDITIONALS ARE NOT MAGIC……Page 102
NESTED CONDITIONALS AND ELSE CLAUSES……Page 103
COMPOUND CONDITIONALS……Page 104
CONCLUDING THOUGHTS……Page 106
Using Looping Constructs……Page 109
Arguments Operator Action……Page 110
USING THE LOOP INDEX……Page 111
Operator Data Pushed onto Operand Stack for Each I………Page 114
LOOPS ARE PROCEDURE BODIES……Page 115
LOOPS OF INSTRUCTIONS……Page 117
EXITING LOOPS PREMATURELY……Page 118
CONCLUDING THOUGHTS……Page 119
Procedures……Page 121
WHAT EXACTLY IS A PROCEDURE?……Page 122
PARAMETER PASSING……Page 124
TIP A good rule of thumb is that if the operators ………Page 126
What to Name Your Procedure……Page 127
A Useful Naming Convention……Page 129
SELF-MODIFYING PROCEDURES……Page 130
CONCLUDING THOUGHTS……Page 132
Using Dictionaries……Page 135
DICTIONARIES FOR NAME SCOPING……Page 136
LOCAL DICTIONARIES……Page 137
TIP Most PostScript drivers and any program with m………Page 139
MAINTAINING THE DICTIONARY STACK……Page 140
INTO AND OUT OF DICTIONARIES……Page 142
Using the forall Operator……Page 143
Using the where and known Operators……Page 145
Changing the Behavior of Operators……Page 146
Debugging with Redefined Names……Page 147
CONCLUDING THOUGHTS……Page 148
CONSTRUCTING AN ARRAY……Page 151
MANIPULATING DATA WITH PUT AND GET……Page 153
Arguments Operator Action……Page 154
CONCATENATING ARRAYS AND STRINGS……Page 155
INPUT AND OUTPUT OF STRING DATA……Page 156
ARRAYS VERSUS DICTIONARIES……Page 157
ADVANCED TECHNIQUES……Page 158
CONCLUDING THOUGHTS……Page 159
Storing and Using Data……Page 161
Data and the Operand Stack……Page 162
Data and Algorithms for Underlining……Page 163
Linked Lists……Page 167
Using Arrays to Form Lists……Page 168
Using Dictionaries to Form Lists……Page 170
Queues, Trees, and Other Data Structures……Page 171
CONCLUDING THOUGHTS……Page 172
Program Data and Instructions……Page 173
TURNING DATA INTO INSTRUCTIONS……Page 175
TURNING INSTRUCTIONS INTO DATA……Page 177
DATA CONVERSIONS……Page 179
CONCLUDING THOUGHTS……Page 181
File Objects……Page 183
PostScript File Operators……Page 184
Arguments Operator Action……Page 185
OPENING AND CLOSING FILES……Page 186
Mode Explanation……Page 187
Writing to a File……Page 188
Copying and Renaming Files……Page 190
Writing Out Various Data Types……Page 191
Spaces, Tabs, Returns, and Special Characters……Page 193
FILE STATUS INFORMATION……Page 194
RANDOM VERSUS SEQUENTIAL ACCESS……Page 195
CONCLUDING THOUGHTS……Page 196
Answers to Exercises……Page 201

Reviews

There are no reviews yet.

Be the first to review “Thinking in PostScript”
Shopping Cart
Scroll to Top