diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index d70ab2d..ef46a75 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -43,13 +43,17 @@ jobs: - name: Build with Jekyll # Outputs to the './_site' directory by default - run: JEKYLL_LOG_LEVEL=debug bundle exec jekyll build --verbose --trace --baseurl "${{ steps.pages.outputs.base_path }}" + run: bundle exec jekyll build --verbose --trace --baseurl "${{ steps.pages.outputs.base_path }}" + working-directory: docs env: JEKYLL_ENV: production + JEKYLL_LOG_LEVEL: debug - name: Upload artifact # Automatically uploads an artifact from the './_site' directory by default uses: actions/upload-pages-artifact@v4 + with: + path: docs/_site # Deployment job deploy: diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 97938d1..fce4a38 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -21,6 +21,7 @@ jobs: env: JEKYLL_ENV: production run: bundle exec jekyll build --trace + working-directory: docs - name: Restore lychee cache uses: actions/cache@v4 @@ -37,6 +38,7 @@ jobs: fi echo "Site built successfully" ls -la _site/ + working-directory: docs - name: Link Checker (Built Site) uses: lycheeverse/lychee-action@v2 @@ -53,6 +55,7 @@ jobs: fail: true output: link-check-results.md format: markdown + workingDirectory: docs - name: Upload link check results if: always() @@ -60,7 +63,7 @@ jobs: with: name: link-check-results path: | - link-check-results.md + docs/link-check-results.md retention-days: 30 - name: Comment PR with results @@ -71,8 +74,8 @@ jobs: const fs = require('fs'); let comment = '## 🔗 Link Check Failed\n\n'; - if (fs.existsSync('link-check-results.md')) { - const results = fs.readFileSync('link-check-results.md', 'utf8'); + if (fs.existsSync('docs/link-check-results.md')) { + const results = fs.readFileSync('docs/link-check-results.md', 'utf8'); comment += '### Built Site Results\n\n' + results + '\n\n'; } diff --git a/.lycheeignore b/.lycheeignore index 798141f..f169bfd 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -57,4 +57,4 @@ https://schema.org/ # Internal files file:///home/runner/work/postscript-guide/postscript-guide/LICENSE -file:///home/runner/work/postscript-guide/postscript-guide/docs/LINK_CHECKING.md +file:///home/runner/work/postscript-guide/postscript-guide/LINK_CHECKING.md diff --git a/_config.yml b/docs/_config.yml similarity index 94% rename from _config.yml rename to docs/_config.yml index 00a021b..96e5a46 100644 --- a/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -title: "PostScript Language Guide" +title: "Claricle PostScript Language Guide" description: "Comprehensive documentation for the PostScript programming language, covering operators, syntax, and practical usage examples" # baseurl: "/postscript-guide" url: "https://claricle.github.io" @@ -11,8 +11,8 @@ theme: just-the-docs color_scheme: light # Logo and favicon -logo: "/docs/assets/images/logo.svg" -favicon_ico: "/docs/assets/images/favicon.ico" +logo: "/assets/images/logo.svg" +favicon_ico: "/assets/images/favicon.ico" # AsciiDoc support asciidoc: {} @@ -120,4 +120,4 @@ exclude: # - levels permalink: pretty -includes_dir: 'docs' +# includes_dir: 'docs' diff --git a/docs/commands/arithmetic-math/index.adoc b/docs/commands/arithmetic-math/index.adoc index a6c5407..d4f6178 100644 --- a/docs/commands/arithmetic-math/index.adoc +++ b/docs/commands/arithmetic-math/index.adoc @@ -17,54 +17,54 @@ PostScript provides a comprehensive set of arithmetic and mathematical operators The fundamental arithmetic operations: -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers -* link:/docs/commands/references/div/[`div`] - Divide (real result) -* link:/docs/commands/references/idiv/[`idiv`] - Integer division -* link:/docs/commands/references/mod/[`mod`] - Modulo (remainder) +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/div/[`div`] - Divide (real result) +* link:/commands/references/idiv/[`idiv`] - Integer division +* link:/commands/references/mod/[`mod`] - Modulo (remainder) ==== Unary Operations Operations on a single number: -* link:/docs/commands/references/abs/[`abs`] - Absolute value -* link:/docs/commands/references/neg/[`neg`] - Negate -* link:/docs/commands/references/ceiling/[`ceiling`] - Round up to integer -* link:/docs/commands/references/floor/[`floor`] - Round down to integer -* link:/docs/commands/references/round/[`round`] - Round to nearest integer -* link:/docs/commands/references/truncate/[`truncate`] - Truncate to integer +* link:/commands/references/abs/[`abs`] - Absolute value +* link:/commands/references/neg/[`neg`] - Negate +* link:/commands/references/ceiling/[`ceiling`] - Round up to integer +* link:/commands/references/floor/[`floor`] - Round down to integer +* link:/commands/references/round/[`round`] - Round to nearest integer +* link:/commands/references/truncate/[`truncate`] - Truncate to integer ==== Exponential and Logarithmic Power and logarithm functions: -* link:/docs/commands/references/sqrt/[`sqrt`] - Square root -* link:/docs/commands/references/exp/[`exp`] - Exponential (base^exponent) -* link:/docs/commands/references/ln/[`ln`] - Natural logarithm (base e) -* link:/docs/commands/references/log/[`log`] - Common logarithm (base 10) +* link:/commands/references/sqrt/[`sqrt`] - Square root +* link:/commands/references/exp/[`exp`] - Exponential (base^exponent) +* link:/commands/references/ln/[`ln`] - Natural logarithm (base e) +* link:/commands/references/log/[`log`] - Common logarithm (base 10) ==== Trigonometric Trigonometric functions (angles in degrees): -* link:/docs/commands/references/sin/[`sin`] - Sine -* link:/docs/commands/references/cos/[`cos`] - Cosine -* link:/docs/commands/references/atan/[`atan`] - Arctangent +* link:/commands/references/sin/[`sin`] - Sine +* link:/commands/references/cos/[`cos`] - Cosine +* link:/commands/references/atan/[`atan`] - Arctangent ==== Bitwise Operations Operations on integer bit patterns: -* link:/docs/commands/references/bitshift/[`bitshift`] - Bitwise shift left or right +* link:/commands/references/bitshift/[`bitshift`] - Bitwise shift left or right ==== Random Numbers Pseudo-random number generation: -* link:/docs/commands/references/rand/[`rand`] - Generate random integer -* link:/docs/commands/references/srand/[`srand`] - Seed random generator -* link:/docs/commands/references/rrand/[`rrand`] - Get/set random seed +* link:/commands/references/rand/[`rand`] - Generate random integer +* link:/commands/references/srand/[`srand`] - Seed random generator +* link:/commands/references/rrand/[`rrand`] - Get/set random seed === Type Coercion Rules @@ -186,5 +186,5 @@ Real numbers have finite precision. Avoid comparing reals for exact equality: === See Also -* link:/docs/levels/[PostScript Language Levels] -* link:/docs/commands/references/[Stack Manipulation] \ No newline at end of file +* link:/levels/[PostScript Language Levels] +* link:/commands/references/[Stack Manipulation] \ No newline at end of file diff --git a/docs/commands/array-string/index.adoc b/docs/commands/array-string/index.adoc index fc9130e..18ee6e7 100644 --- a/docs/commands/array-string/index.adoc +++ b/docs/commands/array-string/index.adoc @@ -14,10 +14,10 @@ Array and string operations provide the foundation for data structure manipulati Arrays and strings in PostScript share many operational characteristics: * Both are indexed collections (0-based indexing) -* Both support element access via link:/docs/commands/references/get/[`get`] and link:/docs/commands/references/put/[`put`] -* Both can have subsequences extracted via link:/docs/commands/references/getinterval/[`getinterval`] -* Both can be iterated over using link:/docs/commands/references/forall/[`forall`] -* Both have a link:/docs/commands/references/length/[`length`] that can be queried +* Both support element access via link:/commands/references/get/[`get`] and link:/commands/references/put/[`put`] +* Both can have subsequences extracted via link:/commands/references/getinterval/[`getinterval`] +* Both can be iterated over using link:/commands/references/forall/[`forall`] +* Both have a link:/commands/references/length/[`length`] that can be queried However, they differ in important ways: @@ -33,22 +33,22 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/array/[`array`] +| link:/commands/references/array/[`array`] | Create a new array of specified length -| link:/docs/commands/references/brackets/[`[`] +| link:/commands/references/brackets/[`[`] | Begin array construction (mark) -| link:/docs/commands/references/brackets/[`]`] +| link:/commands/references/brackets/[`]`] | End array construction -| link:/docs/commands/references/aload/[`aload`] +| link:/commands/references/aload/[`aload`] | Load all array elements onto stack -| link:/docs/commands/references/astore/[`astore`] +| link:/commands/references/astore/[`astore`] | Store stack elements into array -| link:/docs/commands/references/packedarray/[`packedarray`] +| link:/commands/references/packedarray/[`packedarray`] | Create read-only packed array (Level 2) |=== @@ -58,19 +58,19 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/get/[`get`] +| link:/commands/references/get/[`get`] | Get single element from array/string -| link:/docs/commands/references/put/[`put`] +| link:/commands/references/put/[`put`] | Put value into array/string element -| link:/docs/commands/references/getinterval/[`getinterval`] +| link:/commands/references/getinterval/[`getinterval`] | Extract subarray or substring -| link:/docs/commands/references/putinterval/[`putinterval`] +| link:/commands/references/putinterval/[`putinterval`] | Insert array/string into another -| link:/docs/commands/references/length/[`length`] +| link:/commands/references/length/[`length`] | Get length of array/string |=== @@ -80,7 +80,7 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Execute procedure for each element |=== @@ -92,16 +92,16 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/string/[`string`] +| link:/commands/references/string/[`string`] | Create new string of specified length -| link:/docs/commands/references/anchorsearch/[`anchorsearch`] +| link:/commands/references/anchorsearch/[`anchorsearch`] | Search for prefix in string -| link:/docs/commands/references/search/[`search`] +| link:/commands/references/search/[`search`] | Search for substring -| link:/docs/commands/references/token/[`token`] +| link:/commands/references/token/[`token`] | Parse next token from string/file |=== @@ -111,25 +111,25 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/cvs/[`cvs`] +| link:/commands/references/cvs/[`cvs`] | Convert any object to string representation -| link:/docs/commands/references/cvn/[`cvn`] +| link:/commands/references/cvn/[`cvn`] | Convert string to name -| link:/docs/commands/references/cvr/[`cvr`] +| link:/commands/references/cvr/[`cvr`] | Convert to real number -| link:/docs/commands/references/cvi/[`cvi`] +| link:/commands/references/cvi/[`cvi`] | Convert to integer -| link:/docs/commands/references/cvlit/[`cvlit`] +| link:/commands/references/cvlit/[`cvlit`] | Convert to literal attribute -| link:/docs/commands/references/cvx/[`cvx`] +| link:/commands/references/cvx/[`cvx`] | Convert to executable attribute -| link:/docs/commands/references/type/[`type`] +| link:/commands/references/type/[`type`] | Get object type as name |=== @@ -139,13 +139,13 @@ However, they differ in important ways: |=== | Command | Description -| link:/docs/commands/references/xcheck/[`xcheck`] +| link:/commands/references/xcheck/[`xcheck`] | Check if object is executable -| link:/docs/commands/references/rcheck/[`rcheck`] +| link:/commands/references/rcheck/[`rcheck`] | Check if object is readable -| link:/docs/commands/references/wcheck/[`wcheck`] +| link:/commands/references/wcheck/[`wcheck`] | Check if object is writable |=== @@ -220,6 +220,6 @@ Process all elements in a collection: == See Also -* link:/docs/commands/references/[Stack Manipulation Commands] - For basic data movement -* link:/docs/commands/references/[Arithmetic and Math Commands] - For numeric operations +* link:/commands/references/[Stack Manipulation Commands] - For basic data movement +* link:/commands/references/[Arithmetic and Math Commands] - For numeric operations * Control Flow Commands - For conditional and loop constructs (to be documented) \ No newline at end of file diff --git a/docs/commands/by-category.adoc b/docs/commands/by-category.adoc index ddf483e..c4e962a 100644 --- a/docs/commands/by-category.adoc +++ b/docs/commands/by-category.adoc @@ -11,28 +11,28 @@ All PostScript operators organized by functional category. === Stack Manipulation -link:/docs/commands/references/[View all stack commands →] +link:/commands/references/[View all stack commands →] === Arithmetic and Math -link:/docs/commands/references/[View all math commands →] +link:/commands/references/[View all math commands →] === Array and String Operations -link:/docs/commands/references/[View all array/string commands →] +link:/commands/references/[View all array/string commands →] === Dictionary Operations -link:/docs/commands/references/[View all dictionary commands →] +link:/commands/references/[View all dictionary commands →] === Control Flow -link:/docs/commands/references/[View all control flow commands →] +link:/commands/references/[View all control flow commands →] === Graphics State -link:/docs/commands/references/[View all graphics state commands →] +link:/commands/references/[View all graphics state commands →] === See Also -* link:/docs/commands/[Alphabetical Index] \ No newline at end of file +* link:/commands/[Alphabetical Index] \ No newline at end of file diff --git a/docs/commands/color/index.adoc b/docs/commands/color/index.adoc index 51de74a..a196907 100644 --- a/docs/commands/color/index.adoc +++ b/docs/commands/color/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for color. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/control-flow/index.adoc b/docs/commands/control-flow/index.adoc index 3880379..62ea65a 100644 --- a/docs/commands/control-flow/index.adoc +++ b/docs/commands/control-flow/index.adoc @@ -26,10 +26,10 @@ PostScript control flow operates through: |=== | Command | Description -| link:/docs/commands/references/if/[`if`] +| link:/commands/references/if/[`if`] | Execute procedure if condition is true -| link:/docs/commands/references/ifelse/[`ifelse`] +| link:/commands/references/ifelse/[`ifelse`] | Execute one of two procedures based on condition |=== @@ -39,16 +39,16 @@ PostScript control flow operates through: |=== | Command | Description -| link:/docs/commands/references/for/[`for`] +| link:/commands/references/for/[`for`] | Loop with numeric control variable -| link:/docs/commands/references/repeat/[`repeat`] +| link:/commands/references/repeat/[`repeat`] | Execute procedure a fixed number of times -| link:/docs/commands/references/loop/[`loop`] +| link:/commands/references/loop/[`loop`] | Execute procedure indefinitely until exit -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Iterate over array, string, or dictionary elements |=== @@ -58,16 +58,16 @@ PostScript control flow operates through: |=== | Command | Description -| link:/docs/commands/references/exit/[`exit`] +| link:/commands/references/exit/[`exit`] | Terminate innermost loop early -| link:/docs/commands/references/stop/[`stop`] +| link:/commands/references/stop/[`stop`] | Terminate stopped context -| link:/docs/commands/references/stopped/[`stopped`] +| link:/commands/references/stopped/[`stopped`] | Execute object with error catching -| link:/docs/commands/references/quit/[`quit`] +| link:/commands/references/quit/[`quit`] | Terminate interpreter |=== @@ -77,10 +77,10 @@ PostScript control flow operates through: |=== | Command | Description -| link:/docs/commands/references/exec/[`exec`] +| link:/commands/references/exec/[`exec`] | Execute an object -| link:/docs/commands/references/cvx/[`cvx`] +| link:/commands/references/cvx/[`cvx`] | Convert to executable attribute |=== @@ -154,19 +154,19 @@ x 0 gt { |=== | Loop Type | Use When | Control Variable -| link:/docs/commands/references/for/[`for`] +| link:/commands/references/for/[`for`] | Numeric sequence needed | Yes -| link:/docs/commands/references/repeat/[`repeat`] +| link:/commands/references/repeat/[`repeat`] | Simple fixed repetition | No -| link:/docs/commands/references/loop/[`loop`] +| link:/commands/references/loop/[`loop`] | Indefinite looping | No -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Iterating collections | Yes (element) |=== @@ -195,9 +195,9 @@ Control flow operators require procedures (executable arrays): === Loop Termination -* link:/docs/commands/references/exit/[`exit`] exits innermost loop only -* link:/docs/commands/references/stop/[`stop`] exits stopped context -* Infinite loops possible with link:/docs/commands/references/loop/[`loop`] +* link:/commands/references/exit/[`exit`] exits innermost loop only +* link:/commands/references/stop/[`stop`] exits stopped context +* Infinite loops possible with link:/commands/references/loop/[`loop`] === Stack Effects @@ -221,6 +221,6 @@ TIP: *Use exit Carefully* - Only works within loop contexts (for, repeat, loop, == See Also -* link:/docs/commands/references/[Dictionary Operations] - For scoping with begin/end -* link:/docs/commands/references/array-string/[Array Operations] - For forall iteration +* link:/commands/references/[Dictionary Operations] - For scoping with begin/end +* link:/commands/array-string/[Array Operations] - For forall iteration * Error Handling (to be documented) - For comprehensive error management \ No newline at end of file diff --git a/docs/commands/device-output/index.adoc b/docs/commands/device-output/index.adoc index 9f46395..fceb713 100644 --- a/docs/commands/device-output/index.adoc +++ b/docs/commands/device-output/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for device output. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/dictionary/index.adoc b/docs/commands/dictionary/index.adoc index 1dab279..934e288 100644 --- a/docs/commands/dictionary/index.adoc +++ b/docs/commands/dictionary/index.adoc @@ -25,7 +25,7 @@ PostScript maintains a dictionary stack that controls name lookup: * Top dictionary is searched first (current dictionary) * Search proceeds down the stack until name is found * Standard dictionaries: `systemdict`, `globaldict` (Level 2), `userdict` -* User dictionaries can be pushed/popped with link:/docs/commands/references/begin/[`begin`] / link:/docs/commands/references/end/[`end`] +* User dictionaries can be pushed/popped with link:/commands/references/begin/[`begin`] / link:/commands/references/end/[`end`] == Command Categories @@ -35,7 +35,7 @@ PostScript maintains a dictionary stack that controls name lookup: |=== | Command | Description -| link:/docs/commands/references/dict/[`dict`] +| link:/commands/references/dict/[`dict`] | Create new dictionary with initial capacity |=== @@ -45,19 +45,19 @@ PostScript maintains a dictionary stack that controls name lookup: |=== | Command | Description -| link:/docs/commands/references/begin/[`begin`] +| link:/commands/references/begin/[`begin`] | Push dictionary onto dictionary stack -| link:/docs/commands/references/end/[`end`] +| link:/commands/references/end/[`end`] | Pop dictionary from dictionary stack -| link:/docs/commands/references/currentdict/[`currentdict`] +| link:/commands/references/currentdict/[`currentdict`] | Get current dictionary (top of stack) -| link:/docs/commands/references/countdictstack/[`countdictstack`] +| link:/commands/references/countdictstack/[`countdictstack`] | Count dictionaries on stack -| link:/docs/commands/references/dictstack/[`dictstack`] +| link:/commands/references/dictstack/[`dictstack`] | Copy dictionary stack to array |=== @@ -67,22 +67,22 @@ PostScript maintains a dictionary stack that controls name lookup: |=== | Command | Description -| link:/docs/commands/references/def/[`def`] +| link:/commands/references/def/[`def`] | Define key-value pair in current dictionary -| link:/docs/commands/references/load/[`load`] +| link:/commands/references/load/[`load`] | Look up and return value from dictionary stack -| link:/docs/commands/references/store/[`store`] +| link:/commands/references/store/[`store`] | Store value in dictionary stack (create if needed) -| link:/docs/commands/references/known/[`known`] +| link:/commands/references/known/[`known`] | Check if key exists in specific dictionary -| link:/docs/commands/references/where/[`where`] +| link:/commands/references/where/[`where`] | Find which dictionary contains key -| link:/docs/commands/references/undef/[`undef`] +| link:/commands/references/undef/[`undef`] | Remove key from dictionary (Level 2) |=== @@ -92,19 +92,19 @@ PostScript maintains a dictionary stack that controls name lookup: |=== | Command | Description -| link:/docs/commands/references/maxlength/[`maxlength`] +| link:/commands/references/maxlength/[`maxlength`] | Get maximum capacity -| link:/docs/commands/references/length/[`length`] +| link:/commands/references/length/[`length`] | Get current number of entries -| link:/docs/commands/references/get/[`get`] +| link:/commands/references/get/[`get`] | Get value for specific key -| link:/docs/commands/references/put/[`put`] +| link:/commands/references/put/[`put`] | Put key-value pair -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Iterate over all key-value pairs |=== @@ -194,7 +194,7 @@ The standard dictionary stack (bottom to top): == Common Pitfalls -WARNING: *Dictionary Stack Balance* - Every link:/docs/commands/references/begin/[`begin`] must have matching link:/docs/commands/references/end/[`end`]. Unbalanced stacks cause [`dictstackunderflow`] or [`dictstackoverflow`]. +WARNING: *Dictionary Stack Balance* - Every link:/commands/references/begin/[`begin`] must have matching link:/commands/references/end/[`end`]. Unbalanced stacks cause [`dictstackunderflow`] or [`dictstackoverflow`]. WARNING: *Fixed Capacity (Level 1)* - In Level 1, exceeding dictionary capacity causes [`dictfull`] error. Always allocate sufficient space. @@ -212,6 +212,6 @@ end == See Also -* link:/docs/commands/references/[Stack Manipulation] - For general stack operations -* link:/docs/commands/references/[Array and String Operations] - Similar composite types +* link:/commands/references/[Stack Manipulation] - For general stack operations +* link:/commands/references/[Array and String Operations] - Similar composite types * Control Flow (to be documented) - Scoping with dictionaries \ No newline at end of file diff --git a/docs/commands/error-handling/index.adoc b/docs/commands/error-handling/index.adoc index 0449439..3ccae05 100644 --- a/docs/commands/error-handling/index.adoc +++ b/docs/commands/error-handling/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for error handling. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/file-io/index.adoc b/docs/commands/file-io/index.adoc index daac4fc..2b0a169 100644 --- a/docs/commands/file-io/index.adoc +++ b/docs/commands/file-io/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for file io. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/font-text/index.adoc b/docs/commands/font-text/index.adoc index 917432a..43abadb 100644 --- a/docs/commands/font-text/index.adoc +++ b/docs/commands/font-text/index.adoc @@ -21,25 +21,25 @@ PostScript provides comprehensive font and text capabilities including font sele |=== | Command | Description -| link:/docs/commands/references/findfont/[`findfont`] +| link:/commands/references/findfont/[`findfont`] | Obtain font dictionary by name -| link:/docs/commands/references/scalefont/[`scalefont`] +| link:/commands/references/scalefont/[`scalefont`] | Scale font uniformly -| link:/docs/commands/references/makefont/[`makefont`] +| link:/commands/references/makefont/[`makefont`] | Transform font by matrix -| link:/docs/commands/references/setfont/[`setfont`] +| link:/commands/references/setfont/[`setfont`] | Establish current font -| link:/docs/commands/references/currentfont/[`currentfont`] +| link:/commands/references/currentfont/[`currentfont`] | Get current font -| link:/docs/commands/references/definefont/[`definefont`] +| link:/commands/references/definefont/[`definefont`] | Register font -| link:/docs/commands/references/undefinefont/[`undefinefont`] +| link:/commands/references/undefinefont/[`undefinefont`] | Remove font (Level 2) |=== @@ -49,22 +49,22 @@ PostScript provides comprehensive font and text capabilities including font sele |=== | Command | Description -| link:/docs/commands/references/show/[`show`] +| link:/commands/references/show/[`show`] | Paint text string -| link:/docs/commands/references/ashow/[`ashow`] +| link:/commands/references/ashow/[`ashow`] | Show with spacing adjustment -| link:/docs/commands/references/widthshow/[`widthshow`] +| link:/commands/references/widthshow/[`widthshow`] | Show with selective width adjustment -| link:/docs/commands/references/awidthshow/[`awidthshow`] +| link:/commands/references/awidthshow/[`awidthshow`] | Combined spacing adjustment -| link:/docs/commands/references/kshow/[`kshow`] +| link:/commands/references/kshow/[`kshow`] | Show with kerning -| link:/docs/commands/references/cshow/[`cshow`] +| link:/commands/references/cshow/[`cshow`] | Show with per-character control (Level 2) |=== @@ -74,14 +74,14 @@ PostScript provides comprehensive font and text capabilities including font sele |=== | Command | Description -| link:/docs/commands/references/stringwidth/[`stringwidth`] +| link:/commands/references/stringwidth/[`stringwidth`] | Calculate text width -| link:/docs/commands/references/charpath/[`charpath`] +| link:/commands/references/charpath/[`charpath`] | Get character outlines |=== == See Also -* link:/docs/usage/advanced/fonts-text/[Font & Text Guide] -* link:/docs/commands/references/[Graphics State] +* link:/usage/advanced/fonts-text/[Font & Text Guide] +* link:/commands/references/[Graphics State] diff --git a/docs/commands/graphics-state/index.adoc b/docs/commands/graphics-state/index.adoc index 8be0e09..ee0f448 100644 --- a/docs/commands/graphics-state/index.adoc +++ b/docs/commands/graphics-state/index.adoc @@ -26,8 +26,8 @@ Each parameter has a current value that affects subsequent graphics operations. PostScript provides a stack for saving and restoring graphics state: -* link:/docs/commands/references/gsave/[`gsave`] saves current state -* link:/docs/commands/references/grestore/[`grestore`] restores saved state +* link:/commands/references/gsave/[`gsave`] saves current state +* link:/commands/references/grestore/[`grestore`] restores saved state * State changes are isolated between save/restore pairs * Enables temporary modifications without losing previous state @@ -39,22 +39,22 @@ PostScript provides a stack for saving and restoring graphics state: |=== | Command | Description -| link:/docs/commands/references/gsave/[`gsave`] +| link:/commands/references/gsave/[`gsave`] | Push copy of graphics state onto graphics state stack -| link:/docs/commands/references/grestore/[`grestore`] +| link:/commands/references/grestore/[`grestore`] | Restore graphics state from top of stack -| link:/docs/commands/references/grestoreall/[`grestoreall`] +| link:/commands/references/grestoreall/[`grestoreall`] | Restore to bottommost save level -| link:/docs/commands/references/gstate/[`gstate`] +| link:/commands/references/gstate/[`gstate`] | Create gstate object (Level 2) -| link:/docs/commands/references/setgstate/[`setgstate`] +| link:/commands/references/setgstate/[`setgstate`] | Set graphics state from gstate object (Level 2) -| link:/docs/commands/references/currentgstate/[`currentgstate`] +| link:/commands/references/currentgstate/[`currentgstate`] | Copy current state to gstate object (Level 2) |=== @@ -64,34 +64,34 @@ PostScript provides a stack for saving and restoring graphics state: |=== | Command | Description -| link:/docs/commands/references/setlinewidth/[`setlinewidth`] +| link:/commands/references/setlinewidth/[`setlinewidth`] | Set line width for stroking -| link:/docs/commands/references/setlinecap/[`setlinecap`] +| link:/commands/references/setlinecap/[`setlinecap`] | Set line cap style (butt, round, square) -| link:/docs/commands/references/setlinejoin/[`setlinejoin`] +| link:/commands/references/setlinejoin/[`setlinejoin`] | Set line join style (miter, round, bevel) -| link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] +| link:/commands/references/setmiterlimit/[`setmiterlimit`] | Set miter limit for sharp corners -| link:/docs/commands/references/setdash/[`setdash`] +| link:/commands/references/setdash/[`setdash`] | Set dash pattern for lines -| link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] +| link:/commands/references/currentlinewidth/[`currentlinewidth`] | Get current line width -| link:/docs/commands/references/currentlinecap/[`currentlinecap`] +| link:/commands/references/currentlinecap/[`currentlinecap`] | Get current line cap -| link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] +| link:/commands/references/currentlinejoin/[`currentlinejoin`] | Get current line join -| link:/docs/commands/references/currentmiterlimit/[`currentmiterlimit`] +| link:/commands/references/currentmiterlimit/[`currentmiterlimit`] | Get current miter limit -| link:/docs/commands/references/currentdash/[`currentdash`] +| link:/commands/references/currentdash/[`currentdash`] | Get current dash pattern |=== @@ -101,28 +101,28 @@ PostScript provides a stack for saving and restoring graphics state: |=== | Command | Description -| link:/docs/commands/references/setgray/[`setgray`] +| link:/commands/references/setgray/[`setgray`] | Set gray level (0=black, 1=white) -| link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] +| link:/commands/references/setrgbcolor/[`setrgbcolor`] | Set RGB color -| link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] +| link:/commands/references/setcmykcolor/[`setcmykcolor`] | Set CMYK color (Level 2) -| link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] +| link:/commands/references/sethsbcolor/[`sethsbcolor`] | Set HSB color -| link:/docs/commands/references/currentgray/[`currentgray`] +| link:/commands/references/currentgray/[`currentgray`] | Get current gray value -| link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] +| link:/commands/references/currentrgbcolor/[`currentrgbcolor`] | Get current RGB color -| link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] +| link:/commands/references/currentcmykcolor/[`currentcmykcolor`] | Get current CMYK color (Level 2) -| link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] +| link:/commands/references/currenthsbcolor/[`currenthsbcolor`] | Get current HSB color |=== @@ -172,8 +172,8 @@ grestore Graphics state changes affect all subsequent operations until: * Another state change occurs -* link:/docs/commands/references/grestore/[`grestore`] restores previous state -* link:/docs/commands/initgraphics/[`initgraphics`] resets to defaults +* link:/commands/references/grestore/[`grestore`] restores previous state +* link:/commands/initgraphics/[`initgraphics`] resets to defaults * Page is complete (showpage) === save vs. gsave @@ -182,13 +182,13 @@ Graphics state changes affect all subsequent operations until: |=== | Operator | Saves | Restores -| link:/docs/commands/references/begin/[`save`] +| link:/commands/references/begin/[`save`] | VM + graphics state | [`restore`] -| link:/docs/commands/references/gsave/[`gsave`] +| link:/commands/references/gsave/[`gsave`] | Graphics state only -| link:/docs/commands/references/grestore/[`grestore`] +| link:/commands/references/grestore/[`grestore`] |=== === Device Dependence @@ -202,9 +202,9 @@ Some parameters are device-dependent: == Common Pitfalls -WARNING: *Unbalanced gsave/grestore* - Every link:/docs/commands/references/gsave/[`gsave`] must have matching link:/docs/commands/references/grestore/[`grestore`]. +WARNING: *Unbalanced gsave/grestore* - Every link:/commands/references/gsave/[`gsave`] must have matching link:/commands/references/grestore/[`grestore`]. -WARNING: *Color Space* - Color operators may switch color space (e.g., link:/docs/commands/references/setgray/[`setgray`]) → DeviceGray. +WARNING: *Color Space* - Color operators may switch color space (e.g., link:/commands/references/setgray/[`setgray`]) → DeviceGray. WARNING: *Dash Pattern Reset* - Empty dash array `[]` resets to solid lines. diff --git a/docs/commands/image/index.adoc b/docs/commands/image/index.adoc index 2924cc9..608e413 100644 --- a/docs/commands/image/index.adoc +++ b/docs/commands/image/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for image. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/index.adoc b/docs/commands/index.adoc index 844eab9..fa3e36a 100644 --- a/docs/commands/index.adoc +++ b/docs/commands/index.adoc @@ -14,7 +14,7 @@ Complete reference documentation for all PostScript operators, organized alphabe === Browse Commands -==== link:/docs/commands/references/[Alphabetical Reference] +==== link:/commands/references/[Alphabetical Reference] Browse all commands in alphabetical order in the Command Reference section. @@ -22,24 +22,24 @@ Browse all commands in alphabetical order in the Command Reference section. Commands are organized into functional categories for easier discovery: -* link:/docs/commands/stack-manipulation/[Stack Manipulation] - Operations on the operand stack -* link:/docs/commands/arithmetic-math/[Arithmetic and Math] - Mathematical operations and functions -* link:/docs/commands/array-string/[Array and String Operations] - Collection and text manipulation -* link:/docs/commands/dictionary/[Dictionary Operations] - Key-value store operations -* link:/docs/commands/graphics-state/[Graphics State] - Graphics parameter management -* link:/docs/commands/path-construction/[Path Construction] - Vector path building -* link:/docs/commands/painting/[Painting] - Rendering and output operations -* link:/docs/commands/transformations/[Coordinate Transformations] - CTM and coordinate operations -* link:/docs/commands/font-text/[Font and Text] - Typography and text rendering -* link:/docs/commands/color/[Color] - Color space and color operations -* link:/docs/commands/image/[Image] - Raster image handling -* link:/docs/commands/device-output/[Device and Output] - Device control and output -* link:/docs/commands/file-io/[File and I/O] - File operations and streams -* link:/docs/commands/control-flow/[Control Flow] - Program flow control -* link:/docs/commands/resource-management/[Resource Management] - VM and resource handling -* link:/docs/commands/error-handling/[Error Handling] - Error management and recovery - -==== link:/docs/commands/by-category/[Categorical Index] +* link:/commands/stack-manipulation/[Stack Manipulation] - Operations on the operand stack +* link:/commands/arithmetic-math/[Arithmetic and Math] - Mathematical operations and functions +* link:/commands/array-string/[Array and String Operations] - Collection and text manipulation +* link:/commands/dictionary/[Dictionary Operations] - Key-value store operations +* link:/commands/graphics-state/[Graphics State] - Graphics parameter management +* link:/commands/path-construction/[Path Construction] - Vector path building +* link:/commands/painting/[Painting] - Rendering and output operations +* link:/commands/transformations/[Coordinate Transformations] - CTM and coordinate operations +* link:/commands/font-text/[Font and Text] - Typography and text rendering +* link:/commands/color/[Color] - Color space and color operations +* link:/commands/image/[Image] - Raster image handling +* link:/commands/device-output/[Device and Output] - Device control and output +* link:/commands/file-io/[File and I/O] - File operations and streams +* link:/commands/control-flow/[Control Flow] - Program flow control +* link:/commands/resource-management/[Resource Management] - VM and resource handling +* link:/commands/error-handling/[Error Handling] - Error management and recovery + +==== link:/commands/by-category/[Categorical Index] View all commands grouped by their functional categories with descriptions. diff --git a/docs/commands/painting/index.adoc b/docs/commands/painting/index.adoc index 4ff8890..ce1585d 100644 --- a/docs/commands/painting/index.adoc +++ b/docs/commands/painting/index.adoc @@ -25,19 +25,19 @@ PostScript provides three primary painting operations: |=== | Command | Description -| link:/docs/commands/references/fill/[`fill`] +| link:/commands/references/fill/[`fill`] | Fill path interior (non-zero winding rule) -| link:/docs/commands/references/eofill/[`eofill`] +| link:/commands/references/eofill/[`eofill`] | Fill path interior (even-odd rule) -| link:/docs/commands/references/ufill/[`ufill`] +| link:/commands/references/ufill/[`ufill`] | Fill user path (Level 2) -| link:/docs/commands/references/ueofill/[`ueofill`] +| link:/commands/references/ueofill/[`ueofill`] | Even-odd fill user path (Level 2) -| link:/docs/commands/references/rectfill/[`rectfill`] +| link:/commands/references/rectfill/[`rectfill`] | Fill rectangles (Level 2) |=== @@ -47,19 +47,19 @@ PostScript provides three primary painting operations: |=== | Command | Description -| link:/docs/commands/references/stroke/[`stroke`] +| link:/commands/references/stroke/[`stroke`] | Paint along path -| link:/docs/commands/references/strokepath/[`strokepath`] +| link:/commands/references/strokepath/[`strokepath`] | Convert stroke to outline path -| link:/docs/commands/references/ustroke/[`ustroke`] +| link:/commands/references/ustroke/[`ustroke`] | Stroke user path (Level 2) -| link:/docs/commands/references/ustrokepath/[`ustrokepath`] +| link:/commands/references/ustrokepath/[`ustrokepath`] | Convert user path stroke to outline (Level 2) -| link:/docs/commands/references/rectstroke/[`rectstroke`] +| link:/commands/references/rectstroke/[`rectstroke`] | Stroke rectangles (Level 2) |=== @@ -69,20 +69,20 @@ PostScript provides three primary painting operations: |=== | Command | Description -| link:/docs/commands/references/clip/[`clip`] +| link:/commands/references/clip/[`clip`] | Intersect clipping path (non-zero winding) -| link:/docs/commands/references/eoclip/[`eoclip`] +| link:/commands/references/eoclip/[`eoclip`] | Intersect clipping path (even-odd rule) -| link:/docs/commands/references/clippath/[`clippath`] +| link:/commands/references/clippath/[`clippath`] | Set current path to clipping path -| link:/docs/commands/references/rectclip/[`rectclip`] +| link:/commands/references/rectclip/[`rectclip`] | Clip to rectangles (Level 2) |=== == See Also -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Graphics State] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Graphics State] diff --git a/docs/commands/path-construction/index.adoc b/docs/commands/path-construction/index.adoc index 28ce4da..5092606 100644 --- a/docs/commands/path-construction/index.adoc +++ b/docs/commands/path-construction/index.adoc @@ -25,22 +25,22 @@ Path construction in PostScript follows a three-step process: |=== | Command | Description -| link:/docs/commands/references/newpath/[`newpath`] +| link:/commands/references/newpath/[`newpath`] | Initialize path to empty -| link:/docs/commands/references/moveto/[`moveto`] +| link:/commands/references/moveto/[`moveto`] | Set current point (start new subpath) -| link:/docs/commands/references/lineto/[`lineto`] +| link:/commands/references/lineto/[`lineto`] | Add straight line to current point -| link:/docs/commands/references/curveto/[`curveto`] +| link:/commands/references/curveto/[`curveto`] | Add Bézier curve to path -| link:/docs/commands/references/closepath/[`closepath`] +| link:/commands/references/closepath/[`closepath`] | Close current subpath -| link:/docs/commands/references/currentpoint/[`currentpoint`] +| link:/commands/references/currentpoint/[`currentpoint`] | Get coordinates of current point |=== @@ -50,13 +50,13 @@ Path construction in PostScript follows a three-step process: |=== | Command | Description -| link:/docs/commands/references/rmoveto/[`rmoveto`] +| link:/commands/references/rmoveto/[`rmoveto`] | Relative moveto -| link:/docs/commands/references/rlineto/[`rlineto`] +| link:/commands/references/rlineto/[`rlineto`] | Relative lineto -| link:/docs/commands/references/rcurveto/[`rcurveto`] +| link:/commands/references/rcurveto/[`rcurveto`] | Relative curveto |=== @@ -66,16 +66,16 @@ Path construction in PostScript follows a three-step process: |=== | Command | Description -| link:/docs/commands/references/arc/[`arc`] +| link:/commands/references/arc/[`arc`] | Add counterclockwise circular arc -| link:/docs/commands/references/arcn/[`arcn`] +| link:/commands/references/arcn/[`arcn`] | Add clockwise circular arc -| link:/docs/commands/references/arct/[`arct`] +| link:/commands/references/arct/[`arct`] | Add arc defined by tangent lines -| link:/docs/commands/references/arcto/[`arcto`] +| link:/commands/references/arcto/[`arcto`] | Like arct but returns tangent points |=== @@ -127,6 +127,6 @@ closepath == See Also -* link:/docs/commands/references/[Painting] - Fill and stroke paths -* link:/docs/commands/references/[Graphics State] - Line parameters -* link:/docs/commands/references/[Transformations] - Coordinate systems +* link:/commands/references/[Painting] - Fill and stroke paths +* link:/commands/references/[Graphics State] - Line parameters +* link:/commands/references/[Transformations] - Coordinate systems diff --git a/docs/commands/references/abs.adoc b/docs/commands/references/abs.adoc index 6d496ed..f2e8179 100644 --- a/docs/commands/references/abs.adoc +++ b/docs/commands/references/abs.adoc @@ -249,10 +249,10 @@ The operand must be numeric (integer or real). Other types will cause a `typeche == Related Commands -* link:/docs/commands/references/neg/[`neg`] - Negate a number -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/sqrt/[`sqrt`] - Square root +* link:/commands/references/neg/[`neg`] - Negate a number +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/sqrt/[`sqrt`] - Square root == PostScript Level @@ -338,5 +338,5 @@ The `abs` operator is extremely fast: == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/add.adoc b/docs/commands/references/add.adoc index 567ef33..3e651b1 100644 --- a/docs/commands/references/add.adoc +++ b/docs/commands/references/add.adoc @@ -214,12 +214,12 @@ Both operands must be numeric (integer or real). Other types will cause a `typec == Related Commands -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers -* link:/docs/commands/references/div/[`div`] - Divide two numbers (real result) -* link:/docs/commands/references/idiv/[`idiv`] - Integer division -* link:/docs/commands/references/mod/[`mod`] - Modulo (remainder) -* link:/docs/commands/references/neg/[`neg`] - Negate a number +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/div/[`div`] - Divide two numbers (real result) +* link:/commands/references/idiv/[`idiv`] - Integer division +* link:/commands/references/mod/[`mod`] - Modulo (remainder) +* link:/commands/references/neg/[`neg`] - Negate a number == PostScript Level @@ -284,5 +284,5 @@ For adding many values, consider: == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/aload.adoc b/docs/commands/references/aload.adoc index a54fe46..be7f6ed 100644 --- a/docs/commands/references/aload.adoc +++ b/docs/commands/references/aload.adoc @@ -47,7 +47,7 @@ packedarray aload → packedarray₀ ... packedarrayₙ₋₁ packedarray === Description -link:/docs/commands/references/aload/[`aload`] successively pushes all _n_ elements of an array or packed array onto the operand stack (where _n_ is the length of the operand), and finally pushes the array or packed array itself back onto the stack. +link:/commands/references/aload/[`aload`] successively pushes all _n_ elements of an array or packed array onto the operand stack (where _n_ is the length of the operand), and finally pushes the array or packed array itself back onto the stack. The elements are pushed in index order: element 0 first, element _n_-1 last. @@ -110,7 +110,7 @@ matrix currentmatrix aload pop === Common Pitfalls -WARNING: *Array Remains on Stack* - link:/docs/commands/references/aload/[`aload`] leaves the original array on the stack. Use link:../stack-manipulation/pop/[`pop`] if you don't need it. +WARNING: *Array Remains on Stack* - link:/commands/references/aload/[`aload`] leaves the original array on the stack. Use link:/commands/references/pop/[`pop`] if you don't need it. [source,postscript] ---- @@ -125,7 +125,7 @@ WARNING: *Stack Overflow* - Loading large arrays can overflow the operand stack. 1000 array aload % Might cause stackoverflow ---- -TIP: *Use with forall* - For processing array elements, link:/docs/commands/references/forall/[`forall`] is often more appropriate than link:/docs/commands/references/aload/[`aload`]. +TIP: *Use with forall* - For processing array elements, link:/commands/references/forall/[`forall`] is often more appropriate than link:/commands/references/aload/[`aload`]. === Error Conditions @@ -151,19 +151,19 @@ TIP: *Use with forall* - For processing array elements, link:/docs/commands/refe * Elements are shared between the array and stack (not copied) * Modifying a composite element affects both the array and the stack value * Works identically for arrays and packed arrays -* The array reference on top of stack can be used to restore values with link:/docs/commands/references/astore/[`astore`] +* The array reference on top of stack can be used to restore values with link:/commands/references/astore/[`astore`] === Performance Considerations * Loading small arrays is efficient -* For large arrays, consider using link:/docs/commands/references/get/[`get`] to access specific elements -* For iteration, link:/docs/commands/references/forall/[`forall`] is more memory-efficient +* For large arrays, consider using link:/commands/references/get/[`get`] to access specific elements +* For iteration, link:/commands/references/forall/[`forall`] is more memory-efficient === See Also -* link:/docs/commands/references/astore/[`astore`] - Store stack into array -* link:/docs/commands/references/get/[`get`] - Get single array element -* link:/docs/commands/references/getinterval/[`getinterval`] - Get subarray -* link:/docs/commands/references/forall/[`forall`] - Iterate over array elements -* link:/docs/commands/references/length/[`length`] - Get array length -* link:/docs/commands/references/pop/[`pop`] - Remove top stack element \ No newline at end of file +* link:/commands/references/astore/[`astore`] - Store stack into array +* link:/commands/references/get/[`get`] - Get single array element +* link:/commands/references/getinterval/[`getinterval`] - Get subarray +* link:/commands/references/forall/[`forall`] - Iterate over array elements +* link:/commands/references/length/[`length`] - Get array length +* link:/commands/references/pop/[`pop`] - Remove top stack element \ No newline at end of file diff --git a/docs/commands/references/anchorsearch.adoc b/docs/commands/references/anchorsearch.adoc index 6fade2e..e5b4df8 100644 --- a/docs/commands/references/anchorsearch.adoc +++ b/docs/commands/references/anchorsearch.adoc @@ -59,7 +59,7 @@ string seek anchorsearch → post match true (if found) === Description -link:/docs/commands/references/anchorsearch/[`anchorsearch`] determines if _string_ begins with _seek_ (i.e., _string_ is at least as long as _seek_ and the initial characters match exactly). +link:/commands/references/anchorsearch/[`anchorsearch`] determines if _string_ begins with _seek_ (i.e., _string_ is at least as long as _seek_ and the initial characters match exactly). If it matches: * Splits _string_ into _match_ (the matching prefix) and _post_ (the remainder) @@ -144,7 +144,7 @@ filename (.ps) anchorsearch { === Common Pitfalls -WARNING: *Must Match At Start* - link:/docs/commands/references/anchorsearch/[`anchorsearch`] only finds prefixes, not substrings anywhere in the string. +WARNING: *Must Match At Start* - link:/commands/references/anchorsearch/[`anchorsearch`] only finds prefixes, not substrings anywhere in the string. [source,postscript] ---- @@ -158,7 +158,7 @@ WARNING: *Case Sensitive* - Matching is exact, including case. (PostScript) (post) anchorsearch % false ---- -TIP: *Use search for Anywhere* - For substring search anywhere in string, use link:/docs/commands/references/search/[`search`] instead. +TIP: *Use search for Anywhere* - For substring search anywhere in string, use link:/commands/references/search/[`search`] instead. === Error Conditions @@ -187,6 +187,6 @@ TIP: *Use search for Anywhere* - For substring search anywhere in string, use li === See Also -* link:/docs/commands/references/search/[`search`] - Search for substring anywhere -* link:/docs/commands/references/token/[`token`] - Parse token from string -* link:/docs/commands/references/getinterval/[`getinterval`] - Extract substring \ No newline at end of file +* link:/commands/references/search/[`search`] - Search for substring anywhere +* link:/commands/references/token/[`token`] - Parse token from string +* link:/commands/references/getinterval/[`getinterval`] - Extract substring \ No newline at end of file diff --git a/docs/commands/references/arc.adoc b/docs/commands/references/arc.adoc index 955e4b9..ca23685 100644 --- a/docs/commands/references/arc.adoc +++ b/docs/commands/references/arc.adoc @@ -49,13 +49,13 @@ x y r ang1 ang2 arc → - === Description -link:/docs/commands/references/arc/[`arc`] appends a counterclockwise arc of a circle to the current path. The arc has (x, y) as center, r as radius, ang1 as the angle from (x, y) to the first endpoint, and ang2 as the angle from (x, y) to the second endpoint. +link:/commands/references/arc/[`arc`] appends a counterclockwise arc of a circle to the current path. The arc has (x, y) as center, r as radius, ang1 as the angle from (x, y) to the first endpoint, and ang2 as the angle from (x, y) to the second endpoint. Angles are measured in degrees counterclockwise from the positive x-axis of the current user coordinate system. -If there is a current point, link:/docs/commands/references/arc/[`arc`] includes a straight line segment from the current point to the first endpoint of the arc, then adds the arc into the current path. If the current path is empty, link:/docs/commands/references/arc/[`arc`] does not produce the initial straight line segment. In any event, the second endpoint of the arc becomes the new current point. +If there is a current point, link:/commands/references/arc/[`arc`] includes a straight line segment from the current point to the first endpoint of the arc, then adds the arc into the current path. If the current path is empty, link:/commands/references/arc/[`arc`] does not produce the initial straight line segment. In any event, the second endpoint of the arc becomes the new current point. -The curve produced is circular in user space. If user space is scaled non-uniformly (differently in x and y), link:/docs/commands/references/arc/[`arc`] will produce elliptical curves in device space. +The curve produced is circular in user space. If user space is scaled non-uniformly (differently in x and y), link:/commands/references/arc/[`arc`] will produce elliptical curves in device space. === PostScript Level @@ -189,7 +189,7 @@ WARNING: *Angle Units* - Angles are in **degrees**, not radians. A full circle i 200 200 50 0 360 arc % Correct: full circle ---- -WARNING: *Counterclockwise Direction* - link:/docs/commands/references/arc/[`arc`] always draws counterclockwise. For clockwise arcs, use link:/docs/commands/references/arcn/[`arcn`]. +WARNING: *Counterclockwise Direction* - link:/commands/references/arc/[`arc`] always draws counterclockwise. For clockwise arcs, use link:/commands/references/arcn/[`arcn`]. [source,postscript] ---- @@ -206,13 +206,13 @@ WARNING: *Non-uniform Scaling* - If the CTM has non-uniform scaling, arcs become 100 100 50 0 360 arc % Produces an ellipse, not a circle ---- -TIP: *Connecting Line* - If a current point exists, link:/docs/commands/references/arc/[`arc`] adds a connecting line to the arc's start. Use link:/docs/commands/references/moveto/[`moveto`] to the start point to avoid this. +TIP: *Connecting Line* - If a current point exists, link:/commands/references/arc/[`arc`] adds a connecting line to the arc's start. Use link:/commands/references/moveto/[`moveto`] to the start point to avoid this. === Implementation Notes * Arcs are internally represented as one or more Bézier cubic curves * The conversion is accurate enough for faithful arc rendering -* Programs using `pathforall` will see link:/docs/commands/references/curveto/[`curveto`] segments +* Programs using `pathforall` will see link:/commands/references/curveto/[`curveto`] segments * Angles wrap around: 370° is equivalent to 10° * Negative angles are valid: -90° equals 270° * Zero radius creates a point (degenerate arc) @@ -242,9 +242,9 @@ TIP: *Connecting Line* - If a current point exists, link:/docs/commands/referenc === See Also -* link:/docs/commands/references/arcn/[`arcn`] - Clockwise arc -* link:/docs/commands/references/arct/[`arct`] - Arc defined by tangent lines -* link:/docs/commands/references/arcto/[`arcto`] - Like arct but returns tangent points -* link:/docs/commands/references/curveto/[`curveto`] - Bézier cubic curve -* link:/docs/commands/references/moveto/[`moveto`] - Set current point -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file +* link:/commands/references/arcn/[`arcn`] - Clockwise arc +* link:/commands/references/arct/[`arct`] - Arc defined by tangent lines +* link:/commands/references/arcto/[`arcto`] - Like arct but returns tangent points +* link:/commands/references/curveto/[`curveto`] - Bézier cubic curve +* link:/commands/references/moveto/[`moveto`] - Set current point +* link:/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file diff --git a/docs/commands/references/arcn.adoc b/docs/commands/references/arcn.adoc index 50c9a6d..9c0d8ac 100644 --- a/docs/commands/references/arcn.adoc +++ b/docs/commands/references/arcn.adoc @@ -49,11 +49,11 @@ x y r ang1 ang2 arcn → - === Description -link:/docs/commands/references/arcn/[`arcn`] (arc negative) behaves like link:/docs/commands/references/arc/[`arc`], but builds its arc segment in a clockwise direction in user space instead of counterclockwise. +link:/commands/references/arcn/[`arcn`] (arc negative) behaves like link:/commands/references/arc/[`arc`], but builds its arc segment in a clockwise direction in user space instead of counterclockwise. The arc has (x, y) as center, r as radius, ang1 as the angle from (x, y) to the first endpoint, and ang2 as the angle from (x, y) to the second endpoint. Angles are measured in degrees counterclockwise from the positive x-axis. -If there is a current point, link:/docs/commands/references/arcn/[`arcn`] includes a straight line segment from the current point to the first endpoint of the arc. The second endpoint of the arc becomes the new current point. +If there is a current point, link:/commands/references/arcn/[`arcn`] includes a straight line segment from the current point to the first endpoint of the arc. The second endpoint of the arc becomes the new current point. === PostScript Level @@ -166,7 +166,7 @@ fill === Common Pitfalls -WARNING: *Clockwise Means Negative Direction* - Even though you specify ang1 to ang2, link:/docs/commands/references/arcn/[`arcn`] draws clockwise (decreasing angles). +WARNING: *Clockwise Means Negative Direction* - Even though you specify ang1 to ang2, link:/commands/references/arcn/[`arcn`] draws clockwise (decreasing angles). [source,postscript] ---- @@ -183,7 +183,7 @@ WARNING: *Angle Order Still Matters* - ang1 is the start angle, ang2 is the end 200 200 50 90 0 arcn % Goes 90° clockwise (90→45→0) ---- -TIP: *Use for Interior Paths* - link:/docs/commands/references/arcn/[`arcn`] is essential for creating holes in shapes when combined with link:/docs/commands/references/arc/[`arc`], as opposite directions create non-overlapping regions. +TIP: *Use for Interior Paths* - link:/commands/references/arcn/[`arcn`] is essential for creating holes in shapes when combined with link:/commands/references/arc/[`arc`], as opposite directions create non-overlapping regions. === Error Conditions @@ -206,19 +206,19 @@ TIP: *Use for Interior Paths* - link:/docs/commands/references/arcn/[`arcn`] is * Internally represented as Bézier cubic curves * Direction matters for fill rules (non-zero winding number) * Clockwise and counterclockwise arcs can create holes in filled shapes -* Same accuracy considerations as link:/docs/commands/references/arc/[`arc`] +* Same accuracy considerations as link:/commands/references/arc/[`arc`] * Produces elliptical curves if CTM has non-uniform scaling === Performance Considerations -* Same performance characteristics as link:/docs/commands/references/arc/[`arc`] +* Same performance characteristics as link:/commands/references/arc/[`arc`] * No additional overhead for clockwise direction * Useful for efficient hole creation in complex paths === See Also -* link:/docs/commands/references/arc/[`arc`] - Counterclockwise arc -* link:/docs/commands/references/arct/[`arct`] - Arc defined by tangent lines -* link:/docs/commands/references/arcto/[`arcto`] - Like arct but returns tangent points -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath -* link:/docs/commands/references/moveto/[`moveto`] - Set current point \ No newline at end of file +* link:/commands/references/arc/[`arc`] - Counterclockwise arc +* link:/commands/references/arct/[`arct`] - Arc defined by tangent lines +* link:/commands/references/arcto/[`arcto`] - Like arct but returns tangent points +* link:/commands/references/closepath/[`closepath`] - Close current subpath +* link:/commands/references/moveto/[`moveto`] - Set current point \ No newline at end of file diff --git a/docs/commands/references/arct.adoc b/docs/commands/references/arct.adoc index bcfd0c9..67e2dee 100644 --- a/docs/commands/references/arct.adoc +++ b/docs/commands/references/arct.adoc @@ -49,19 +49,19 @@ x1 y1 x2 y2 r arct → - === Description -link:/docs/commands/references/arct/[`arct`] appends an arc of a circle to the current path, possibly preceded by a straight line segment. The arc is defined by a radius r and two tangent lines. +link:/commands/references/arct/[`arct`] appends an arc of a circle to the current path, possibly preceded by a straight line segment. The arc is defined by a radius r and two tangent lines. The tangent lines are: 1. From the current point (x0, y0) to (x1, y1) 2. From (x1, y1) to (x2, y2) -If the current point is undefined, link:/docs/commands/references/arct/[`arct`] executes the [`nocurrentpoint`] error. +If the current point is undefined, link:/commands/references/arct/[`arct`] executes the [`nocurrentpoint`] error. The center of the arc is located at distance r perpendicular to both tangent lines, within the inner angle between them. The arc begins at the first tangent point (xt1, yt1) on the first tangent line, and ends at the second tangent point (xt2, yt2) on the second tangent line. -Before constructing the arc, link:/docs/commands/references/arct/[`arct`] adds a straight line from the current point to (xt1, yt1), unless those points are the same. The point (xt2, yt2) becomes the new current point. +Before constructing the arc, link:/commands/references/arct/[`arct`] adds a straight line from the current point to (xt1, yt1), unless those points are the same. The point (xt2, yt2) becomes the new current point. -If the two tangent lines are collinear, link:/docs/commands/references/arct/[`arct`] merely appends a straight line from (x0, y0) to (x1, y1). +If the two tangent lines are collinear, link:/commands/references/arct/[`arct`] merely appends a straight line from (x0, y0) to (x1, y1). === PostScript Level @@ -185,7 +185,7 @@ stroke === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/arct/[`arct`] needs a current point to define the first tangent line. +WARNING: *Requires Current Point* - link:/commands/references/arct/[`arct`] needs a current point to define the first tangent line. [source,postscript] ---- @@ -203,7 +203,7 @@ WARNING: *Collinear Points* - If the three points are collinear, no arc is creat WARNING: *Radius Too Large* - Very large radii relative to the angle may produce unexpected results or hit numerical limits. -TIP: *Perfect for UI Corners* - link:/docs/commands/references/arct/[`arct`] is ideal for creating rounded corners in user interfaces and technical drawings where corners are defined by intersecting lines. +TIP: *Perfect for UI Corners* - link:/commands/references/arct/[`arct`] is ideal for creating rounded corners in user interfaces and technical drawings where corners are defined by intersecting lines. === Error Conditions @@ -233,18 +233,18 @@ TIP: *Perfect for UI Corners* - link:/docs/commands/references/arct/[`arct`] is * Non-uniform scaling produces elliptical results * Internally converted to Bézier curves * The connecting line from current point is automatic -* Tangent points are calculated but not returned (use link:/docs/commands/references/arcto/[`arcto`] for that) +* Tangent points are calculated but not returned (use link:/commands/references/arcto/[`arcto`] for that) === Performance Considerations -* Slightly more complex than link:/docs/commands/references/arc/[`arc`] due to tangent calculations +* Slightly more complex than link:/commands/references/arc/[`arc`] due to tangent calculations * Very efficient for creating rounded corners * Single operation replaces manual tangent point calculation === See Also -* link:/docs/commands/references/arcto/[`arcto`] - Like arct but returns tangent points -* link:/docs/commands/references/arc/[`arc`] - Counterclockwise circular arc -* link:/docs/commands/references/arcn/[`arcn`] - Clockwise circular arc -* link:/docs/commands/references/curveto/[`curveto`] - Bézier cubic curve -* link:/docs/commands/references/lineto/[`lineto`] - Straight line segment \ No newline at end of file +* link:/commands/references/arcto/[`arcto`] - Like arct but returns tangent points +* link:/commands/references/arc/[`arc`] - Counterclockwise circular arc +* link:/commands/references/arcn/[`arcn`] - Clockwise circular arc +* link:/commands/references/curveto/[`curveto`] - Bézier cubic curve +* link:/commands/references/lineto/[`lineto`] - Straight line segment \ No newline at end of file diff --git a/docs/commands/references/arcto.adoc b/docs/commands/references/arcto.adoc index b148f62..d853268 100644 --- a/docs/commands/references/arcto.adoc +++ b/docs/commands/references/arcto.adoc @@ -58,7 +58,7 @@ x1 y1 x2 y2 r arcto → xt1 yt1 xt2 yt2 === Description -link:/docs/commands/references/arcto/[`arcto`] produces the same effect as link:/docs/commands/references/arct/[`arct`]. It also returns the two tangent point coordinates (xt1, yt1) and (xt2, yt2) in user space. +link:/commands/references/arcto/[`arcto`] produces the same effect as link:/commands/references/arct/[`arct`]. It also returns the two tangent point coordinates (xt1, yt1) and (xt2, yt2) in user space. The arc is defined by: 1. A tangent line from the current point (x0, y0) to (x1, y1) @@ -67,7 +67,7 @@ The arc is defined by: The arc is tangent to both lines, and the tangent points are returned on the stack. -link:/docs/commands/references/arcto/[`arcto`] is not allowed as an element of a user path, whereas link:/docs/commands/references/arct/[`arct`] is allowed. +link:/commands/references/arcto/[`arcto`] is not allowed as an element of a user path, whereas link:/commands/references/arct/[`arct`] is allowed. === PostScript Level @@ -223,9 +223,9 @@ newpath === Common Pitfalls -WARNING: *Not for User Paths* - Unlike link:/docs/commands/references/arct/[`arct`], link:/docs/commands/references/arcto/[`arcto`] cannot be used in user paths. +WARNING: *Not for User Paths* - Unlike link:/commands/references/arct/[`arct`], link:/commands/references/arcto/[`arcto`] cannot be used in user paths. -WARNING: *Stack Management* - link:/docs/commands/references/arcto/[`arcto`] leaves four values on the stack. Remember to pop them if not needed. +WARNING: *Stack Management* - link:/commands/references/arcto/[`arcto`] leaves four values on the stack. Remember to pop them if not needed. [source,postscript] ---- @@ -236,7 +236,7 @@ newpath stroke % May cause typecheck error ---- -TIP: *Use When You Need Tangent Points* - If you don't need the tangent points, use link:/docs/commands/references/arct/[`arct`] instead for cleaner stack management. +TIP: *Use When You Need Tangent Points* - If you don't need the tangent points, use link:/commands/references/arct/[`arct`] instead for cleaner stack management. === Error Conditions @@ -262,7 +262,7 @@ TIP: *Use When You Need Tangent Points* - If you don't need the tangent points, === Implementation Notes -* Identical path construction to link:/docs/commands/references/arct/[`arct`] +* Identical path construction to link:/commands/references/arct/[`arct`] * Returns tangent points in user space coordinates * Tangent points are on the original tangent lines, not the arc * Useful for geometric calculations and annotations @@ -270,13 +270,13 @@ TIP: *Use When You Need Tangent Points* - If you don't need the tangent points, === Performance Considerations -* Slightly slower than link:/docs/commands/references/arct/[`arct`] due to returning tangent points +* Slightly slower than link:/commands/references/arct/[`arct`] due to returning tangent points * Overhead is minimal for most applications -* Consider using link:/docs/commands/references/arct/[`arct`] if tangent points aren't needed +* Consider using link:/commands/references/arct/[`arct`] if tangent points aren't needed === See Also -* link:/docs/commands/references/arct/[`arct`] - Arc by tangent (no tangent point return) -* link:/docs/commands/references/arc/[`arc`] - Counterclockwise circular arc -* link:/docs/commands/references/arcn/[`arcn`] - Clockwise circular arc -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/arct/[`arct`] - Arc by tangent (no tangent point return) +* link:/commands/references/arc/[`arc`] - Counterclockwise circular arc +* link:/commands/references/arcn/[`arcn`] - Clockwise circular arc +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/array.adoc b/docs/commands/references/array.adoc index 200ec57..82d774c 100644 --- a/docs/commands/references/array.adoc +++ b/docs/commands/references/array.adoc @@ -37,7 +37,7 @@ int array → array === Description -link:/docs/commands/references/array/[`array`] creates a new array object of length _int_, with each element initialized to null. The array is allocated in local or global VM according to the current VM allocation mode. +link:/commands/references/array/[`array`] creates a new array object of length _int_, with each element initialized to null. The array is allocated in local or global VM according to the current VM allocation mode. The _int_ operand must be: @@ -101,7 +101,7 @@ dup 1 200 put % y coordinate === Common Pitfalls -WARNING: *Uninitialized Elements* - Remember that link:/docs/commands/references/array/[`array`] initializes all elements to null. You must explicitly populate the array before using its elements. +WARNING: *Uninitialized Elements* - Remember that link:/commands/references/array/[`array`] initializes all elements to null. You must explicitly populate the array before using its elements. [source,postscript] ---- @@ -111,7 +111,7 @@ WARNING: *Uninitialized Elements* - Remember that link:/docs/commands/references WARNING: *VM Allocation* - Arrays are allocated in VM. Creating many large arrays can exhaust available memory. -TIP: *Array Literals vs. array Operator* - For known, fixed-size arrays, use the literal syntax `[ ... ]` instead. Use link:/docs/commands/references/array/[`array`] when the size is computed dynamically. +TIP: *Array Literals vs. array Operator* - For known, fixed-size arrays, use the literal syntax `[ ... ]` instead. Use link:/commands/references/array/[`array`] when the size is computed dynamically. === Error Conditions @@ -139,7 +139,7 @@ TIP: *Array Literals vs. array Operator* - For known, fixed-size arrays, use the * Most PostScript implementations support arrays up to at least 65,535 elements * Array allocation is typically faster for small arrays -* Consider using link:/docs/commands/references/packedarray/[`packedarray`] for read-only data (Level 2) +* Consider using link:/commands/references/packedarray/[`packedarray`] for read-only data (Level 2) === Performance Considerations @@ -149,10 +149,10 @@ TIP: *Array Literals vs. array Operator* - For known, fixed-size arrays, use the === See Also -* link:/docs/commands/references/brackets/[`[`] - Begin array construction -* link:/docs/commands/references/brackets/[`]`] - End array construction -* link:/docs/commands/references/astore/[`astore`] - Store stack elements into array -* link:/docs/commands/references/packedarray/[`packedarray`] - Create read-only packed array (Level 2) -* link:/docs/commands/references/length/[`length`] - Get array length -* link:/docs/commands/references/get/[`get`] - Get array element -* link:/docs/commands/references/put/[`put`] - Put value into array \ No newline at end of file +* link:/commands/references/brackets/[`[`] - Begin array construction +* link:/commands/references/brackets/[`]`] - End array construction +* link:/commands/references/astore/[`astore`] - Store stack elements into array +* link:/commands/references/packedarray/[`packedarray`] - Create read-only packed array (Level 2) +* link:/commands/references/length/[`length`] - Get array length +* link:/commands/references/get/[`get`] - Get array element +* link:/commands/references/put/[`put`] - Put value into array \ No newline at end of file diff --git a/docs/commands/references/ashow.adoc b/docs/commands/references/ashow.adoc index 67b1879..23bf3a9 100644 --- a/docs/commands/references/ashow.adoc +++ b/docs/commands/references/ashow.adoc @@ -29,7 +29,7 @@ ax ay string === Description -link:/docs/commands/references/ashow/[`ashow`] paints the characters of `string` in a manner similar to link:/docs/commands/references/show/[`show`]. But while doing so, link:/docs/commands/references/ashow/[`ashow`] adjusts the width of each character shown by adding `ax` to the character's x width and `ay` to its y width, thus modifying the spacing between characters. +link:/commands/references/ashow/[`ashow`] paints the characters of `string` in a manner similar to link:/commands/references/show/[`show`]. But while doing so, link:/commands/references/ashow/[`ashow`] adjusts the width of each character shown by adding `ax` to the character's x width and `ay` to its y width, thus modifying the spacing between characters. The numbers `ax` and `ay` are x and y displacements in the user coordinate system, not in the character coordinate system. This operator enables a string of text to be fitted to a specific width by adjusting all the spaces between characters by a uniform amount. @@ -102,7 +102,7 @@ The numbers `ax` and `ay` are x and y displacements in the user coordinate syste : Current font is not valid **nocurrentpoint** -: Current point is not defined before link:/docs/commands/references/ashow/[`ashow`] +: Current point is not defined before link:/commands/references/ashow/[`ashow`] **stackunderflow** : Fewer than three operands on stack @@ -181,10 +181,10 @@ grestore === Performance Notes -- link:/docs/commands/references/ashow/[`ashow`] is slightly slower than link:/docs/commands/references/show/[`show`] due to spacing calculations +- link:/commands/references/ashow/[`ashow`] is slightly slower than link:/commands/references/show/[`show`] due to spacing calculations - Character caching still applies -- For uniform spacing of all text, set once and use link:/docs/commands/references/show/[`show`] -- For spacing only specific characters, use link:/docs/commands/references/widthshow/[`widthshow`] instead +- For uniform spacing of all text, set once and use link:/commands/references/show/[`show`] +- For spacing only specific characters, use link:/commands/references/widthshow/[`widthshow`] instead === Advanced Usage @@ -208,10 +208,10 @@ grestore === See Also -- link:/docs/commands/references/show/[`show`] - Basic text painting -- link:/docs/commands/references/widthshow/[`widthshow`] - Adjust specific character width -- link:/docs/commands/references/awidthshow/[`awidthshow`] - Combine link:/docs/commands/references/ashow/[`ashow`] and link:/docs/commands/references/widthshow/[`widthshow`] -- link:/docs/commands/references/kshow/[`kshow`] - Show with kerning procedure -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width +- link:/commands/references/show/[`show`] - Basic text painting +- link:/commands/references/widthshow/[`widthshow`] - Adjust specific character width +- link:/commands/references/awidthshow/[`awidthshow`] - Combine link:/commands/references/ashow/[`ashow`] and link:/commands/references/widthshow/[`widthshow`] +- link:/commands/references/kshow/[`kshow`] - Show with kerning procedure +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width - `moveto` - Set current point \ No newline at end of file diff --git a/docs/commands/references/astore.adoc b/docs/commands/references/astore.adoc index cc7cdfc..fb0a4d9 100644 --- a/docs/commands/references/astore.adoc +++ b/docs/commands/references/astore.adoc @@ -46,14 +46,14 @@ any₀ ... anyₙ₋₁ array astore → array === Description -link:/docs/commands/references/astore/[`astore`] stores objects from the operand stack into an array: +link:/commands/references/astore/[`astore`] stores objects from the operand stack into an array: 1. Removes the array from the stack and determines its length _n_ 2. Removes _n_ objects from the stack 3. Stores them into the array (topmost stack element → array[n-1], bottommost → array[0]) 4. Pushes the array back onto the stack -The array must have been previously created with the correct length. link:/docs/commands/references/astore/[`astore`] cannot be performed on packed arrays (they are read-only). +The array must have been previously created with the correct length. link:/commands/references/astore/[`astore`] cannot be performed on packed arrays (they are read-only). === PostScript Level @@ -135,7 +135,7 @@ WARNING: *Stack Order* - Objects are stored in reverse stack order: topmost stac WARNING: *Global/Local VM Restrictions* - If the array is in global VM and any stored object is in local VM, [`invalidaccess`] error occurs. -TIP: *Pre-create Array* - Always create the array first with the correct size using link:/docs/commands/references/array/[`array`]. +TIP: *Pre-create Array* - Always create the array first with the correct size using link:/commands/references/array/[`array`]. === Error Conditions @@ -171,12 +171,12 @@ TIP: *Pre-create Array* - Always create the array first with the correct size us [ 1 2 3 ] % [1 2 3] (more convenient) ---- -The `[ ]` syntax is usually more convenient for literal arrays, but link:/docs/commands/references/astore/[`astore`] is useful when the array size is computed dynamically. +The `[ ]` syntax is usually more convenient for literal arrays, but link:/commands/references/astore/[`astore`] is useful when the array size is computed dynamically. === See Also -* link:/docs/commands/references/aload/[`aload`] - Load array elements onto stack -* link:/docs/commands/references/array/[`array`] - Create new array -* link:/docs/commands/references/put/[`put`] - Put single value into array -* link:/docs/commands/references/putinterval/[`putinterval`] - Put subarray into array -* link:/docs/commands/references/brackets/[`[`] / link:/docs/commands/references/brackets/[`]`] - Array literal syntax \ No newline at end of file +* link:/commands/references/aload/[`aload`] - Load array elements onto stack +* link:/commands/references/array/[`array`] - Create new array +* link:/commands/references/put/[`put`] - Put single value into array +* link:/commands/references/putinterval/[`putinterval`] - Put subarray into array +* link:/commands/references/brackets/[`[`] / link:/commands/references/brackets/[`]`] - Array literal syntax \ No newline at end of file diff --git a/docs/commands/references/atan.adoc b/docs/commands/references/atan.adoc index 844ad20..4695d97 100644 --- a/docs/commands/references/atan.adoc +++ b/docs/commands/references/atan.adoc @@ -99,8 +99,8 @@ WARNING: PostScript returns angles in *degrees* (0-360), not radians! == Related Commands -* link:/docs/commands/references/sin/[`sin`] - Sine (degrees) -* link:/docs/commands/references/cos/[`cos`] - Cosine (degrees) +* link:/commands/references/sin/[`sin`] - Sine (degrees) +* link:/commands/references/cos/[`cos`] - Cosine (degrees) == PostScript Level @@ -124,4 +124,4 @@ Both num and den are zero. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/awidthshow.adoc b/docs/commands/references/awidthshow.adoc index c2b1dd1..bd7165c 100644 --- a/docs/commands/references/awidthshow.adoc +++ b/docs/commands/references/awidthshow.adoc @@ -29,11 +29,11 @@ cx cy char ax ay string === Description -link:/docs/commands/references/awidthshow/[`awidthshow`] paints the characters of `string` in a manner similar to link:/docs/commands/references/show/[`show`], but combines the special effects of link:/docs/commands/references/ashow/[`ashow`] and link:/docs/commands/references/widthshow/[`widthshow`]. +link:/commands/references/awidthshow/[`awidthshow`] paints the characters of `string` in a manner similar to link:/commands/references/show/[`show`], but combines the special effects of link:/commands/references/ashow/[`ashow`] and link:/commands/references/widthshow/[`widthshow`]. -link:/docs/commands/references/awidthshow/[`awidthshow`] adjusts the width of each character shown by adding `ax` to its x width and `ay` to its y width, thus modifying the spacing between characters. Furthermore, link:/docs/commands/references/awidthshow/[`awidthshow`] modifies the width of each occurrence of the character `char` by an additional amount `(cx, cy)`. +link:/commands/references/awidthshow/[`awidthshow`] adjusts the width of each character shown by adding `ax` to its x width and `ay` to its y width, thus modifying the spacing between characters. Furthermore, link:/commands/references/awidthshow/[`awidthshow`] modifies the width of each occurrence of the character `char` by an additional amount `(cx, cy)`. -The interpretation of `char` is as described for the link:/docs/commands/references/widthshow/[`widthshow`] operator. +The interpretation of `char` is as described for the link:/commands/references/widthshow/[`widthshow`] operator. This operator enables fitting a string of text to a specific width by adjusting all of the spaces between characters by a uniform amount, while independently controlling the width of some specific character, such as the space character. @@ -255,16 +255,16 @@ The space character (ASCII 32) is the most common target: === Performance Notes -- More expensive than link:/docs/commands/references/show/[`show`], link:/docs/commands/references/ashow/[`ashow`], or link:/docs/commands/references/widthshow/[`widthshow`] alone +- More expensive than link:/commands/references/show/[`show`], link:/commands/references/ashow/[`ashow`], or link:/commands/references/widthshow/[`widthshow`] alone - Two conditional checks per character - Still benefits from font caching - For best performance, prefer simpler operators when possible === See Also -- link:/docs/commands/references/show/[`show`] - Basic text painting -- link:/docs/commands/references/ashow/[`ashow`] - Uniform character spacing adjustment -- link:/docs/commands/references/widthshow/[`widthshow`] - Selective character width adjustment -- link:/docs/commands/references/kshow/[`kshow`] - Show with kerning procedure -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file +- link:/commands/references/show/[`show`] - Basic text painting +- link:/commands/references/ashow/[`ashow`] - Uniform character spacing adjustment +- link:/commands/references/widthshow/[`widthshow`] - Selective character width adjustment +- link:/commands/references/kshow/[`kshow`] - Show with kerning procedure +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file diff --git a/docs/commands/references/begin.adoc b/docs/commands/references/begin.adoc index 89e19f4..0512a08 100644 --- a/docs/commands/references/begin.adoc +++ b/docs/commands/references/begin.adoc @@ -37,13 +37,13 @@ dict begin → – === Description -link:/docs/commands/references/begin/[`begin`] pushes _dict_ onto the dictionary stack, making it the current dictionary. This dictionary becomes the first one consulted during: +link:/commands/references/begin/[`begin`] pushes _dict_ onto the dictionary stack, making it the current dictionary. This dictionary becomes the first one consulted during: * Implicit name lookup by the interpreter -* link:/docs/commands/references/def/[`def`] - defines in current dictionary -* link:/docs/commands/references/load/[`load`] - searches dictionary stack -* link:/docs/commands/references/store/[`store`] - searches dictionary stack -* link:/docs/commands/references/where/[`where`] - searches dictionary stack +* link:/commands/references/def/[`def`] - defines in current dictionary +* link:/commands/references/load/[`load`] - searches dictionary stack +* link:/commands/references/store/[`store`] - searches dictionary stack +* link:/commands/references/where/[`where`] - searches dictionary stack === PostScript Level @@ -130,7 +130,7 @@ end === Common Pitfalls -WARNING: *Must Match with end* - Every link:/docs/commands/references/begin/[`begin`] must have a corresponding link:/docs/commands/references/end/[`end`]. Unmatched begins cause [`dictstackoverflow`]. +WARNING: *Must Match with end* - Every link:/commands/references/begin/[`begin`] must have a corresponding link:/commands/references/end/[`end`]. Unmatched begins cause [`dictstackoverflow`]. [source,postscript] ---- @@ -193,8 +193,8 @@ systemdict === See Also -* link:/docs/commands/references/end/[`end`] - Pop dictionary from stack -* link:/docs/commands/references/currentdict/[`currentdict`] - Get current dictionary -* link:/docs/commands/references/def/[`def`] - Define in current dictionary -* link:/docs/commands/references/dictstack/[`dictstack`] - Examine dictionary stack -* link:/docs/commands/references/countdictstack/[`countdictstack`] - Count stack depth \ No newline at end of file +* link:/commands/references/end/[`end`] - Pop dictionary from stack +* link:/commands/references/currentdict/[`currentdict`] - Get current dictionary +* link:/commands/references/def/[`def`] - Define in current dictionary +* link:/commands/references/dictstack/[`dictstack`] - Examine dictionary stack +* link:/commands/references/countdictstack/[`countdictstack`] - Count stack depth \ No newline at end of file diff --git a/docs/commands/references/bitshift.adoc b/docs/commands/references/bitshift.adoc index ff9b1f9..45ae3e8 100644 --- a/docs/commands/references/bitshift.adoc +++ b/docs/commands/references/bitshift.adoc @@ -106,8 +106,8 @@ WARNING: Right shift only works correctly for positive integers. == Related Commands -* link:/docs/commands/references/mul/[`mul`] - Multiplication -* link:/docs/commands/references/idiv/[`idiv`] - Integer division +* link:/commands/references/mul/[`mul`] - Multiplication +* link:/commands/references/idiv/[`idiv`] - Integer division == PostScript Level @@ -129,4 +129,4 @@ One or both operands are not integers. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/brackets.adoc b/docs/commands/references/brackets.adoc index d86082a..144e0d6 100644 --- a/docs/commands/references/brackets.adoc +++ b/docs/commands/references/brackets.adoc @@ -87,7 +87,7 @@ mark obj₀ ... objₙ₋₁ ] → array ==== How Array Construction Works -The `[` operator pushes a special mark object on the operand stack to indicate the beginning of an array being constructed. It is functionally equivalent to the link:/docs/commands/references/mark/[`mark`] operator, but its use with `]` gives it special significance for array construction. +The `[` operator pushes a special mark object on the operand stack to indicate the beginning of an array being constructed. It is functionally equivalent to the link:/commands/references/mark/[`mark`] operator, but its use with `]` gives it special significance for array construction. The `]` operator completes array construction by: @@ -207,7 +207,7 @@ WARNING: *Execution vs. Literal* - Objects between `[` and `]` are evaluated bef % NOT [/x 5 def] ---- -TIP: *Literal vs. Executable Arrays* - Arrays created by `[ ... ]` have the literal attribute by default. To create an array without evaluating its contents, use the procedure syntax `{ ... }`. Use link:/docs/commands/references/cvx/[`cvx`] to make a literal array executable if needed. +TIP: *Literal vs. Executable Arrays* - Arrays created by `[ ... ]` have the literal attribute by default. To create an array without evaluating its contents, use the procedure syntax `{ ... }`. Use link:/commands/references/cvx/[`cvx`] to make a literal array executable if needed. [source,postscript] ---- @@ -236,9 +236,9 @@ TIP: *Literal vs. Executable Arrays* - Arrays created by `[ ... ]` have the lite === Implementation Notes -* The `[` operator is functionally equivalent to link:/docs/commands/references/mark/[`mark`] +* The `[` operator is functionally equivalent to link:/commands/references/mark/[`mark`] * The `]` operator is syntactic sugar recognized during parsing -* Marks are used for error recovery and can be detected with link:/docs/commands/references/counttomark/[`counttomark`] +* Marks are used for error recovery and can be detected with link:/commands/references/counttomark/[`counttomark`] * When scanned, `[ ... ]` creates a literal array object * The objects are placed in the array in the order they appeared between brackets * Index 0 contains the first object after `[` @@ -248,7 +248,7 @@ TIP: *Literal vs. Executable Arrays* - Arrays created by `[ ... ]` have the lite ==== Equivalence with mark -The `[` operator is functionally equivalent to link:/docs/commands/references/mark/[`mark`]: +The `[` operator is functionally equivalent to link:/commands/references/mark/[`mark`]: [source,postscript] ---- @@ -260,7 +260,7 @@ However, `[` and `]` provide clearer syntax for array construction. ==== Comparison with astore -The `]` operator is similar to link:/docs/commands/references/astore/[`astore`] but more convenient: +The `]` operator is similar to link:/commands/references/astore/[`astore`] but more convenient: [source,postscript] ---- @@ -275,9 +275,9 @@ The bracket syntax is clearer and doesn't require knowing the count in advance. === See Also -* link:/docs/commands/references/mark/[`mark`] - Push mark object -* link:/docs/commands/references/cleartomark/[`cleartomark`] - Clear to mark -* link:/docs/commands/references/counttomark/[`counttomark`] - Count objects to mark -* link:/docs/commands/references/array/[`array`] - Create uninitialized array -* link:/docs/commands/references/astore/[`astore`] - Store stack into array -* link:/docs/commands/references/packedarray/[`packedarray`] - Create read-only array \ No newline at end of file +* link:/commands/references/mark/[`mark`] - Push mark object +* link:/commands/references/cleartomark/[`cleartomark`] - Clear to mark +* link:/commands/references/counttomark/[`counttomark`] - Count objects to mark +* link:/commands/references/array/[`array`] - Create uninitialized array +* link:/commands/references/astore/[`astore`] - Store stack into array +* link:/commands/references/packedarray/[`packedarray`] - Create read-only array \ No newline at end of file diff --git a/docs/commands/references/ceiling.adoc b/docs/commands/references/ceiling.adoc index da0c537..c29147f 100644 --- a/docs/commands/references/ceiling.adoc +++ b/docs/commands/references/ceiling.adoc @@ -239,10 +239,10 @@ true ceiling % ERROR: typecheck == Related Commands -* link:/docs/commands/references/floor/[`floor`] - Round down to integer -* link:/docs/commands/references/round/[`round`] - Round to nearest integer -* link:/docs/commands/references/truncate/[`truncate`] - Truncate toward zero -* link:/docs/commands/references/abs/[`abs`] - Absolute value +* link:/commands/references/floor/[`floor`] - Round down to integer +* link:/commands/references/round/[`round`] - Round to nearest integer +* link:/commands/references/truncate/[`truncate`] - Truncate toward zero +* link:/commands/references/abs/[`abs`] - Absolute value == PostScript Level @@ -317,5 +317,5 @@ The `ceiling` operator is fast: == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/charpath.adoc b/docs/commands/references/charpath.adoc index 9acc950..a49db99 100644 --- a/docs/commands/references/charpath.adoc +++ b/docs/commands/references/charpath.adoc @@ -29,20 +29,20 @@ string bool === Description -link:/docs/commands/references/charpath/[`charpath`] obtains the character path outlines that would result if `string` were shown at the current point using link:/docs/commands/references/show/[`show`]. Instead of painting the path, however, link:/docs/commands/references/charpath/[`charpath`] appends the path to the current path. This yields a result suitable for general filling, stroking, or clipping. +link:/commands/references/charpath/[`charpath`] obtains the character path outlines that would result if `string` were shown at the current point using link:/commands/references/show/[`show`]. Instead of painting the path, however, link:/commands/references/charpath/[`charpath`] appends the path to the current path. This yields a result suitable for general filling, stroking, or clipping. The `bool` operand determines what happens if the character path is designed to be stroked rather than filled or outlined: -- If `bool` is `false`, link:/docs/commands/references/charpath/[`charpath`] simply appends the character path to the current path; the result is suitable only for stroking. -- If `bool` is `true`, link:/docs/commands/references/charpath/[`charpath`] applies the `strokepath` operator to the character path; the result is suitable for filling or clipping, but not for stroking. +- If `bool` is `false`, link:/commands/references/charpath/[`charpath`] simply appends the character path to the current path; the result is suitable only for stroking. +- If `bool` is `true`, link:/commands/references/charpath/[`charpath`] applies the `strokepath` operator to the character path; the result is suitable for filling or clipping, but not for stroking. -link:/docs/commands/references/charpath/[`charpath`] does not produce results for portions of a character defined as images or masks rather than as paths. +link:/commands/references/charpath/[`charpath`] does not produce results for portions of a character defined as images or masks rather than as paths. === Protected Fonts The outlines of some fonts are protected. (In Level 1 implementations, this applies to all fonts; in Level 2, only to certain special fonts and not to ordinary Type 1 or Type 3 fonts.) -If the current font is protected, using link:/docs/commands/references/charpath/[`charpath`] to obtain its outlines causes the `pathforall` and `upath` operators to be disabled for as long as those outlines remain in the current path. +If the current font is protected, using link:/commands/references/charpath/[`charpath`] to obtain its outlines causes the `pathforall` and `upath` operators to be disabled for as long as those outlines remain in the current path. === Parameters @@ -335,7 +335,7 @@ textPath 0 setgray 1 setlinewidth stroke === Limitations **Image-based characters:** -- link:/docs/commands/references/charpath/[`charpath`] does not produce paths for bitmap characters +- link:/commands/references/charpath/[`charpath`] does not produce paths for bitmap characters - Some fonts mix paths and bitmaps - Only path-based portions are included @@ -354,23 +354,23 @@ textPath 0 setgray 1 setlinewidth stroke |=== | Operator | Output -| link:/docs/commands/references/show/[`show`] +| link:/commands/references/show/[`show`] | Paints characters (rasterized) -| link:/docs/commands/references/charpath/[`charpath`] +| link:/commands/references/charpath/[`charpath`] | Constructs path outlines -| link:/docs/commands/references/stringwidth/[`stringwidth`] +| link:/commands/references/stringwidth/[`stringwidth`] | Returns width vector only |=== === See Also -- link:/docs/commands/references/show/[`show`] - Paint text string -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width +- link:/commands/references/show/[`show`] - Paint text string +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width - `pathbbox` - Get path bounding box - `strokepath` - Convert stroke to filled path - `clip` - Set clipping path - `fill` - Fill path - `stroke` - Stroke path -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font \ No newline at end of file +- link:/commands/references/setfont/[`setfont`] - Establish current font \ No newline at end of file diff --git a/docs/commands/references/clear.adoc b/docs/commands/references/clear.adoc index 5a6bf6f..45237d6 100644 --- a/docs/commands/references/clear.adoc +++ b/docs/commands/references/clear.adoc @@ -229,7 +229,7 @@ end mydict /value get % Stack: 42 (dictionary unaffected) ---- -TIP: Consider using link:/docs/commands/references/cleartomark/[`cleartomark`] instead of `clear` when you want to preserve elements below a certain point on the stack. +TIP: Consider using link:/commands/references/cleartomark/[`cleartomark`] instead of `clear` when you want to preserve elements below a certain point on the stack. === No Error on Empty Stack @@ -244,10 +244,10 @@ count % Stack: 0 == Related Commands -* link:/docs/commands/references/pop/[`pop`] - Remove single element -* link:/docs/commands/references/cleartomark/[`cleartomark`] - Remove elements up to a mark -* link:/docs/commands/references/count/[`count`] - Check if stack is empty -* link:/docs/commands/references/mark/[`mark`] - Place marker for selective clearing +* link:/commands/references/pop/[`pop`] - Remove single element +* link:/commands/references/cleartomark/[`cleartomark`] - Remove elements up to a mark +* link:/commands/references/count/[`count`] - Check if stack is empty +* link:/commands/references/mark/[`mark`] - Place marker for selective clearing == PostScript Level @@ -268,7 +268,7 @@ Clearing is faster than individually popping each element. == Best Practices 1. **Use sparingly**: Only clear when you truly need to discard all stack contents -2. **Consider alternatives**: Use link:/docs/commands/references/pop/[`pop`] for selective removal or link:/docs/commands/references/cleartomark/[`cleartomark`] for bounded clearing +2. **Consider alternatives**: Use link:/commands/references/pop/[`pop`] for selective removal or link:/commands/references/cleartomark/[`cleartomark`] for bounded clearing 3. **Error recovery**: Excellent for recovering from errors and resetting to known state 4. **Document intent**: Always comment why you're clearing the stack 5. **Test carefully**: Ensure you're not accidentally discarding needed data @@ -319,7 +319,7 @@ add % Use the values == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/error-handling/[Error Handling] - Using clear for error recovery -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/error-handling/[Error Handling] - Using clear for error recovery +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/cleartomark.adoc b/docs/commands/references/cleartomark.adoc index b884634..edb78d6 100644 --- a/docs/commands/references/cleartomark.adoc +++ b/docs/commands/references/cleartomark.adoc @@ -12,7 +12,7 @@ Removes all elements from the operand stack down to and including the topmost ma The `cleartomark` operator pops the operand stack repeatedly until it encounters a mark object, which it also pops and discards. All objects between the top of the stack and the mark (exclusive of the mark itself) are discarded along with the mark. -This operator is commonly used to clean up after variable-argument operations or to discard intermediate results that were accumulated after placing a mark. It's the complement to link:/docs/commands/references/mark/[`mark`] for managing stack segments. +This operator is commonly used to clean up after variable-argument operations or to discard intermediate results that were accumulated after placing a mark. It's the complement to link:/commands/references/mark/[`mark`] for managing stack segments. This is a Level 1 operator, available in all PostScript implementations. @@ -252,7 +252,7 @@ cleartomark % Stack: 10 20 30 (top elements and mark removed) ---- -TIP: Always pair link:/docs/commands/references/mark/[`mark`] with `cleartomark` to avoid accumulating marks on the stack. Verify mark existence before calling `cleartomark` in defensive code. +TIP: Always pair link:/commands/references/mark/[`mark`] with `cleartomark` to avoid accumulating marks on the stack. Verify mark existence before calling `cleartomark` in defensive code. === Clearing Empty Segment @@ -268,10 +268,10 @@ mark pop % Stack: (empty) == Related Commands -* link:/docs/commands/references/mark/[`mark`] - Push a mark object onto stack -* link:/docs/commands/references/counttomark/[`counttomark`] - Count elements to nearest mark -* link:/docs/commands/references/clear/[`clear`] - Remove all elements from stack -* link:/docs/commands/references/pop/[`pop`] - Remove single element +* link:/commands/references/mark/[`mark`] - Push a mark object onto stack +* link:/commands/references/counttomark/[`counttomark`] - Count elements to nearest mark +* link:/commands/references/clear/[`clear`] - Remove all elements from stack +* link:/commands/references/pop/[`pop`] - Remove single element * `]` - Create array and remove mark (essentially cleartomark + array construction) == PostScript Level @@ -300,7 +300,7 @@ The operator must scan the stack to find the mark, so very deep marks are slight == Best Practices -1. **Always pair with mark**: Every link:/docs/commands/references/mark/[`mark`] should have a matching `cleartomark` or `]` +1. **Always pair with mark**: Every link:/commands/references/mark/[`mark`] should have a matching `cleartomark` or `]` 2. **Use for cleanup**: Excellent for cleaning up intermediate results 3. **Check for mark**: In defensive code, verify mark exists before calling 4. **Document mark usage**: Make it clear when procedures use marked segments @@ -352,7 +352,7 @@ The operator must scan the stack to find the mark, so very deep marks are slight == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/error-handling/[Error Handling] - Using marks for cleanup -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/error-handling/[Error Handling] - Using marks for cleanup +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/clip.adoc b/docs/commands/references/clip.adoc index 036d91f..ace6d18 100644 --- a/docs/commands/references/clip.adoc +++ b/docs/commands/references/clip.adoc @@ -37,13 +37,13 @@ Intersects the current clipping path with the current path using the non-zero wi === Description -link:/docs/commands/references/clip/[`clip`] intersects the inside of the current clipping path with the inside of the current path to produce a new, smaller current clipping path. The inside of the current path is determined by the normal PostScript non-zero winding number rule, while the inside of the current clipping path is determined by whatever rule was used at the time that path was created. +link:/commands/references/clip/[`clip`] intersects the inside of the current clipping path with the inside of the current path to produce a new, smaller current clipping path. The inside of the current path is determined by the normal PostScript non-zero winding number rule, while the inside of the current clipping path is determined by whatever rule was used at the time that path was created. -In general, link:/docs/commands/references/clip/[`clip`] produces a new path whose inside (according to the non-zero winding number rule) consists of all areas that are inside both of the original paths. The way this new path is constructed (the order of its segments, whether it self-intersects, etc.) is not specified. +In general, link:/commands/references/clip/[`clip`] produces a new path whose inside (according to the non-zero winding number rule) consists of all areas that are inside both of the original paths. The way this new path is constructed (the order of its segments, whether it self-intersects, etc.) is not specified. -link:/docs/commands/references/clip/[`clip`] treats an open subpath of the current path as though it were closed; it does not actually alter the path itself. It is permissible for the current path to be empty. The result of executing link:/docs/commands/references/clip/[`clip`] is always a non-empty clipping path, though it may enclose zero area. +link:/commands/references/clip/[`clip`] treats an open subpath of the current path as though it were closed; it does not actually alter the path itself. It is permissible for the current path to be empty. The result of executing link:/commands/references/clip/[`clip`] is always a non-empty clipping path, though it may enclose zero area. -Unlike link:/docs/commands/references/fill/[`fill`] and link:/docs/commands/references/stroke/[`stroke`], link:/docs/commands/references/clip/[`clip`] does not implicitly perform a link:/docs/commands/references/newpath/[`newpath`] after it has finished using the current path. +Unlike link:/commands/references/fill/[`fill`] and link:/commands/references/stroke/[`stroke`], link:/commands/references/clip/[`clip`] does not implicitly perform a link:/commands/references/newpath/[`newpath`] after it has finished using the current path. === PostScript Level @@ -116,7 +116,7 @@ newpath gsave % Create mask newpath - 100 100 80 60 link:/docs/commands/references/arc/[`arc`] + 100 100 80 60 link:/commands/references/arc/[`arc`] closepath clip newpath @@ -168,22 +168,22 @@ grestore === Common Pitfalls -WARNING: *Clipping Can Only Shrink* - There is no way to enlarge the current clipping path except by link:/docs/commands/references/grestore/[`grestore`] or `initclip`. +WARNING: *Clipping Can Only Shrink* - There is no way to enlarge the current clipping path except by link:/commands/references/grestore/[`grestore`] or `initclip`. [source,postscript] ---- % First clip newpath -50 50 100 100 link:/docs/commands/references/arc/[`arc`] +50 50 100 100 link:/commands/references/arc/[`arc`] clip % Can't expand beyond this newpath -0 0 200 200 link:/docs/commands/references/arc/[`arc`] +0 0 200 200 link:/commands/references/arc/[`arc`] clip % Still limited to intersection ---- -WARNING: *Path Not Cleared After clip* - Unlike link:/docs/commands/references/fill/[`fill`] and link:/docs/commands/references/stroke/[`stroke`], the path remains after link:/docs/commands/references/clip/[`clip`]. +WARNING: *Path Not Cleared After clip* - Unlike link:/commands/references/fill/[`fill`] and link:/commands/references/stroke/[`stroke`], the path remains after link:/commands/references/clip/[`clip`]. [source,postscript] ---- @@ -238,7 +238,7 @@ grestore === Implementation Notes * The clipping path is maintained separately from the current path -* Clipping is applied during rendering of link:/docs/commands/references/fill/[`fill`], link:/docs/commands/references/stroke/[`stroke`], `show`, etc. +* Clipping is applied during rendering of link:/commands/references/fill/[`fill`], link:/commands/references/stroke/[`stroke`], `show`, etc. * Complex clipping paths may degrade rendering performance * The clipping path can become arbitrarily complex through repeated clips * Some implementations may have limits on clipping path complexity @@ -247,22 +247,22 @@ grestore The clipping path is part of the graphics state and is affected by: -* link:/docs/commands/references/gsave/[`gsave`] - Saves current clipping path -* link:/docs/commands/references/grestore/[`grestore`] - Restores saved clipping path +* link:/commands/references/gsave/[`gsave`] - Saves current clipping path +* link:/commands/references/grestore/[`grestore`] - Restores saved clipping path * `initclip` - Resets to device default * `save`/`restore` - Saves/restores with VM state The clipping path affects: -* link:/docs/commands/references/fill/[`fill`] and link:/docs/commands/references/eofill/[`eofill`] - Clip filled area -* link:/docs/commands/references/stroke/[`stroke`] - Clip stroked lines +* link:/commands/references/fill/[`fill`] and link:/commands/references/eofill/[`eofill`] - Clip filled area +* link:/commands/references/stroke/[`stroke`] - Clip stroked lines * `show` and text operators - Clip character outlines * `image` and `imagemask` - Clip images * All painting operations === Winding Number Rule -link:/docs/commands/references/clip/[`clip`] uses the non-zero winding number rule: +link:/commands/references/clip/[`clip`] uses the non-zero winding number rule: . Draw a ray from the point in any direction . Count crossings with path segments: @@ -281,7 +281,7 @@ This means path direction matters and can create solid fills from complex paths. % Good practice gsave newpath - 100 100 80 60 link:/docs/commands/references/arc/[`arc`] + 100 100 80 60 link:/commands/references/arc/[`arc`] closepath clip newpath @@ -381,14 +381,14 @@ grestore gsave % Outer clip newpath - 50 50 200 200 link:/docs/commands/references/arc/[`arc`] + 50 50 200 200 link:/commands/references/arc/[`arc`] clip newpath gsave % Inner clip (intersection) newpath - 100 100 100 100 link:/docs/commands/references/arc/[`arc`] + 100 100 100 100 link:/commands/references/arc/[`arc`] clip newpath @@ -404,13 +404,13 @@ grestore === See Also -* link:/docs/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule -* link:/docs/commands/references/clippath/[`clippath`] - Get current clipping path +* link:/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule +* link:/commands/references/clippath/[`clippath`] - Get current clipping path * `rectclip` - Clip to rectangles (Level 2) * `initclip` - Reset to device default -* link:/docs/commands/references/fill/[`fill`] - Fill path -* link:/docs/commands/references/stroke/[`stroke`] - Stroke path -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file +* link:/commands/references/fill/[`fill`] - Fill path +* link:/commands/references/stroke/[`stroke`] - Stroke path +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file diff --git a/docs/commands/references/clippath.adoc b/docs/commands/references/clippath.adoc index f85e71f..c54b906 100644 --- a/docs/commands/references/clippath.adoc +++ b/docs/commands/references/clippath.adoc @@ -37,11 +37,11 @@ Sets the current path to the current clipping path. === Description -link:/docs/commands/references/clippath/[`clippath`] sets the current path to one that describes the current clipping path. This operator is useful for determining the exact extent of the imaging area on the current output device. +link:/commands/references/clippath/[`clippath`] sets the current path to one that describes the current clipping path. This operator is useful for determining the exact extent of the imaging area on the current output device. -If the current clipping path is the result of application of the link:/docs/commands/references/clip/[`clip`] or link:/docs/commands/references/eoclip/[`eoclip`] operator, the path set by link:/docs/commands/references/clippath/[`clippath`] is generally suitable only for filling or clipping. It is not suitable for stroking because it may contain interior segments or disconnected subpaths produced by the clipping process. +If the current clipping path is the result of application of the link:/commands/references/clip/[`clip`] or link:/commands/references/eoclip/[`eoclip`] operator, the path set by link:/commands/references/clippath/[`clippath`] is generally suitable only for filling or clipping. It is not suitable for stroking because it may contain interior segments or disconnected subpaths produced by the clipping process. -The path returned by link:/docs/commands/references/clippath/[`clippath`] describes the clipping region as it exists in user space coordinates, transformed through the current transformation matrix (CTM). +The path returned by link:/commands/references/clippath/[`clippath`] describes the clipping region as it exists in user space coordinates, transformed through the current transformation matrix (CTM). === PostScript Level @@ -159,7 +159,7 @@ showClipBorder === Common Pitfalls -WARNING: *Result May Not Be Suitable for Stroking* - If the clip was created with link:/docs/commands/references/clip/[`clip`] or link:/docs/commands/references/eoclip/[`eoclip`], the path may have interior segments. +WARNING: *Result May Not Be Suitable for Stroking* - If the clip was created with link:/commands/references/clip/[`clip`] or link:/commands/references/eoclip/[`eoclip`], the path may have interior segments. [source,postscript] ---- @@ -186,7 +186,7 @@ clippath % Returns coordinates in scaled space pathbbox % Bounds reflect current CTM ---- -WARNING: *Replaces Current Path* - link:/docs/commands/references/clippath/[`clippath`] replaces any existing current path. +WARNING: *Replaces Current Path* - link:/commands/references/clippath/[`clippath`] replaces any existing current path. [source,postscript] ---- @@ -197,7 +197,7 @@ newpath clippath % Previous path is lost ---- -TIP: *Use for Bounds Checking* - link:/docs/commands/references/clippath/[`clippath`] with `pathbbox` gives exact drawable area: +TIP: *Use for Bounds Checking* - link:/commands/references/clippath/[`clippath`] with `pathbbox` gives exact drawable area: [source,postscript] ---- @@ -211,11 +211,11 @@ pop pop % Remove llx lly === Error Conditions -None. link:/docs/commands/references/clippath/[`clippath`] cannot generate errors. +None. link:/commands/references/clippath/[`clippath`] cannot generate errors. === Implementation Notes -* The path set by link:/docs/commands/references/clippath/[`clippath`] may be complex if multiple clip operations were performed +* The path set by link:/commands/references/clippath/[`clippath`] may be complex if multiple clip operations were performed * The path accurately represents the intersection of all previous clip operations * The path is always closed and suitable for filling * Device-default clip paths are typically rectangular @@ -223,12 +223,12 @@ None. link:/docs/commands/references/clippath/[`clippath`] cannot generate error === Interaction with Graphics State -link:/docs/commands/references/clippath/[`clippath`] is affected by: +link:/commands/references/clippath/[`clippath`] is affected by: * Current clipping path - This is what gets returned * Current transformation matrix (CTM) - Path is returned in user space -link:/docs/commands/references/clippath/[`clippath`] affects: +link:/commands/references/clippath/[`clippath`] affects: * Current path - Replaced with the clip path * Nothing else in graphics state @@ -372,11 +372,11 @@ getDrawingArea === Performance Considerations -* link:/docs/commands/references/clippath/[`clippath`] is a fast operation +* link:/commands/references/clippath/[`clippath`] is a fast operation * The complexity of the returned path depends on clipping history * Very complex clipping paths may result in large path structures -* Using `pathbbox` after link:/docs/commands/references/clippath/[`clippath`] is efficient for bounds checking -* No rendering is performed by link:/docs/commands/references/clippath/[`clippath`] itself +* Using `pathbbox` after link:/commands/references/clippath/[`clippath`] is efficient for bounds checking +* No rendering is performed by link:/commands/references/clippath/[`clippath`] itself === Common Patterns @@ -410,12 +410,12 @@ clippath fill === See Also -* link:/docs/commands/references/clip/[`clip`] - Set clipping path (non-zero winding) -* link:/docs/commands/references/eoclip/[`eoclip`] - Set clipping path (even-odd rule) +* link:/commands/references/clip/[`clip`] - Set clipping path (non-zero winding) +* link:/commands/references/eoclip/[`eoclip`] - Set clipping path (even-odd rule) * `initclip` - Reset to device default * `rectclip` - Clip to rectangles (Level 2) * `pathbbox` - Get path bounding box * `infill` - Test if point inside path -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state +* link:/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file diff --git a/docs/commands/references/closepath.adoc b/docs/commands/references/closepath.adoc index 7852b7b..2e2f727 100644 --- a/docs/commands/references/closepath.adoc +++ b/docs/commands/references/closepath.adoc @@ -37,11 +37,11 @@ Closes the current subpath by adding a straight line back to its starting point. === Description -link:/docs/commands/references/closepath/[`closepath`] closes the current subpath by appending a straight line segment connecting the current point to the subpath's starting point—generally, the point most recently specified by link:/docs/commands/references/moveto/[`moveto`]. +link:/commands/references/closepath/[`closepath`] closes the current subpath by appending a straight line segment connecting the current point to the subpath's starting point—generally, the point most recently specified by link:/commands/references/moveto/[`moveto`]. -If the current subpath is already closed or the current path is empty, link:/docs/commands/references/closepath/[`closepath`] does nothing. +If the current subpath is already closed or the current path is empty, link:/commands/references/closepath/[`closepath`] does nothing. -link:/docs/commands/references/closepath/[`closepath`] terminates the current subpath. Appending another segment to the current path will begin a new subpath, even if it is drawn from the endpoint reached by link:/docs/commands/references/closepath/[`closepath`]. +link:/commands/references/closepath/[`closepath`] terminates the current subpath. Appending another segment to the current path will begin a new subpath, even if it is drawn from the endpoint reached by link:/commands/references/closepath/[`closepath`]. === PostScript Level @@ -159,7 +159,7 @@ stroke % Clean miter join at corner === Common Pitfalls -WARNING: *Line Cap at Close Point* - The line cap setting doesn't affect the join where link:/docs/commands/references/closepath/[`closepath`] connects. The line join setting applies instead. +WARNING: *Line Cap at Close Point* - The line cap setting doesn't affect the join where link:/commands/references/closepath/[`closepath`] connects. The line join setting applies instead. [source,postscript] ---- @@ -173,7 +173,7 @@ closepath stroke % Join at (100,100) is mitered, not rounded ---- -WARNING: *Not Needed for All Shapes* - Complete arcs (0 to 360) are automatically closed. Adding link:/docs/commands/references/closepath/[`closepath`] doesn't hurt, but it's redundant. +WARNING: *Not Needed for All Shapes* - Complete arcs (0 to 360) are automatically closed. Adding link:/commands/references/closepath/[`closepath`] doesn't hurt, but it's redundant. [source,postscript] ---- @@ -182,7 +182,7 @@ newpath closepath % Redundant but harmless ---- -TIP: *Always Close Filled Paths* - For clean fills and strokes, always use link:/docs/commands/references/closepath/[`closepath`] to close shapes, even if the endpoints are very close. +TIP: *Always Close Filled Paths* - For clean fills and strokes, always use link:/commands/references/closepath/[`closepath`] to close shapes, even if the endpoints are very close. === Error Conditions @@ -194,20 +194,20 @@ TIP: *Always Close Filled Paths* - For clean fills and strokes, always use link: | Path becomes too complex for implementation |=== -Note: link:/docs/commands/references/closepath/[`closepath`] does not require a current point and will not generate a [`nocurrentpoint`] error. +Note: link:/commands/references/closepath/[`closepath`] does not require a current point and will not generate a [`nocurrentpoint`] error. === Implementation Notes * Creates an explicit line segment in the path * The closing segment participates in line join calculations -* Current point after link:/docs/commands/references/closepath/[`closepath`] is the subpath start point +* Current point after link:/commands/references/closepath/[`closepath`] is the subpath start point * Subsequent path operations start a new subpath * Has no effect on empty paths or already-closed subpaths * Essential for proper fill and stroke behavior === Behavior Details -The behavior differs from simply using link:/docs/commands/references/lineto/[`lineto`] back to the starting point: +The behavior differs from simply using link:/commands/references/lineto/[`lineto`] back to the starting point: [source,postscript] ---- @@ -239,8 +239,8 @@ closepath % Back to start, subpath closed === See Also -* link:/docs/commands/references/newpath/[`newpath`] - Initialize empty path -* link:/docs/commands/references/moveto/[`moveto`] - Start new subpath -* link:/docs/commands/references/lineto/[`lineto`] - Add straight line segment -* link:/docs/commands/references/arc/[`arc`] - Add circular arc -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/newpath/[`newpath`] - Initialize empty path +* link:/commands/references/moveto/[`moveto`] - Start new subpath +* link:/commands/references/lineto/[`lineto`] - Add straight line segment +* link:/commands/references/arc/[`arc`] - Add circular arc +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/concat.adoc b/docs/commands/references/concat.adoc index 3a15e02..f5abf08 100644 --- a/docs/commands/references/concat.adoc +++ b/docs/commands/references/concat.adoc @@ -37,7 +37,7 @@ matrix concat → - === Description -link:/docs/commands/references/concat/[`concat`] concatenates `matrix` with the current transformation matrix (CTM). Precisely, link:/docs/commands/references/concat/[`concat`] replaces the CTM by matrix × CTM. +link:/commands/references/concat/[`concat`] concatenates `matrix` with the current transformation matrix (CTM). Precisely, link:/commands/references/concat/[`concat`] replaces the CTM by matrix × CTM. The effect is to define a new user space whose coordinates are transformed into the former user space according to `matrix`. This allows arbitrary transformations including combinations of translation, scaling, rotation, and skewing. @@ -183,7 +183,7 @@ WARNING: *Order of Operations* - Matrix multiplication is not commutative. Order [2 0 0 2 0 0] concat % Then scale ---- -TIP: *Use Helper Operators* - For simple transformations, use link:/docs/commands/references/translate/[`translate`], link:/docs/commands/references/scale/[`scale`], and link:/docs/commands/references/rotate/[`rotate`] instead of link:/docs/commands/references/concat/[`concat`]. +TIP: *Use Helper Operators* - For simple transformations, use link:/commands/references/translate/[`translate`], link:/commands/references/scale/[`scale`], and link:/commands/references/rotate/[`rotate`] instead of link:/commands/references/concat/[`concat`]. [source,postscript] ---- @@ -224,7 +224,7 @@ myMatrix concat % Apply it === Implementation Notes -* The matrix operand is not modified by link:/docs/commands/references/concat/[`concat`] +* The matrix operand is not modified by link:/commands/references/concat/[`concat`] * Very large or very small matrix values may cause precision loss * Degenerate matrices (determinant = 0) create non-invertible transformations * The operation is equivalent to: CTM' = matrix × CTM @@ -243,7 +243,7 @@ And the current CTM: CTM = [a₀ b₀ c₀ d₀ tx₀ ty₀] ---- -link:/docs/commands/references/concat/[`concat`] computes: +link:/commands/references/concat/[`concat`] computes: ---- CTM' = M × CTM @@ -292,10 +292,10 @@ A general transformation matrix can represent: === Performance Considerations -* link:/docs/commands/references/concat/[`concat`] is a lightweight operation +* link:/commands/references/concat/[`concat`] is a lightweight operation * No path recomputation is required * Matrix multiplication is optimized -* Using link:/docs/commands/references/concat/[`concat`] with precomputed matrices can be faster than multiple individual transformations +* Using link:/commands/references/concat/[`concat`] with precomputed matrices can be faster than multiple individual transformations === Relationship to Other Operators @@ -338,12 +338,12 @@ concat === See Also -* link:/docs/commands/references/translate/[`translate`] - Move origin -* link:/docs/commands/references/scale/[`scale`] - Change unit size -* link:/docs/commands/references/rotate/[`rotate`] - Rotate axes -* link:/docs/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/matrix/[`matrix`] - Create identity matrix -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/translate/[`translate`] - Move origin +* link:/commands/references/scale/[`scale`] - Change unit size +* link:/commands/references/rotate/[`rotate`] - Rotate axes +* link:/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices +* link:/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/matrix/[`matrix`] - Create identity matrix +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/concatmatrix.adoc b/docs/commands/references/concatmatrix.adoc index 8ea75de..a63ba65 100644 --- a/docs/commands/references/concatmatrix.adoc +++ b/docs/commands/references/concatmatrix.adoc @@ -43,7 +43,7 @@ matrix1 matrix2 matrix3 concatmatrix → matrix3 === Description -link:/docs/commands/references/concatmatrix/[`concatmatrix`] replaces the value of `matrix3` with the result of multiplying matrix1 × matrix2, and pushes the modified `matrix3` back on the operand stack. +link:/commands/references/concatmatrix/[`concatmatrix`] replaces the value of `matrix3` with the result of multiplying matrix1 × matrix2, and pushes the modified `matrix3` back on the operand stack. This operator performs matrix multiplication without affecting the current transformation matrix (CTM). It is useful for building complex transformations from simpler ones. @@ -227,7 +227,7 @@ M₁ = [a₁ b₁ c₁ d₁ tx₁ ty₁] M₂ = [a₂ b₂ c₂ d₂ tx₂ ty₂] ---- -link:/docs/commands/references/concatmatrix/[`concatmatrix`] computes M₃ = M₁ × M₂: +link:/commands/references/concatmatrix/[`concatmatrix`] computes M₃ = M₁ × M₂: ---- M₃ = [a₁×a₂ + b₁×c₂ a₁×b₂ + b₁×d₂ @@ -308,9 +308,9 @@ m1 temp2 result concatmatrix === See Also -* link:/docs/commands/references/concat/[`concat`] - Concatenate matrix with CTM -* link:/docs/commands/references/matrix/[`matrix`] - Create identity matrix -* link:/docs/commands/references/invertmatrix/[`invertmatrix`] - Invert a matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Set the CTM -* link:/docs/commands/references/transform/[`transform`] - Transform coordinates by matrix \ No newline at end of file +* link:/commands/references/concat/[`concat`] - Concatenate matrix with CTM +* link:/commands/references/matrix/[`matrix`] - Create identity matrix +* link:/commands/references/invertmatrix/[`invertmatrix`] - Invert a matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/setmatrix/[`setmatrix`] - Set the CTM +* link:/commands/references/transform/[`transform`] - Transform coordinates by matrix \ No newline at end of file diff --git a/docs/commands/references/copy.adoc b/docs/commands/references/copy.adoc index ec6fc90..309b361 100644 --- a/docs/commands/references/copy.adoc +++ b/docs/commands/references/copy.adoc @@ -287,10 +287,10 @@ TIP: The composite form of `copy` performs only one level of copying. Nested com == Related Commands -* link:/docs/commands/references/dup/[`dup`] - Duplicate single element (reference only) -* link:/docs/commands/[`index`] - Duplicate nth element -* link:/docs/commands/references/roll/[`roll`] - Rotate stack elements -* link:/docs/commands/references/pop/[`pop`] - Remove elements +* link:/commands/references/dup/[`dup`] - Duplicate single element (reference only) +* link:/commands/[`index`] - Duplicate nth element +* link:/commands/references/roll/[`roll`] - Rotate stack elements +* link:/commands/references/pop/[`pop`] - Remove elements * `get` - Retrieve individual elements * `put` - Store individual elements * `putinterval` - Store subsequence @@ -384,7 +384,7 @@ Attempting to copy into a read-only object, or copying local VM objects into glo == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/basic/composite-objects/[Composite Objects] - Understanding object copying -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/basic/composite-objects/[Composite Objects] - Understanding object copying +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/cos.adoc b/docs/commands/references/cos.adoc index f13d752..ba928ea 100644 --- a/docs/commands/references/cos.adoc +++ b/docs/commands/references/cos.adoc @@ -66,8 +66,8 @@ WARNING: PostScript uses *degrees*, not radians! == Related Commands -* link:/docs/commands/references/sin/[`sin`] - Sine (degrees) -* link:/docs/commands/references/atan/[`atan`] - Arctangent (returns degrees) +* link:/commands/references/sin/[`sin`] - Sine (degrees) +* link:/commands/references/atan/[`atan`] - Arctangent (returns degrees) == PostScript Level @@ -83,4 +83,4 @@ The operand is not a number. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/count.adoc b/docs/commands/references/count.adoc index c1aafd6..e8c0b7e 100644 --- a/docs/commands/references/count.adoc +++ b/docs/commands/references/count.adoc @@ -232,11 +232,11 @@ TIP: Use `count` immediately before the operation that needs to know stack depth == Related Commands -* link:/docs/commands/references/counttomark/[`counttomark`] - Count elements until a mark -* link:/docs/commands/references/clear/[`clear`] - Remove all elements from stack -* link:/docs/commands/references/pop/[`pop`] - Remove single element -* link:/docs/commands/references/copy/[`copy`] - Copy n elements -* link:/docs/commands/references/roll/[`roll`] - Rotate n elements +* link:/commands/references/counttomark/[`counttomark`] - Count elements until a mark +* link:/commands/references/clear/[`clear`] - Remove all elements from stack +* link:/commands/references/pop/[`pop`] - Remove single element +* link:/commands/references/copy/[`copy`] - Copy n elements +* link:/commands/references/roll/[`roll`] - Rotate n elements == PostScript Level @@ -310,7 +310,7 @@ Use `count` freely for debugging and stack management without performance concer == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/debugging/[Debugging Guide] - Using count for debugging -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/debugging/[Debugging Guide] - Using count for debugging +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/countdictstack.adoc b/docs/commands/references/countdictstack.adoc index 7aee454..3b59270 100644 --- a/docs/commands/references/countdictstack.adoc +++ b/docs/commands/references/countdictstack.adoc @@ -37,9 +37,9 @@ Returns the number of dictionaries currently on the dictionary stack. === Description -link:/docs/commands/references/countdictstack/[`countdictstack`] counts the number of dictionaries currently on the dictionary stack and pushes this count onto the operand stack. +link:/commands/references/countdictstack/[`countdictstack`] counts the number of dictionaries currently on the dictionary stack and pushes this count onto the operand stack. -The count includes all dictionaries: permanent system dictionaries and any pushed by link:/docs/commands/references/begin/[`begin`]. +The count includes all dictionaries: permanent system dictionaries and any pushed by link:/commands/references/begin/[`begin`]. === PostScript Level @@ -158,8 +158,8 @@ TIP: *Use for Defensive Programming* - Check dictionary stack balance in error h === See Also -* link:/docs/commands/references/dictstack/[`dictstack`] - Copy dict stack to array -* link:/docs/commands/references/begin/[`begin`] - Push dictionary -* link:/docs/commands/references/end/[`end`] - Pop dictionary -* link:/docs/commands/references/currentdict/[`currentdict`] - Get current dictionary -* link:/docs/commands/references/count/[`count`] - Count operand stack depth \ No newline at end of file +* link:/commands/references/dictstack/[`dictstack`] - Copy dict stack to array +* link:/commands/references/begin/[`begin`] - Push dictionary +* link:/commands/references/end/[`end`] - Pop dictionary +* link:/commands/references/currentdict/[`currentdict`] - Get current dictionary +* link:/commands/references/count/[`count`] - Count operand stack depth \ No newline at end of file diff --git a/docs/commands/references/counttomark.adoc b/docs/commands/references/counttomark.adoc index 376082e..add7da3 100644 --- a/docs/commands/references/counttomark.adoc +++ b/docs/commands/references/counttomark.adoc @@ -12,7 +12,7 @@ Counts the number of elements on the operand stack from the top down to (but not The `counttomark` operator counts how many elements are on the operand stack between the top and the nearest mark object (searching from top to bottom). The mark itself is not counted, and the stack is left unchanged except for the count value being pushed. -This operator is essential for implementing variable-argument procedures where the number of arguments is not known in advance. It's commonly used with link:/docs/commands/references/mark/[`mark`] to process all elements in a marked segment. +This operator is essential for implementing variable-argument procedures where the number of arguments is not known in advance. It's commonly used with link:/commands/references/mark/[`mark`] to process all elements in a marked segment. This is a Level 1 operator, available in all PostScript implementations. @@ -288,11 +288,11 @@ counttomark % Stack: mark 0 == Related Commands -* link:/docs/commands/references/mark/[`mark`] - Push a mark object onto stack -* link:/docs/commands/references/cleartomark/[`cleartomark`] - Remove elements down to and including mark -* link:/docs/commands/references/count/[`count`] - Count total stack depth +* link:/commands/references/mark/[`mark`] - Push a mark object onto stack +* link:/commands/references/cleartomark/[`cleartomark`] - Remove elements down to and including mark +* link:/commands/references/count/[`count`] - Count total stack depth * `]` - Create array from marked elements -* link:/docs/commands/references/pop/[`pop`] - Remove single element +* link:/commands/references/pop/[`pop`] - Remove single element == PostScript Level @@ -328,7 +328,7 @@ For very deep marks, this can be slightly expensive, but in practice marked segm == Best Practices -1. **Use with mark**: Always ensure a link:/docs/commands/references/mark/[`mark`] exists before calling `counttomark` +1. **Use with mark**: Always ensure a link:/commands/references/mark/[`mark`] exists before calling `counttomark` 2. **Immediate use**: Use the count value immediately; don't store it for later 3. **Variable arguments**: Ideal for implementing procedures with variable-length argument lists 4. **Document expectations**: Clearly document when procedures expect marked arguments @@ -400,7 +400,7 @@ For very deep marks, this can be slightly expensive, but in practice marked segm == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/basic/procedures/[Procedures] - Implementing variable-argument functions -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/basic/procedures/[Procedures] - Implementing variable-argument functions +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/cshow.adoc b/docs/commands/references/cshow.adoc index dcbf253..73e2118 100644 --- a/docs/commands/references/cshow.adoc +++ b/docs/commands/references/cshow.adoc @@ -33,16 +33,16 @@ proc string === Description -link:/docs/commands/references/cshow/[`cshow`] invokes `proc` once for each operation of the font mapping algorithm. The value of link:/docs/commands/references/currentfont/[`currentfont`] during the execution of `proc` is the base font that the algorithm ultimately selects. +link:/commands/references/cshow/[`cshow`] invokes `proc` once for each operation of the font mapping algorithm. The value of link:/commands/references/currentfont/[`currentfont`] during the execution of `proc` is the base font that the algorithm ultimately selects. When `proc` is invoked, the stack contains three values: 1. The selected character's code (an integer) 2. The x component of the width vector for the character in user coordinate system 3. The y component of the width vector for the character in user coordinate system -link:/docs/commands/references/cshow/[`cshow`] does not paint the character and does not change the current point, although `proc` may do so. When `proc` completes execution, the value of link:/docs/commands/references/currentfont/[`currentfont`] is restored. +link:/commands/references/cshow/[`cshow`] does not paint the character and does not change the current point, although `proc` may do so. When `proc` completes execution, the value of link:/commands/references/currentfont/[`currentfont`] is restored. -link:/docs/commands/references/cshow/[`cshow`] can be used to provide careful positioning of individual characters while taking advantage of the composite font mapping machinery of the interpreter. link:/docs/commands/references/cshow/[`cshow`] is intended primarily for use with composite fonts. However, it can also be used with a base font. The mapping algorithm for a base font simply selects consecutive characters from the string. +link:/commands/references/cshow/[`cshow`] can be used to provide careful positioning of individual characters while taking advantage of the composite font mapping machinery of the interpreter. link:/commands/references/cshow/[`cshow`] is intended primarily for use with composite fonts. However, it can also be used with a base font. The mapping algorithm for a base font simply selects consecutive characters from the string. === Parameters @@ -180,7 +180,7 @@ Where: === Font Mapping with Composite Fonts -For composite fonts, link:/docs/commands/references/cshow/[`cshow`] invokes the font mapping algorithm: +For composite fonts, link:/commands/references/cshow/[`cshow`] invokes the font mapping algorithm: 1. **FMapType** determines how to map string bytes to font selection 2. Selected base font becomes current during `proc` execution @@ -294,24 +294,24 @@ end /MyComposite exch definefont pop |=== | Operator | Best For -| link:/docs/commands/references/show/[`show`] +| link:/commands/references/show/[`show`] | Simple, fast text rendering -| link:/docs/commands/references/kshow/[`kshow`] +| link:/commands/references/kshow/[`kshow`] | Kerning between character pairs (base fonts only) -| link:/docs/commands/references/cshow/[`cshow`] +| link:/commands/references/cshow/[`cshow`] | Per-character control with composite fonts -| link:/docs/commands/references/charpath/[`charpath`] +| link:/commands/references/charpath/[`charpath`] | Getting character outlines for effects |=== === See Also -- link:/docs/commands/references/show/[`show`] - Basic text painting -- link:/docs/commands/references/ashow/[`ashow`] - Show with uniform spacing -- link:/docs/commands/references/kshow/[`kshow`] - Show with kerning procedure -- link:/docs/commands/references/currentfont/[`currentfont`] - Get current font +- link:/commands/references/show/[`show`] - Basic text painting +- link:/commands/references/ashow/[`ashow`] - Show with uniform spacing +- link:/commands/references/kshow/[`kshow`] - Show with kerning procedure +- link:/commands/references/currentfont/[`currentfont`] - Get current font - `glyphshow` - Show glyph by name - `rootfont` - Get root composite font \ No newline at end of file diff --git a/docs/commands/references/currentcmykcolor.adoc b/docs/commands/references/currentcmykcolor.adoc index 91f1443..01af0d2 100644 --- a/docs/commands/references/currentcmykcolor.adoc +++ b/docs/commands/references/currentcmykcolor.adoc @@ -46,11 +46,11 @@ Returns current color as CMYK values. === Description -link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] returns the current color in the graphics state according to the cyan-magenta-yellow-black color space. +link:/commands/references/currentcmykcolor/[`currentcmykcolor`] returns the current color in the graphics state according to the cyan-magenta-yellow-black color space. -* If the current color space is **DeviceCMYK**, link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] returns the color values most recently specified by link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] or [`setcolor`]. -* If the current color space is **DeviceRGB** or **DeviceGray**, link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] converts the current color to CMYK. -* For any other color space, link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] returns **0.0 0.0 0.0 1.0** (black). +* If the current color space is **DeviceCMYK**, link:/commands/references/currentcmykcolor/[`currentcmykcolor`] returns the color values most recently specified by link:/commands/references/setcmykcolor/[`setcmykcolor`] or [`setcolor`]. +* If the current color space is **DeviceRGB** or **DeviceGray**, link:/commands/references/currentcmykcolor/[`currentcmykcolor`] converts the current color to CMYK. +* For any other color space, link:/commands/references/currentcmykcolor/[`currentcmykcolor`] returns **0.0 0.0 0.0 1.0** (black). Each returned value is in the range 0.0 (no ink) to 1.0 (full ink coverage). @@ -285,7 +285,7 @@ No components = White (paper) === See Also -* link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) -* link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color -* link:/docs/commands/references/currentgray/[`currentgray`] - Get gray value -* link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color +* link:/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) +* link:/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color +* link:/commands/references/currentgray/[`currentgray`] - Get gray value +* link:/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color diff --git a/docs/commands/references/currentdash.adoc b/docs/commands/references/currentdash.adoc index 7bc5253..4b56dce 100644 --- a/docs/commands/references/currentdash.adoc +++ b/docs/commands/references/currentdash.adoc @@ -40,7 +40,7 @@ Returns current dash pattern and offset. === Description -link:/docs/commands/references/currentdash/[`currentdash`] returns the current dash pattern array and offset parameter from the graphics state. These are the values most recently set by link:/docs/commands/references/setdash/[`setdash`]. +link:/commands/references/currentdash/[`currentdash`] returns the current dash pattern array and offset parameter from the graphics state. These are the values most recently set by link:/commands/references/setdash/[`setdash`]. The dash pattern array specifies the pattern of dashes and gaps: @@ -166,7 +166,7 @@ GetDashLength === Common Pitfalls -WARNING: *Returned Array is Copy* - Modifying returned array requires calling link:/docs/commands/references/setdash/[`setdash`]. +WARNING: *Returned Array is Copy* - Modifying returned array requires calling link:/commands/references/setdash/[`setdash`]. [source,postscript] ---- @@ -234,7 +234,7 @@ Common patterns: === See Also -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern -* link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width -* link:/docs/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style -* link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style +* link:/commands/references/setdash/[`setdash`] - Set dash pattern +* link:/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width +* link:/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style +* link:/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style diff --git a/docs/commands/references/currentdict.adoc b/docs/commands/references/currentdict.adoc index 90cb6a5..fa5b1ea 100644 --- a/docs/commands/references/currentdict.adoc +++ b/docs/commands/references/currentdict.adoc @@ -37,7 +37,7 @@ Returns the current dictionary (top of dictionary stack). === Description -link:/docs/commands/references/currentdict/[`currentdict`] pushes the current dictionary (the dictionary on top of the dictionary stack) onto the operand stack. +link:/commands/references/currentdict/[`currentdict`] pushes the current dictionary (the dictionary on top of the dictionary stack) onto the operand stack. This does NOT pop the dictionary stack - it just pushes a duplicate reference to the top dictionary. @@ -103,7 +103,7 @@ currentdict /setting known not { === Common Pitfalls -WARNING: *Does Not Pop Dictionary Stack* - link:/docs/commands/references/currentdict/[`currentdict`] leaves dictionary stack unchanged. +WARNING: *Does Not Pop Dictionary Stack* - link:/commands/references/currentdict/[`currentdict`] leaves dictionary stack unchanged. [source,postscript] ---- @@ -142,7 +142,7 @@ currentdict { exch = = } forall % Print all entries * Very fast operation * Returns reference to actual dictionary (not a copy) -* Standard use case for link:/docs/commands/references/def/[`def`] is `currentdict key value put` +* Standard use case for link:/commands/references/def/[`def`] is `currentdict key value put` === Typical Dictionary Stack @@ -155,12 +155,12 @@ Top → Local dict (via begin) Bottom → systemdict ---- -link:/docs/commands/references/currentdict/[`currentdict`] returns the topmost dictionary. +link:/commands/references/currentdict/[`currentdict`] returns the topmost dictionary. === See Also -* link:/docs/commands/references/begin/[`begin`] - Push dictionary onto stack -* link:/docs/commands/references/end/[`end`] - Pop dictionary from stack -* link:/docs/commands/references/dictstack/[`dictstack`] - Copy entire dict stack to array -* link:/docs/commands/references/countdictstack/[`countdictstack`] - Count dictionaries on stack -* link:/docs/commands/references/def/[`def`] - Define in current dictionary \ No newline at end of file +* link:/commands/references/begin/[`begin`] - Push dictionary onto stack +* link:/commands/references/end/[`end`] - Pop dictionary from stack +* link:/commands/references/dictstack/[`dictstack`] - Copy entire dict stack to array +* link:/commands/references/countdictstack/[`countdictstack`] - Count dictionaries on stack +* link:/commands/references/def/[`def`] - Define in current dictionary \ No newline at end of file diff --git a/docs/commands/references/currentfont.adoc b/docs/commands/references/currentfont.adoc index c1fd949..6fde65a 100644 --- a/docs/commands/references/currentfont.adoc +++ b/docs/commands/references/currentfont.adoc @@ -29,9 +29,9 @@ font === Description -link:/docs/commands/references/currentfont/[`currentfont`] returns the current font dictionary in the graphics state. Normally, this is the font most recently established by link:/docs/commands/references/setfont/[`setfont`] or `selectfont`. +link:/commands/references/currentfont/[`currentfont`] returns the current font dictionary in the graphics state. Normally, this is the font most recently established by link:/commands/references/setfont/[`setfont`] or `selectfont`. -However, when executed inside a font's `BuildGlyph` or `BuildChar` procedure or a procedure invoked by link:/docs/commands/references/cshow/[`cshow`], link:/docs/commands/references/currentfont/[`currentfont`] returns the currently selected base font (descendant of a composite font). +However, when executed inside a font's `BuildGlyph` or `BuildChar` procedure or a procedure invoked by link:/commands/references/cshow/[`cshow`], link:/commands/references/currentfont/[`currentfont`] returns the currently selected base font (descendant of a composite font). === Returns @@ -96,16 +96,16 @@ currentfont /FontName get === Behavior with Composite Fonts -When link:/docs/commands/references/currentfont/[`currentfont`] is called during font construction: +When link:/commands/references/currentfont/[`currentfont`] is called during font construction: **In BuildGlyph/BuildChar procedures:** : Returns the base font selected by the composite font machinery -**In link:/docs/commands/references/cshow/[`cshow`] procedure:** +**In link:/commands/references/cshow/[`cshow`] procedure:** : Returns the base font for the current character **Normal context:** -: Returns the top-level font set by link:/docs/commands/references/setfont/[`setfont`] +: Returns the top-level font set by link:/commands/references/setfont/[`setfont`] To get the top-level composite font from within these procedures, use `rootfont` instead. @@ -167,9 +167,9 @@ The returned font dictionary typically contains: === See Also -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name -- link:/docs/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor -- link:/docs/commands/references/makefont/[`makefont`] - Transform font by matrix +- link:/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor +- link:/commands/references/makefont/[`makefont`] - Transform font by matrix - `rootfont` - Get root font of composite font -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character \ No newline at end of file +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character \ No newline at end of file diff --git a/docs/commands/references/currentgray.adoc b/docs/commands/references/currentgray.adoc index fca4a5f..d97baf4 100644 --- a/docs/commands/references/currentgray.adoc +++ b/docs/commands/references/currentgray.adoc @@ -37,11 +37,11 @@ Returns current color as gray value. === Description -link:/docs/commands/references/currentgray/[`currentgray`] returns the gray value of the current color parameter in the graphics state. +link:/commands/references/currentgray/[`currentgray`] returns the gray value of the current color parameter in the graphics state. -* If the current color space is **DeviceGray**, link:/docs/commands/references/currentgray/[`currentgray`] returns the color value most recently specified to link:/docs/commands/references/setgray/[`setgray`] or [`setcolor`]. -* If the current color space is **DeviceRGB** or **DeviceCMYK**, link:/docs/commands/references/currentgray/[`currentgray`] converts the current color to a gray value using standard conversion formulas. -* For any other color space, link:/docs/commands/references/currentgray/[`currentgray`] returns **0.0** (black). +* If the current color space is **DeviceGray**, link:/commands/references/currentgray/[`currentgray`] returns the color value most recently specified to link:/commands/references/setgray/[`setgray`] or [`setcolor`]. +* If the current color space is **DeviceRGB** or **DeviceCMYK**, link:/commands/references/currentgray/[`currentgray`] converts the current color to a gray value using standard conversion formulas. +* For any other color space, link:/commands/references/currentgray/[`currentgray`] returns **0.0** (black). The returned value is always in the range 0.0 (black) to 1.0 (white). @@ -221,7 +221,7 @@ gray = 0.0 === See Also -* link:/docs/commands/references/setgray/[`setgray`] - Set gray color -* link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color -* link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) -* link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color +* link:/commands/references/setgray/[`setgray`] - Set gray color +* link:/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color +* link:/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) +* link:/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color diff --git a/docs/commands/references/currentgstate.adoc b/docs/commands/references/currentgstate.adoc index 1736742..177e1ef 100644 --- a/docs/commands/references/currentgstate.adoc +++ b/docs/commands/references/currentgstate.adoc @@ -37,11 +37,11 @@ gstate currentgstate → gstate === Description -link:/docs/commands/references/currentgstate/[`currentgstate`] replaces the value of the gstate object by a copy of the current graphics state and pushes gstate back on the operand stack. +link:/commands/references/currentgstate/[`currentgstate`] replaces the value of the gstate object by a copy of the current graphics state and pushes gstate back on the operand stack. -This is a **copying operation** that updates an existing gstate object rather than creating a new one. This is more efficient than creating a new gstate with link:/docs/commands/references/gstate/[`gstate`] when you already have a gstate object to reuse. +This is a **copying operation** that updates an existing gstate object rather than creating a new one. This is more efficient than creating a new gstate with link:/commands/references/gstate/[`gstate`] when you already have a gstate object to reuse. -The gstate object must have been previously created by link:/docs/commands/references/gstate/[`gstate`]. After the operation, the gstate contains a snapshot of: +The gstate object must have been previously created by link:/commands/references/gstate/[`gstate`]. After the operation, the gstate contains a snapshot of: * Current transformation matrix (CTM) * Color space and color values @@ -194,7 +194,7 @@ beforeState setgstate % Restore if needed === Common Pitfalls -WARNING: *Global VM Restrictions* - If gstate is in global VM, link:/docs/commands/references/currentgstate/[`currentgstate`] fails if current state contains local VM objects. +WARNING: *Global VM Restrictions* - If gstate is in global VM, link:/commands/references/currentgstate/[`currentgstate`] fails if current state contains local VM objects. [source,postscript] ---- @@ -206,7 +206,7 @@ false setglobal globalState currentgstate pop % Error: invalidaccess ---- -WARNING: *Must Use Existing gstate* - link:/docs/commands/references/currentgstate/[`currentgstate`] requires a pre-existing gstate object. +WARNING: *Must Use Existing gstate* - link:/commands/references/currentgstate/[`currentgstate`] requires a pre-existing gstate object. [source,postscript] ---- @@ -247,7 +247,7 @@ TIP: *Reuse gstate Objects* - More efficient than creating new ones repeatedly. === Implementation Notes * Updates existing gstate object (doesn't create new one) -* More efficient than link:/docs/commands/references/gstate/[`gstate`] when reusing objects +* More efficient than link:/commands/references/gstate/[`gstate`] when reusing objects * Returns same gstate object (for convenience) * Captures complete graphics state except current path * Fast operation suitable for frequent use @@ -259,25 +259,25 @@ TIP: *Reuse gstate Objects* - More efficient than creating new ones repeatedly. |=== | Operator | Purpose -| link:/docs/commands/references/gstate/[`gstate`] +| link:/commands/references/gstate/[`gstate`] | Creates new gstate object with current state (allocates VM) -| link:/docs/commands/references/currentgstate/[`currentgstate`] +| link:/commands/references/currentgstate/[`currentgstate`] | Updates existing gstate with current state (no allocation) -| link:/docs/commands/references/setgstate/[`setgstate`] +| link:/commands/references/setgstate/[`setgstate`] | Replaces current state from gstate object -| link:/docs/commands/references/gsave/[`gsave`] +| link:/commands/references/gsave/[`gsave`] | Saves current state on graphics state stack -| link:/docs/commands/references/grestore/[`grestore`] +| link:/commands/references/grestore/[`grestore`] | Restores state from graphics state stack |=== === Graphics State Components -link:/docs/commands/references/currentgstate/[`currentgstate`] captures: +link:/commands/references/currentgstate/[`currentgstate`] captures: * ✓ Transformation matrix (CTM) * ✓ Color space and color @@ -290,8 +290,8 @@ link:/docs/commands/references/currentgstate/[`currentgstate`] captures: === See Also -* link:/docs/commands/references/gstate/[`gstate`] - Create new graphics state object -* link:/docs/commands/references/setgstate/[`setgstate`] - Replace graphics state from gstate -* link:/docs/commands/references/gsave/[`gsave`] - Save state on graphics state stack -* link:/docs/commands/references/grestore/[`grestore`] - Restore state from stack -* link:/docs/commands/references/grestoreall/[`grestoreall`] - Restore all saved states +* link:/commands/references/gstate/[`gstate`] - Create new graphics state object +* link:/commands/references/setgstate/[`setgstate`] - Replace graphics state from gstate +* link:/commands/references/gsave/[`gsave`] - Save state on graphics state stack +* link:/commands/references/grestore/[`grestore`] - Restore state from stack +* link:/commands/references/grestoreall/[`grestoreall`] - Restore all saved states diff --git a/docs/commands/references/currenthsbcolor.adoc b/docs/commands/references/currenthsbcolor.adoc index 047bad1..ee25be5 100644 --- a/docs/commands/references/currenthsbcolor.adoc +++ b/docs/commands/references/currenthsbcolor.adoc @@ -43,11 +43,11 @@ Returns current color as HSB values. === Description -link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] returns the current color in the graphics state according to the hue-saturation-brightness model. +link:/commands/references/currenthsbcolor/[`currenthsbcolor`] returns the current color in the graphics state according to the hue-saturation-brightness model. -* If the current color space is **DeviceRGB**, link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] returns the color values most recently specified by link:/docs/commands/references/sethsbcolor/[`sethsbcolor`], converting them from RGB to HSB coordinates if necessary. -* If the current color space is **DeviceGray** or **DeviceCMYK**, link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] first converts the current color to RGB, then to HSB. -* For any other color space, link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] returns **0.0 0.0 0.0** (black). +* If the current color space is **DeviceRGB**, link:/commands/references/currenthsbcolor/[`currenthsbcolor`] returns the color values most recently specified by link:/commands/references/sethsbcolor/[`sethsbcolor`], converting them from RGB to HSB coordinates if necessary. +* If the current color space is **DeviceGray** or **DeviceCMYK**, link:/commands/references/currenthsbcolor/[`currenthsbcolor`] first converts the current color to RGB, then to HSB. +* For any other color space, link:/commands/references/currenthsbcolor/[`currenthsbcolor`] returns **0.0 0.0 0.0** (black). **HSB components:** @@ -297,8 +297,8 @@ brightness dup dup setrgbcolor === See Also -* link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color -* link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/currentgray/[`currentgray`] - Get gray value -* link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color +* link:/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color +* link:/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/currentgray/[`currentgray`] - Get gray value +* link:/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color diff --git a/docs/commands/references/currentlinecap.adoc b/docs/commands/references/currentlinecap.adoc index 458437e..9305990 100644 --- a/docs/commands/references/currentlinecap.adoc +++ b/docs/commands/references/currentlinecap.adoc @@ -37,7 +37,7 @@ Returns current line cap style. === Description -link:/docs/commands/references/currentlinecap/[`currentlinecap`] returns the current line cap parameter from the graphics state. This is the value most recently set by link:/docs/commands/references/setlinecap/[`setlinecap`]. +link:/commands/references/currentlinecap/[`currentlinecap`] returns the current line cap parameter from the graphics state. This is the value most recently set by link:/commands/references/setlinecap/[`setlinecap`]. **Cap styles:** @@ -177,7 +177,7 @@ Square (2): [─────] === See Also -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap style -* link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style -* link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width -* link:/docs/commands/references/currentdash/[`currentdash`] - Get dash pattern +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap style +* link:/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style +* link:/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width +* link:/commands/references/currentdash/[`currentdash`] - Get dash pattern diff --git a/docs/commands/references/currentlinejoin.adoc b/docs/commands/references/currentlinejoin.adoc index 33f0bed..672a311 100644 --- a/docs/commands/references/currentlinejoin.adoc +++ b/docs/commands/references/currentlinejoin.adoc @@ -37,7 +37,7 @@ Returns current line join style. === Description -link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] returns the current line join parameter from the graphics state. This is the value most recently set by link:/docs/commands/references/setlinejoin/[`setlinejoin`]. +link:/commands/references/currentlinejoin/[`currentlinejoin`] returns the current line join parameter from the graphics state. This is the value most recently set by link:/commands/references/setlinejoin/[`setlinejoin`]. **Join styles:** @@ -180,8 +180,8 @@ Bevel (2): ╱─╲ === See Also -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join style -* link:/docs/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style -* link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width -* link:/docs/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get miter limit -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join style +* link:/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style +* link:/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width +* link:/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get miter limit +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit diff --git a/docs/commands/references/currentlinewidth.adoc b/docs/commands/references/currentlinewidth.adoc index 1af1f70..fa026fc 100644 --- a/docs/commands/references/currentlinewidth.adoc +++ b/docs/commands/references/currentlinewidth.adoc @@ -37,7 +37,7 @@ Returns current line width value. === Description -link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] returns the current line width parameter from the graphics state. This is the value most recently set by link:/docs/commands/references/setlinewidth/[`setlinewidth`]. +link:/commands/references/currentlinewidth/[`currentlinewidth`] returns the current line width parameter from the graphics state. This is the value most recently set by link:/commands/references/setlinewidth/[`setlinewidth`]. The returned value is in **user space units**. The actual rendered width in device space depends on the current transformation matrix (CTM) at the time of stroking. @@ -200,7 +200,7 @@ TIP: *Use for State Management* - Good for preserving/restoring line parameters. * Very fast query operation * No modification to graphics state -* Returns exact value set by link:/docs/commands/references/setlinewidth/[`setlinewidth`] +* Returns exact value set by link:/commands/references/setlinewidth/[`setlinewidth`] * Value is in user space coordinates * Default value is typically 1.0 * Widely supported (Level 1) @@ -223,8 +223,8 @@ currentlinewidth % Still 1.0 === See Also -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style -* link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style -* link:/docs/commands/references/currentdash/[`currentdash`] - Get dash pattern -* link:/docs/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get miter limit +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/currentlinecap/[`currentlinecap`] - Get line cap style +* link:/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style +* link:/commands/references/currentdash/[`currentdash`] - Get dash pattern +* link:/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get miter limit diff --git a/docs/commands/references/currentmatrix.adoc b/docs/commands/references/currentmatrix.adoc index d28f340..f9e62ac 100644 --- a/docs/commands/references/currentmatrix.adoc +++ b/docs/commands/references/currentmatrix.adoc @@ -37,9 +37,9 @@ matrix currentmatrix → matrix === Description -link:/docs/commands/references/currentmatrix/[`currentmatrix`] replaces the value of `matrix` with the current transformation matrix (CTM) from the graphics state and pushes the modified matrix back on the operand stack. +link:/commands/references/currentmatrix/[`currentmatrix`] replaces the value of `matrix` with the current transformation matrix (CTM) from the graphics state and pushes the modified matrix back on the operand stack. -The CTM defines the transformation from user space coordinates to device space coordinates. It is modified by transformation operators like link:/docs/commands/references/translate/[`translate`], link:/docs/commands/references/scale/[`scale`], link:/docs/commands/references/rotate/[`rotate`], and link:/docs/commands/references/concat/[`concat`]. +The CTM defines the transformation from user space coordinates to device space coordinates. It is modified by transformation operators like link:/commands/references/translate/[`translate`], link:/commands/references/scale/[`scale`], link:/commands/references/rotate/[`rotate`], and link:/commands/references/concat/[`concat`]. === PostScript Level @@ -125,7 +125,7 @@ concat % Apply modified matrix === Common Pitfalls -WARNING: *Modifies Input Array* - link:/docs/commands/references/currentmatrix/[`currentmatrix`] modifies the array you provide. +WARNING: *Modifies Input Array* - link:/commands/references/currentmatrix/[`currentmatrix`] modifies the array you provide. [source,postscript] ---- @@ -143,7 +143,7 @@ dup setmatrix % Both stack entries refer to same array ---- -TIP: *Use with gsave/grestore* - For complete state saving, use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`]: +TIP: *Use with gsave/grestore* - For complete state saving, use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`]: [source,postscript] ---- @@ -189,7 +189,7 @@ workMatrix currentmatrix ... * The CTM is stored internally in device space * Very large transformations may experience precision loss * The CTM is part of the graphics state -* Modified by link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] +* Modified by link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] * The array must have at least 6 elements === Matrix Interpretation @@ -238,20 +238,20 @@ atan /angle exch def The CTM is modified by: -* link:/docs/commands/references/translate/[`translate`] -* link:/docs/commands/references/scale/[`scale`] -* link:/docs/commands/references/rotate/[`rotate`] -* link:/docs/commands/references/concat/[`concat`] -* link:/docs/commands/references/setmatrix/[`setmatrix`] -* link:/docs/commands/references/initmatrix/[`initmatrix`] -* link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] +* link:/commands/references/translate/[`translate`] +* link:/commands/references/scale/[`scale`] +* link:/commands/references/rotate/[`rotate`] +* link:/commands/references/concat/[`concat`] +* link:/commands/references/setmatrix/[`setmatrix`] +* link:/commands/references/initmatrix/[`initmatrix`] +* link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] === See Also -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Set the CTM -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default -* link:/docs/commands/references/concat/[`concat`] - Concatenate matrix with CTM -* link:/docs/commands/references/transform/[`transform`] - Transform coordinates by CTM -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/setmatrix/[`setmatrix`] - Set the CTM +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default +* link:/commands/references/concat/[`concat`] - Concatenate matrix with CTM +* link:/commands/references/transform/[`transform`] - Transform coordinates by CTM +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/currentmiterlimit.adoc b/docs/commands/references/currentmiterlimit.adoc index fe079dc..cfef28c 100644 --- a/docs/commands/references/currentmiterlimit.adoc +++ b/docs/commands/references/currentmiterlimit.adoc @@ -37,7 +37,7 @@ Returns current miter limit value. === Description -link:/docs/commands/references/currentmiterlimit/[`currentmiterlimit`] returns the current miter limit parameter from the graphics state. This is the value most recently set by link:/docs/commands/references/setmiterlimit/[`setmiterlimit`]. +link:/commands/references/currentmiterlimit/[`currentmiterlimit`] returns the current miter limit parameter from the graphics state. This is the value most recently set by link:/commands/references/setmiterlimit/[`setmiterlimit`]. The miter limit controls when sharp miter joins are converted to bevel joins. It is the ratio of miter length to line width. When this ratio exceeds the miter limit, a bevel join is used instead. @@ -205,7 +205,7 @@ drawSharpCorners === See Also -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit -* link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join style -* link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit +* link:/commands/references/currentlinejoin/[`currentlinejoin`] - Get line join style +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join style +* link:/commands/references/currentlinewidth/[`currentlinewidth`] - Get line width diff --git a/docs/commands/references/currentpoint.adoc b/docs/commands/references/currentpoint.adoc index 83a44eb..4e06533 100644 --- a/docs/commands/references/currentpoint.adoc +++ b/docs/commands/references/currentpoint.adoc @@ -40,11 +40,11 @@ Returns the x and y coordinates of the current point. === Description -link:/docs/commands/references/currentpoint/[`currentpoint`] returns the x and y coordinates of the current point in the graphics state (i.e., the trailing endpoint of the current path). +link:/commands/references/currentpoint/[`currentpoint`] returns the x and y coordinates of the current point in the graphics state (i.e., the trailing endpoint of the current path). -If the current point is undefined because the current path is empty, link:/docs/commands/references/currentpoint/[`currentpoint`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/currentpoint/[`currentpoint`] executes the [`nocurrentpoint`] error. -The current point is reported in the **user coordinate system**. Points entered into a path are immediately converted to device coordinates by the current transformation matrix (CTM); existing points are not changed by subsequent modifications to the CTM. link:/docs/commands/references/currentpoint/[`currentpoint`] computes the user space coordinate that corresponds to the current point according to the current value of the CTM. If a current point is set and then the CTM is changed, link:/docs/commands/references/currentpoint/[`currentpoint`] will report a different position in user space than it did before. +The current point is reported in the **user coordinate system**. Points entered into a path are immediately converted to device coordinates by the current transformation matrix (CTM); existing points are not changed by subsequent modifications to the CTM. link:/commands/references/currentpoint/[`currentpoint`] computes the user space coordinate that corresponds to the current point according to the current value of the CTM. If a current point is set and then the CTM is changed, link:/commands/references/currentpoint/[`currentpoint`] will report a different position in user space than it did before. === PostScript Level @@ -175,7 +175,7 @@ drawArrowhead === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/currentpoint/[`currentpoint`] fails if the path is empty or only contains link:/docs/commands/references/moveto/[`moveto`] operations that were superseded. +WARNING: *Requires Current Point* - link:/commands/references/currentpoint/[`currentpoint`] fails if the path is empty or only contains link:/commands/references/moveto/[`moveto`] operations that were superseded. [source,postscript] ---- @@ -206,7 +206,7 @@ grestore currentpoint % Returns: 100 100 (restored) ---- -TIP: *Use for Position-Dependent Drawing* - link:/docs/commands/references/currentpoint/[`currentpoint`] is essential for drawing elements that depend on the current path position, like arrowheads or labels. +TIP: *Use for Position-Dependent Drawing* - link:/commands/references/currentpoint/[`currentpoint`] is essential for drawing elements that depend on the current path position, like arrowheads or labels. === Error Conditions @@ -230,11 +230,11 @@ TIP: *Use for Position-Dependent Drawing* - link:/docs/commands/references/curre * Coordinates are computed from device space using inverse CTM * May have rounding errors due to coordinate transformations * The current point exists only after path construction operations -* Superseded link:/docs/commands/references/moveto/[`moveto`] operations don't leave a current point +* Superseded link:/commands/references/moveto/[`moveto`] operations don't leave a current point === Coordinate Transformation -The current point is stored internally in device space. link:/docs/commands/references/currentpoint/[`currentpoint`] performs this transformation: +The current point is stored internally in device space. link:/commands/references/currentpoint/[`currentpoint`] performs this transformation: ---- device_point → CTM⁻¹ → user_point @@ -259,7 +259,7 @@ currentpoint % Get it back === See Also -* link:/docs/commands/references/moveto/[`moveto`] - Set current point (absolute) -* link:/docs/commands/references/rmoveto/[`rmoveto`] - Set current point (relative) -* link:/docs/commands/references/lineto/[`lineto`] - Add line to current point -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file +* link:/commands/references/moveto/[`moveto`] - Set current point (absolute) +* link:/commands/references/rmoveto/[`rmoveto`] - Set current point (relative) +* link:/commands/references/lineto/[`lineto`] - Add line to current point +* link:/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file diff --git a/docs/commands/references/currentrgbcolor.adoc b/docs/commands/references/currentrgbcolor.adoc index 0bbc1a7..ddbd446 100644 --- a/docs/commands/references/currentrgbcolor.adoc +++ b/docs/commands/references/currentrgbcolor.adoc @@ -43,15 +43,15 @@ Returns current color as RGB values. === Description -link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] returns the current color in the graphics state according to the red-green-blue color model. +link:/commands/references/currentrgbcolor/[`currentrgbcolor`] returns the current color in the graphics state according to the red-green-blue color model. * If the current color space is **DeviceRGB**, -link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] returns the color values most -recently specified to link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] or [`setcolor`] -(or transformed values specified to link:/docs/commands/references/sethsbcolor/[`sethsbcolor`]) . +link:/commands/references/currentrgbcolor/[`currentrgbcolor`] returns the color values most +recently specified to link:/commands/references/setrgbcolor/[`setrgbcolor`] or [`setcolor`] +(or transformed values specified to link:/commands/references/sethsbcolor/[`sethsbcolor`]) . -* If the current color space is **DeviceGray** or **DeviceCMYK**, link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] converts the current color to RGB. -* For any other color space, link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] returns **0.0 0.0 0.0** (black). +* If the current color space is **DeviceGray** or **DeviceCMYK**, link:/commands/references/currentrgbcolor/[`currentrgbcolor`] converts the current color to RGB. +* For any other color space, link:/commands/references/currentrgbcolor/[`currentrgbcolor`] returns **0.0 0.0 0.0** (black). Each returned value is in the range 0.0 (no intensity) to 1.0 (full intensity). @@ -257,7 +257,7 @@ No components = Black === See Also -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/currentgray/[`currentgray`] - Get gray value -* link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) -* link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/currentgray/[`currentgray`] - Get gray value +* link:/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) +* link:/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color diff --git a/docs/commands/references/curveto.adoc b/docs/commands/references/curveto.adoc index 7854c89..e87ab6e 100644 --- a/docs/commands/references/curveto.adoc +++ b/docs/commands/references/curveto.adoc @@ -52,9 +52,9 @@ x1 y1 x2 y2 x3 y3 curveto → - === Description -link:/docs/commands/references/curveto/[`curveto`] adds a Bézier cubic section to the current path between the current point, referred to here as (x0, y0), and the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier cubic control points. After constructing the curve, link:/docs/commands/references/curveto/[`curveto`] makes (x3, y3) the new current point. +link:/commands/references/curveto/[`curveto`] adds a Bézier cubic section to the current path between the current point, referred to here as (x0, y0), and the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier cubic control points. After constructing the curve, link:/commands/references/curveto/[`curveto`] makes (x3, y3) the new current point. -If the current point is undefined because the current path is empty, link:/docs/commands/references/curveto/[`curveto`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/curveto/[`curveto`] executes the [`nocurrentpoint`] error. The four points define the shape of the curve geometrically: @@ -170,7 +170,7 @@ fill === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/curveto/[`curveto`] needs a current point as the curve starting point. Use link:/docs/commands/references/moveto/[`moveto`] first. +WARNING: *Requires Current Point* - link:/commands/references/curveto/[`curveto`] needs a current point as the curve starting point. Use link:/commands/references/moveto/[`moveto`] first. [source,postscript] ---- @@ -180,9 +180,9 @@ newpath WARNING: *Control Point Order Matters* - The first control point (x1, y1) affects the curve's start, the second (x2, y2) affects the end. Swapping them changes the curve shape significantly. -WARNING: *Six Parameters Required* - link:/docs/commands/references/curveto/[`curveto`] requires all six parameters. Missing any causes [`stackunderflow`]. +WARNING: *Six Parameters Required* - link:/commands/references/curveto/[`curveto`] requires all six parameters. Missing any causes [`stackunderflow`]. -TIP: *Use for Smooth Curves* - Bézier curves provide smooth, aesthetically pleasing curves. For circles and arcs, consider link:/docs/commands/references/arc/[`arc`] for mathematical precision. +TIP: *Use for Smooth Curves* - Bézier curves provide smooth, aesthetically pleasing curves. For circles and arcs, consider link:/commands/references/arc/[`arc`] for mathematical precision. === Mathematical Background @@ -224,15 +224,15 @@ Where t ranges from 0 to 1, and (x0, y0) is the current point. === Performance Considerations -* More computationally expensive than link:/docs/commands/references/lineto/[`lineto`] +* More computationally expensive than link:/commands/references/lineto/[`lineto`] * Many curves can impact path complexity limits * Flatness parameter affects rendering speed * Simpler curves (fewer inflection points) render faster === See Also -* link:/docs/commands/references/rcurveto/[`rcurveto`] - Relative curveto -* link:/docs/commands/references/arc/[`arc`] - Draw circular arc -* link:/docs/commands/references/lineto/[`lineto`] - Draw straight line -* link:/docs/commands/references/moveto/[`moveto`] - Set current point -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/rcurveto/[`rcurveto`] - Relative curveto +* link:/commands/references/arc/[`arc`] - Draw circular arc +* link:/commands/references/lineto/[`lineto`] - Draw straight line +* link:/commands/references/moveto/[`moveto`] - Set current point +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/cvi.adoc b/docs/commands/references/cvi.adoc index 7bd88ad..22aa202 100644 --- a/docs/commands/references/cvi.adoc +++ b/docs/commands/references/cvi.adoc @@ -38,7 +38,7 @@ string cvi → int === Description -link:/docs/commands/references/cvi/[`cvi`] (convert to integer) converts an integer, real, or string to an integer result: +link:/commands/references/cvi/[`cvi`] (convert to integer) converts an integer, real, or string to an integer result: * **Integer operand**: Returns it unchanged * **Real operand**: Truncates fractional part (rounds toward 0) and converts to integer @@ -100,7 +100,7 @@ position cellsize div cvi % Integer cell index === Common Pitfalls -WARNING: *Truncation, Not Rounding* - link:/docs/commands/references/cvi/[`cvi`] truncates toward zero, not to nearest integer. +WARNING: *Truncation, Not Rounding* - link:/commands/references/cvi/[`cvi`] truncates toward zero, not to nearest integer. [source,postscript] ---- @@ -123,7 +123,7 @@ WARNING: *String Syntax* - String must contain valid PostScript number syntax. (12x) cvi % Error: syntaxerror ---- -TIP: *Use round/floor/ceiling* - For other rounding behavior, use link:/docs/commands/references/round/[`round`], link:/docs/commands/references/floor/[`floor`], or link:/docs/commands/references/ceiling/[`ceiling`] before link:/docs/commands/references/cvi/[`cvi`]. +TIP: *Use round/floor/ceiling* - For other rounding behavior, use link:/commands/references/round/[`round`], link:/commands/references/floor/[`floor`], or link:/commands/references/ceiling/[`ceiling`] before link:/commands/references/cvi/[`cvi`]. === Error Conditions @@ -163,30 +163,30 @@ TIP: *Use round/floor/ceiling* - For other rounding behavior, use link:/docs/com |=== | Operator | Result -| link:/docs/commands/references/cvi/[`cvi`] +| link:/commands/references/cvi/[`cvi`] | Truncate toward 0, convert to integer -| link:/docs/commands/references/cvr/[`cvr`] +| link:/commands/references/cvr/[`cvr`] | Convert to real -| link:/docs/commands/references/round/[`round`] +| link:/commands/references/round/[`round`] | Round to nearest, keep type -| link:/docs/commands/references/floor/[`floor`] +| link:/commands/references/floor/[`floor`] | Round down, keep type -| link:/docs/commands/references/ceiling/[`ceiling`] +| link:/commands/references/ceiling/[`ceiling`] | Round up, keep type -| link:/docs/commands/references/truncate/[`truncate`] +| link:/commands/references/truncate/[`truncate`] | Round toward 0, keep type |=== === See Also -* link:/docs/commands/references/cvr/[`cvr`] - Convert to real -* link:/docs/commands/references/cvs/[`cvs`] - Convert to string -* link:/docs/commands/references/round/[`round`] - Round to nearest -* link:/docs/commands/references/floor/[`floor`] - Round down -* link:/docs/commands/references/ceiling/[`ceiling`] - Round up -* link:/docs/commands/references/truncate/[`truncate`] - Round toward zero \ No newline at end of file +* link:/commands/references/cvr/[`cvr`] - Convert to real +* link:/commands/references/cvs/[`cvs`] - Convert to string +* link:/commands/references/round/[`round`] - Round to nearest +* link:/commands/references/floor/[`floor`] - Round down +* link:/commands/references/ceiling/[`ceiling`] - Round up +* link:/commands/references/truncate/[`truncate`] - Round toward zero \ No newline at end of file diff --git a/docs/commands/references/cvlit.adoc b/docs/commands/references/cvlit.adoc index 5d2bcc0..2cfc7f2 100644 --- a/docs/commands/references/cvlit.adoc +++ b/docs/commands/references/cvlit.adoc @@ -37,7 +37,7 @@ any cvlit → any === Description -link:/docs/commands/references/cvlit/[`cvlit`] (convert to literal) changes the attribute of the object on top of the operand stack from executable to literal. +link:/commands/references/cvlit/[`cvlit`] (convert to literal) changes the attribute of the object on top of the operand stack from executable to literal. The object itself is unchanged - only its executable/literal attribute is modified. This affects how the PostScript interpreter treats the object when it is encountered during execution. @@ -127,7 +127,7 @@ TIP: *Most Objects Are Literal* - Numbers, strings, arrays created with `[ ]`, e * Only changes the executable/literal attribute bit * Does not create a new object (modifies in place) * Works on any object type -* Complementary to link:/docs/commands/references/cvx/[`cvx`] +* Complementary to link:/commands/references/cvx/[`cvx`] === Executable vs. Literal Comparison @@ -154,6 +154,6 @@ TIP: *Most Objects Are Literal* - Numbers, strings, arrays created with `[ ]`, e === See Also -* link:/docs/commands/references/cvx/[`cvx`] - Convert to executable -* link:/docs/commands/references/xcheck/[`xcheck`] - Test if executable -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/cvx/[`cvx`] - Convert to executable +* link:/commands/references/xcheck/[`xcheck`] - Test if executable +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/cvn.adoc b/docs/commands/references/cvn.adoc index b764e99..3f7310d 100644 --- a/docs/commands/references/cvn.adoc +++ b/docs/commands/references/cvn.adoc @@ -37,7 +37,7 @@ string cvn → name === Description -link:/docs/commands/references/cvn/[`cvn`] (convert to name) converts the string operand to a name object that is lexically identical to the string. +link:/commands/references/cvn/[`cvn`] (convert to name) converts the string operand to a name object that is lexically identical to the string. The resulting name: * Has the same executable/literal attribute as the string @@ -166,7 +166,7 @@ TIP: *Names vs. Strings as Keys* - Names are more efficient as dictionary keys t === See Also -* link:/docs/commands/references/cvs/[`cvs`] - Convert to string -* link:/docs/commands/references/type/[`type`] - Get object type -* link:/docs/commands/references/cvlit/[`cvlit`] - Make literal -* link:/docs/commands/references/cvx/[`cvx`] - Make executable \ No newline at end of file +* link:/commands/references/cvs/[`cvs`] - Convert to string +* link:/commands/references/type/[`type`] - Get object type +* link:/commands/references/cvlit/[`cvlit`] - Make literal +* link:/commands/references/cvx/[`cvx`] - Make executable \ No newline at end of file diff --git a/docs/commands/references/cvr.adoc b/docs/commands/references/cvr.adoc index 4da478c..c9f3b21 100644 --- a/docs/commands/references/cvr.adoc +++ b/docs/commands/references/cvr.adoc @@ -38,7 +38,7 @@ string cvr → real === Description -link:/docs/commands/references/cvr/[`cvr`] (convert to real) converts an integer, real, or string to a real number: +link:/commands/references/cvr/[`cvr`] (convert to real) converts an integer, real, or string to a real number: * **Integer operand**: Converts to real * **Real operand**: Returns it unchanged @@ -127,6 +127,6 @@ TIP: *Use for Precision* - Convert integers to reals before division to avoid in === See Also -* link:/docs/commands/references/cvi/[`cvi`] - Convert to integer -* link:/docs/commands/references/cvs/[`cvs`] - Convert to string -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/cvi/[`cvi`] - Convert to integer +* link:/commands/references/cvs/[`cvs`] - Convert to string +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/cvs.adoc b/docs/commands/references/cvs.adoc index 0b0e1b7..9cb22f8 100644 --- a/docs/commands/references/cvs.adoc +++ b/docs/commands/references/cvs.adoc @@ -40,7 +40,7 @@ any string cvs → substring === Description -link:/docs/commands/references/cvs/[`cvs`] (convert to string) produces a text representation of an arbitrary object and stores it into the supplied _string_, overwriting an initial portion of its value. It returns a string object designating the substring actually used. +link:/commands/references/cvs/[`cvs`] (convert to string) produces a text representation of an arbitrary object and stores it into the supplied _string_, overwriting an initial portion of its value. It returns a string object designating the substring actually used. Conversion rules: * **Numbers**: Text representation (e.g., `123`, `3.14`) @@ -199,8 +199,8 @@ TIP: *Use Ample Buffer Size* - Allocate at least 20-30 characters for number con === See Also -* link:/docs/commands/references/cvn/[`cvn`] - Convert string to name -* link:/docs/commands/references/cvi/[`cvi`] - Convert to integer -* link:/docs/commands/references/cvr/[`cvr`] - Convert to real -* link:/docs/commands/references/string/[`string`] - Create string buffer -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/cvn/[`cvn`] - Convert string to name +* link:/commands/references/cvi/[`cvi`] - Convert to integer +* link:/commands/references/cvr/[`cvr`] - Convert to real +* link:/commands/references/string/[`string`] - Create string buffer +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/cvx.adoc b/docs/commands/references/cvx.adoc index 328ea79..124d48e 100644 --- a/docs/commands/references/cvx.adoc +++ b/docs/commands/references/cvx.adoc @@ -37,7 +37,7 @@ any cvx → any === Description -link:/docs/commands/references/cvx/[`cvx`] (convert to executable) changes the attribute of the object on top of the operand stack from literal to executable. +link:/commands/references/cvx/[`cvx`] (convert to executable) changes the attribute of the object on top of the operand stack from literal to executable. The object itself is unchanged - only its executable/literal attribute is modified. This affects how the PostScript interpreter treats the object when it is encountered during execution. @@ -121,10 +121,10 @@ TIP: *Most Procedures Already Executable* - Procedures created with `{ }` are al * Only changes the executable/literal attribute bit * Does not create a new object * Works on any object type -* Complementary to link:/docs/commands/references/cvlit/[`cvlit`] +* Complementary to link:/commands/references/cvlit/[`cvlit`] === See Also -* link:/docs/commands/references/cvlit/[`cvlit`] - Convert to literal -* link:/docs/commands/references/xcheck/[`xcheck`] - Test if executable -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/cvlit/[`cvlit`] - Convert to literal +* link:/commands/references/xcheck/[`xcheck`] - Test if executable +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/def.adoc b/docs/commands/references/def.adoc index 6a286b5..bbf0c84 100644 --- a/docs/commands/references/def.adoc +++ b/docs/commands/references/def.adoc @@ -40,7 +40,7 @@ key value def → – === Description -link:/docs/commands/references/def/[`def`] associates _key_ with _value_ in the current dictionary (the one on top of the dictionary stack). +link:/commands/references/def/[`def`] associates _key_ with _value_ in the current dictionary (the one on top of the dictionary stack). * If _key_ already exists: replaces its value * If _key_ doesn't exist: creates new entry @@ -113,7 +113,7 @@ end === Common Pitfalls -WARNING: *Defines in Current Dictionary* - link:/docs/commands/references/def/[`def`] always uses the current dictionary (top of dict stack), not a specific dictionary. +WARNING: *Defines in Current Dictionary* - link:/commands/references/def/[`def`] always uses the current dictionary (top of dict stack), not a specific dictionary. [source,postscript] ---- @@ -182,20 +182,20 @@ TIP: *Use Literal Names* - Always use literal names (starting with `/`) for keys |=== | Operator | Behavior -| link:/docs/commands/references/def/[`def`] +| link:/commands/references/def/[`def`] | Define in **current** dictionary -| link:/docs/commands/references/store/[`store`] +| link:/commands/references/store/[`store`] | Define in **first** dictionary containing key, or current if not found -| link:/docs/commands/references/put/[`put`] +| link:/commands/references/put/[`put`] | Put into **specific** dictionary (requires dict on stack) |=== === See Also -* link:/docs/commands/references/load/[`load`] - Look up value from dictionary stack -* link:/docs/commands/references/store/[`store`] - Store with different semantics -* link:/docs/commands/references/put/[`put`] - Put into specific dictionary -* link:/docs/commands/references/begin/[`begin`] - Make dictionary current -* link:/docs/commands/references/where/[`where`] - Find which dictionary contains key \ No newline at end of file +* link:/commands/references/load/[`load`] - Look up value from dictionary stack +* link:/commands/references/store/[`store`] - Store with different semantics +* link:/commands/references/put/[`put`] - Put into specific dictionary +* link:/commands/references/begin/[`begin`] - Make dictionary current +* link:/commands/references/where/[`where`] - Find which dictionary contains key \ No newline at end of file diff --git a/docs/commands/references/defaultmatrix.adoc b/docs/commands/references/defaultmatrix.adoc index 0678fd1..1c4af00 100644 --- a/docs/commands/references/defaultmatrix.adoc +++ b/docs/commands/references/defaultmatrix.adoc @@ -37,7 +37,7 @@ matrix defaultmatrix → matrix === Description -link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] replaces the value of `matrix` with the default transformation matrix for the current output device and pushes the modified matrix back on the operand stack. +link:/commands/references/defaultmatrix/[`defaultmatrix`] replaces the value of `matrix` with the default transformation matrix for the current output device and pushes the modified matrix back on the operand stack. The default matrix establishes the standard mapping from the default user coordinate system to device space for the current device. This matrix is device-dependent and defines the initial state before any transformations are applied. @@ -127,7 +127,7 @@ WARNING: *Not Always Identity* - The default matrix is rarely the identity matri [72 0 0 -72 0 792] % Letter page at 72dpi ---- -TIP: *Use initmatrix Instead* - For resetting CTM, use link:/docs/commands/references/initmatrix/[`initmatrix`]: +TIP: *Use initmatrix Instead* - For resetting CTM, use link:/commands/references/initmatrix/[`initmatrix`]: [source,postscript] ---- @@ -229,7 +229,7 @@ matrix defaultmatrix setmatrix === See Also -* link:/docs/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Set transformation matrix -* link:/docs/commands/references/matrix/[`matrix`] - Create identity matrix \ No newline at end of file +* link:/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation +* link:/commands/references/setmatrix/[`setmatrix`] - Set transformation matrix +* link:/commands/references/matrix/[`matrix`] - Create identity matrix \ No newline at end of file diff --git a/docs/commands/references/definefont.adoc b/docs/commands/references/definefont.adoc index 14c35f3..814f364 100644 --- a/docs/commands/references/definefont.adoc +++ b/docs/commands/references/definefont.adoc @@ -29,15 +29,15 @@ font === Description -link:/docs/commands/references/definefont/[`definefont`] registers `font` as a font dictionary associated with `key` (usually a name). link:/docs/commands/references/definefont/[`definefont`] first checks that `font` is a well-formed font dictionary—in other words, contains all required key-value pairs. It inserts an additional entry whose key is `FID` and whose value is an object of type `fontID`. The dictionary must be large enough to accommodate this additional entry. It makes the dictionary's access read-only. Finally, it associates `key` with `font` in the font directory. +link:/commands/references/definefont/[`definefont`] registers `font` as a font dictionary associated with `key` (usually a name). link:/commands/references/definefont/[`definefont`] first checks that `font` is a well-formed font dictionary—in other words, contains all required key-value pairs. It inserts an additional entry whose key is `FID` and whose value is an object of type `fontID`. The dictionary must be large enough to accommodate this additional entry. It makes the dictionary's access read-only. Finally, it associates `key` with `font` in the font directory. -In Level 2, it is permissible to associate a font dictionary with more than one key. If `font` has already been registered, link:/docs/commands/references/definefont/[`definefont`] does not alter it in any way. +In Level 2, it is permissible to associate a font dictionary with more than one key. If `font` has already been registered, link:/commands/references/definefont/[`definefont`] does not alter it in any way. -If `font` is a composite font, link:/docs/commands/references/definefont/[`definefont`] also inserts the entries `MIDVector` and `CurMID`, and adds entries `PrefEnc`, `EscChar`, `ShiftIn`, and `ShiftOut` if they are required and are not already present. All the descendant fonts must have been registered by link:/docs/commands/references/definefont/[`definefont`] previously. +If `font` is a composite font, link:/commands/references/definefont/[`definefont`] also inserts the entries `MIDVector` and `CurMID`, and adds entries `PrefEnc`, `EscChar`, `ShiftIn`, and `ShiftOut` if they are required and are not already present. All the descendant fonts must have been registered by link:/commands/references/definefont/[`definefont`] previously. -Subsequent invocation of link:/docs/commands/references/findfont/[`findfont`] with `key` will return `font`. Font registration is subject to the normal semantics of VM. In particular, the lifetime of the definition depends on the VM allocation mode at the time link:/docs/commands/references/definefont/[`definefont`] is executed. A local definition can be undone by a subsequent `restore`. +Subsequent invocation of link:/commands/references/findfont/[`findfont`] with `key` will return `font`. Font registration is subject to the normal semantics of VM. In particular, the lifetime of the definition depends on the VM allocation mode at the time link:/commands/references/definefont/[`definefont`] is executed. A local definition can be undone by a subsequent `restore`. -link:/docs/commands/references/definefont/[`definefont`] is actually a special case of `defineresource` operating on the Font category. +link:/commands/references/definefont/[`definefont`] is actually a special case of `defineresource` operating on the Font category. === Parameters @@ -191,7 +191,7 @@ GlobalFontDirectory /MyFont known { === Font Registration Process -link:/docs/commands/references/definefont/[`definefont`] performs these steps: +link:/commands/references/definefont/[`definefont`] performs these steps: 1. Validates font dictionary structure 2. Checks required entries exist and are correct type @@ -202,8 +202,8 @@ link:/docs/commands/references/definefont/[`definefont`] performs these steps: === See Also -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name -- link:/docs/commands/references/undefinefont/[`undefinefont`] - Remove font from font directory -- link:/docs/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor -- link:/docs/commands/references/makefont/[`makefont`] - Transform font by matrix -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font \ No newline at end of file +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/undefinefont/[`undefinefont`] - Remove font from font directory +- link:/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor +- link:/commands/references/makefont/[`makefont`] - Transform font by matrix +- link:/commands/references/setfont/[`setfont`] - Establish current font \ No newline at end of file diff --git a/docs/commands/references/dict.adoc b/docs/commands/references/dict.adoc index eacea3e..451bc6b 100644 --- a/docs/commands/references/dict.adoc +++ b/docs/commands/references/dict.adoc @@ -37,7 +37,7 @@ int dict → dict === Description -link:/docs/commands/references/dict/[`dict`] creates an empty dictionary with an initial capacity of _int_ elements and pushes it onto the operand stack. +link:/commands/references/dict/[`dict`] creates an empty dictionary with an initial capacity of _int_ elements and pushes it onto the operand stack. **Level 1**: The dictionary has a fixed maximum capacity of _int_ elements. Attempting to exceed this causes [`dictfull`] error. @@ -190,8 +190,8 @@ TIP: *Choose Appropriate Size* - Estimate needed size to avoid expensive expansi === See Also -* link:/docs/commands/references/begin/[`begin`] - Push dict onto dict stack -* link:/docs/commands/references/end/[`end`] - Pop dict from dict stack -* link:/docs/commands/references/def/[`def`] - Define entry in current dict -* link:/docs/commands/references/maxlength/[`maxlength`] - Get maximum capacity -* link:/docs/commands/references/length/[`length`] - Get current entry count \ No newline at end of file +* link:/commands/references/begin/[`begin`] - Push dict onto dict stack +* link:/commands/references/end/[`end`] - Pop dict from dict stack +* link:/commands/references/def/[`def`] - Define entry in current dict +* link:/commands/references/maxlength/[`maxlength`] - Get maximum capacity +* link:/commands/references/length/[`length`] - Get current entry count \ No newline at end of file diff --git a/docs/commands/references/dictstack.adoc b/docs/commands/references/dictstack.adoc index bfdf9a9..e187482 100644 --- a/docs/commands/references/dictstack.adoc +++ b/docs/commands/references/dictstack.adoc @@ -37,7 +37,7 @@ array dictstack → subarray === Description -link:/docs/commands/references/dictstack/[`dictstack`] stores all elements of the dictionary stack into _array_ and returns an object describing the initial n-element subarray, where n is the current depth of the dictionary stack. +link:/commands/references/dictstack/[`dictstack`] stores all elements of the dictionary stack into _array_ and returns an object describing the initial n-element subarray, where n is the current depth of the dictionary stack. Dictionaries are copied in order: * Element 0 ← bottommost dictionary (systemdict) @@ -159,7 +159,7 @@ countdictstack array dictstack % Always correct size === See Also -* link:/docs/commands/references/countdictstack/[`countdictstack`] - Get stack depth -* link:/docs/commands/references/begin/[`begin`] - Push dictionary -* link:/docs/commands/references/end/[`end`] - Pop dictionary -* link:/docs/commands/references/currentdict/[`currentdict`] - Get current dictionary \ No newline at end of file +* link:/commands/references/countdictstack/[`countdictstack`] - Get stack depth +* link:/commands/references/begin/[`begin`] - Push dictionary +* link:/commands/references/end/[`end`] - Pop dictionary +* link:/commands/references/currentdict/[`currentdict`] - Get current dictionary \ No newline at end of file diff --git a/docs/commands/references/div.adoc b/docs/commands/references/div.adoc index 6fc9398..6396122 100644 --- a/docs/commands/references/div.adoc +++ b/docs/commands/references/div.adoc @@ -10,7 +10,7 @@ Divides the first number by the second and returns a real number result. == Description -The `div` operator pops two numbers from the operand stack, divides num1 by num2, and pushes the result back onto the stack. The result is *always a real number*, even if both operands are integers. For integer division with truncation, use link:/docs/commands/references/idiv/[`idiv`] instead. +The `div` operator pops two numbers from the operand stack, divides num1 by num2, and pushes the result back onto the stack. The result is *always a real number*, even if both operands are integers. For integer division with truncation, use link:/commands/references/idiv/[`idiv`] instead. This is a Level 1 operator, available in all PostScript implementations. @@ -254,11 +254,11 @@ Both operands must be numeric (integer or real). The divisor (num2) must not be == Related Commands -* link:/docs/commands/references/idiv/[`idiv`] - Integer division (truncated result) -* link:/docs/commands/references/mod/[`mod`] - Modulo (remainder of division) -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/idiv/[`idiv`] - Integer division (truncated result) +* link:/commands/references/mod/[`mod`] - Modulo (remainder of division) +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers == PostScript Level @@ -334,5 +334,5 @@ totalItems 3 mod % How many items left over? == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/dtransform.adoc b/docs/commands/references/dtransform.adoc index 3db504a..b441afd 100644 --- a/docs/commands/references/dtransform.adoc +++ b/docs/commands/references/dtransform.adoc @@ -44,11 +44,11 @@ dx dy matrix dtransform → dx' dy' === Description -With no matrix operand, link:/docs/commands/references/dtransform/[`dtransform`] (delta transform) transforms the distance vector (dx, dy) by the CTM to produce the corresponding distance vector (dx', dy') in device space. +With no matrix operand, link:/commands/references/dtransform/[`dtransform`] (delta transform) transforms the distance vector (dx, dy) by the CTM to produce the corresponding distance vector (dx', dy') in device space. -If the `matrix` operand is supplied, link:/docs/commands/references/dtransform/[`dtransform`] transforms the distance vector by `matrix` rather than by the CTM. +If the `matrix` operand is supplied, link:/commands/references/dtransform/[`dtransform`] transforms the distance vector by `matrix` rather than by the CTM. -A delta transformation is similar to a normal transformation (link:/docs/commands/references/transform/[`transform`]), but the translation components (tx and ty) of the transformation matrix are not used. This makes distance vectors position-independent in both user space and device space. +A delta transformation is similar to a normal transformation (link:/commands/references/transform/[`transform`]), but the translation components (tx and ty) of the transformation matrix are not used. This makes distance vectors position-independent in both user space and device space. This is useful for determining how distances map from user space to device space, such as for line widths, dash patterns, or measuring transformed lengths. @@ -143,7 +143,7 @@ deviceWidth dup mul deviceHeight dup mul add sqrt === Common Pitfalls -WARNING: *Position-Independent* - link:/docs/commands/references/dtransform/[`dtransform`] ignores translation. Use link:/docs/commands/references/transform/[`transform`] for points. +WARNING: *Position-Independent* - link:/commands/references/dtransform/[`dtransform`] ignores translation. Use link:/commands/references/transform/[`transform`] for points. [source,postscript] ---- @@ -213,9 +213,9 @@ TIP: *Direction Vectors* - Use for transforming directions without position: * Translation components (tx, ty) are ignored * Only the linear transformation part [a b c d] is used -* Very fast operation (simpler than full link:/docs/commands/references/transform/[`transform`]) -* No risk of [`undefinedresult`] error (unlike link:/docs/commands/references/itransform/[`itransform`]) -* The inverse operation is link:/docs/commands/references/idtransform/[`idtransform`] +* Very fast operation (simpler than full link:/commands/references/transform/[`transform`]) +* No risk of [`undefinedresult`] error (unlike link:/commands/references/itransform/[`itransform`]) +* The inverse operation is link:/commands/references/idtransform/[`idtransform`] === Transformation Formula @@ -243,19 +243,19 @@ dy' = 0×10 + 3×20 = 60 |=== | Operation | Use For | Example -| link:/docs/commands/references/transform/[`transform`] +| link:/commands/references/transform/[`transform`] | Absolute positions, points | `100 100 moveto` -| link:/docs/commands/references/dtransform/[`dtransform`] +| link:/commands/references/dtransform/[`dtransform`] | Distances, vectors, offsets | Line width, dash lengths -| link:/docs/commands/references/itransform/[`itransform`] +| link:/commands/references/itransform/[`itransform`] | Device to user positions | Mouse coordinates -| link:/docs/commands/references/idtransform/[`idtransform`] +| link:/commands/references/idtransform/[`idtransform`] | Device to user distances | Device pixel size |=== @@ -310,15 +310,15 @@ dy' = 0×10 + 3×20 = 60 === Performance Considerations -* Faster than link:/docs/commands/references/transform/[`transform`] (no translation component) +* Faster than link:/commands/references/transform/[`transform`] (no translation component) * Simple matrix multiplication * Can be called frequently * No memory allocation === See Also -* link:/docs/commands/references/idtransform/[`idtransform`] - Inverse distance transformation -* link:/docs/commands/references/transform/[`transform`] - Transform coordinates (includes translation) -* link:/docs/commands/references/itransform/[`itransform`] - Inverse coordinate transformation -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width \ No newline at end of file +* link:/commands/references/idtransform/[`idtransform`] - Inverse distance transformation +* link:/commands/references/transform/[`transform`] - Transform coordinates (includes translation) +* link:/commands/references/itransform/[`itransform`] - Inverse coordinate transformation +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width \ No newline at end of file diff --git a/docs/commands/references/dup.adoc b/docs/commands/references/dup.adoc index cfdf3f3..8dc953c 100644 --- a/docs/commands/references/dup.adoc +++ b/docs/commands/references/dup.adoc @@ -200,7 +200,7 @@ dup length array copy % True independent copy 0 99 put % Only one array modified ---- -TIP: Remember that `dup` creates a shallow copy. For composite objects (arrays, dictionaries, strings), use the link:/docs/commands/references/copy/[`copy`] operator when you need an independent copy of the value. +TIP: Remember that `dup` creates a shallow copy. For composite objects (arrays, dictionaries, strings), use the link:/commands/references/copy/[`copy`] operator when you need an independent copy of the value. === Dictionary Sharing @@ -214,11 +214,11 @@ TIP: Remember that `dup` creates a shallow copy. For composite objects (arrays, == Related Commands -* link:/docs/commands/references/exch/[`exch`] - Exchange top two elements -* link:/docs/commands/references/copy/[`copy`] - Copy multiple elements or create independent copies -* link:/docs/commands/[`index`] - Duplicate nth element from top -* link:/docs/commands/references/roll/[`roll`] - Rotate stack elements -* link:/docs/commands/references/pop/[`pop`] - Remove top element +* link:/commands/references/exch/[`exch`] - Exchange top two elements +* link:/commands/references/copy/[`copy`] - Copy multiple elements or create independent copies +* link:/commands/[`index`] - Duplicate nth element from top +* link:/commands/references/roll/[`roll`] - Rotate stack elements +* link:/commands/references/pop/[`pop`] - Remove top element == PostScript Level @@ -257,7 +257,7 @@ For composite objects, `dup` only copies the reference, not the entire value, ma 1. **Use for calculations**: `dup` is essential when you need the same value multiple times in a calculation 2. **Understand object vs. value**: Remember that `dup` copies the object (reference), not the value for composite types 3. **Document stack effects**: Clearly document when procedures use `dup` to duplicate values -4. **Consider copy for independence**: Use link:/docs/commands/references/copy/[`copy`] when you need an independent copy of a composite object +4. **Consider copy for independence**: Use link:/commands/references/copy/[`copy`] when you need an independent copy of a composite object 5. **Combine with conditionals**: The pattern `dup ... { ... } { ... } ifelse` is very common === Good Stack Management @@ -284,7 +284,7 @@ For composite objects, `dup` only copies the reference, not the entire value, ma == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/basic/composite-objects/[Composite Objects] - Understanding object vs. value copying -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/basic/composite-objects/[Composite Objects] - Understanding object vs. value copying +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/end.adoc b/docs/commands/references/end.adoc index 0ddf0ea..13f49ff 100644 --- a/docs/commands/references/end.adoc +++ b/docs/commands/references/end.adoc @@ -37,9 +37,9 @@ Pops the current dictionary from the dictionary stack. === Description -link:/docs/commands/references/end/[`end`] pops the current dictionary off the dictionary stack, making the dictionary below it the new current dictionary. +link:/commands/references/end/[`end`] pops the current dictionary off the dictionary stack, making the dictionary below it the new current dictionary. -If link:/docs/commands/references/end/[`end`] attempts to pop the bottommost instance of `userdict`, it executes [`dictstackunderflow`] error. The permanent dictionaries (`systemdict`, `globaldict`, `userdict`) cannot be removed. +If link:/commands/references/end/[`end`] attempts to pop the bottommost instance of `userdict`, it executes [`dictstackunderflow`] error. The permanent dictionaries (`systemdict`, `globaldict`, `userdict`) cannot be removed. === PostScript Level @@ -109,7 +109,7 @@ end === Common Pitfalls -WARNING: *Unmatched end* - Executing link:/docs/commands/references/end/[`end`] without matching link:/docs/commands/references/begin/[`begin`] causes [`dictstackunderflow`]. +WARNING: *Unmatched end* - Executing link:/commands/references/end/[`end`] without matching link:/commands/references/begin/[`begin`] causes [`dictstackunderflow`]. [source,postscript] ---- @@ -165,7 +165,7 @@ end % Always match === See Also -* link:/docs/commands/references/begin/[`begin`] - Push dictionary onto stack -* link:/docs/commands/references/currentdict/[`currentdict`] - Get current dictionary -* link:/docs/commands/references/countdictstack/[`countdictstack`] - Count stack depth -* link:/docs/commands/references/dictstack/[`dictstack`] - Examine dictionary stack \ No newline at end of file +* link:/commands/references/begin/[`begin`] - Push dictionary onto stack +* link:/commands/references/currentdict/[`currentdict`] - Get current dictionary +* link:/commands/references/countdictstack/[`countdictstack`] - Count stack depth +* link:/commands/references/dictstack/[`dictstack`] - Examine dictionary stack \ No newline at end of file diff --git a/docs/commands/references/eoclip.adoc b/docs/commands/references/eoclip.adoc index b79a1e9..9914f5f 100644 --- a/docs/commands/references/eoclip.adoc +++ b/docs/commands/references/eoclip.adoc @@ -37,9 +37,9 @@ Intersects the current clipping path with the current path using the even-odd ru === Description -link:/docs/commands/references/eoclip/[`eoclip`] intersects the inside of the current clipping path with the inside of the current path to produce a new, smaller current clipping path. The inside of the current path is determined by the even-odd rule, while the inside of the current clipping path is determined by whatever rule was used at the time that path was created. +link:/commands/references/eoclip/[`eoclip`] intersects the inside of the current clipping path with the inside of the current path to produce a new, smaller current clipping path. The inside of the current path is determined by the even-odd rule, while the inside of the current clipping path is determined by whatever rule was used at the time that path was created. -Except for the choice of insideness rule, the behavior of link:/docs/commands/references/eoclip/[`eoclip`] is identical to that of link:/docs/commands/references/clip/[`clip`]. +Except for the choice of insideness rule, the behavior of link:/commands/references/eoclip/[`eoclip`] is identical to that of link:/commands/references/clip/[`clip`]. The even-odd rule determines whether a point is inside by counting path crossings: an odd number means inside, an even number means outside. This rule is particularly useful for creating clipping regions with holes. @@ -209,7 +209,7 @@ grestore === Common Pitfalls -WARNING: *Different Results from clip* - The even-odd rule produces different results than the non-zero winding number rule used by link:/docs/commands/references/clip/[`clip`]. +WARNING: *Different Results from clip* - The even-odd rule produces different results than the non-zero winding number rule used by link:/commands/references/clip/[`clip`]. [source,postscript] ---- @@ -240,7 +240,7 @@ gsave grestore ---- -WARNING: *Path Direction Irrelevant* - Unlike link:/docs/commands/references/clip/[`clip`], the direction paths are drawn doesn't matter with link:/docs/commands/references/eoclip/[`eoclip`]. +WARNING: *Path Direction Irrelevant* - Unlike link:/commands/references/clip/[`clip`], the direction paths are drawn doesn't matter with link:/commands/references/eoclip/[`eoclip`]. [source,postscript] ---- @@ -253,7 +253,7 @@ eoclip % Always creates hole regardless of direction newpath ---- -WARNING: *Path Not Cleared* - Like link:/docs/commands/references/clip/[`clip`], link:/docs/commands/references/eoclip/[`eoclip`] does not clear the path. +WARNING: *Path Not Cleared* - Like link:/commands/references/clip/[`clip`], link:/commands/references/eoclip/[`eoclip`] does not clear the path. [source,postscript] ---- @@ -265,7 +265,7 @@ eoclip newpath ---- -TIP: *Use for Predictable Holes* - link:/docs/commands/references/eoclip/[`eoclip`] is ideal for creating holes regardless of path direction: +TIP: *Use for Predictable Holes* - link:/commands/references/eoclip/[`eoclip`] is ideal for creating holes regardless of path direction: [source,postscript] ---- @@ -303,7 +303,7 @@ grestore === Even-Odd Rule Details -The even-odd rule for link:/docs/commands/references/eoclip/[`eoclip`]: +The even-odd rule for link:/commands/references/eoclip/[`eoclip`]: . Draw a ray from the point in any direction . Count the number of path segment crossings @@ -364,12 +364,12 @@ newpath % Important! gsave newpath % Border - 0 0 200 200 link:/docs/commands/references/arc/[`arc`] closepath + 0 0 200 200 link:/commands/references/arc/[`arc`] closepath % Holes (any direction works) - 50 50 30 30 link:/docs/commands/references/arc/[`arc`] closepath - 150 50 30 30 link:/docs/commands/references/arc/[`arc`] closepath - 50 150 30 30 link:/docs/commands/references/arc/[`arc`] closepath - 150 150 30 30 link:/docs/commands/references/arc/[`arc`] closepath + 50 50 30 30 link:/commands/references/arc/[`arc`] closepath + 150 50 30 30 link:/commands/references/arc/[`arc`] closepath + 50 150 30 30 link:/commands/references/arc/[`arc`] closepath + 150 150 30 30 link:/commands/references/arc/[`arc`] closepath eoclip newpath @@ -381,14 +381,14 @@ grestore === Comparing Even-Odd vs Non-Zero Winding -.Even-Odd Rule (link:/docs/commands/references/eoclip/[`eoclip`]) +.Even-Odd Rule (link:/commands/references/eoclip/[`eoclip`]) * Counts crossings: odd = inside, even = outside * Path direction doesn't matter * Simple to understand and predict * Natural for regions with holes * Alternating pattern for overlapping paths -.Non-Zero Winding Rule (link:/docs/commands/references/clip/[`clip`]) +.Non-Zero Winding Rule (link:/commands/references/clip/[`clip`]) * Counts direction of crossings * Path direction matters * More complex but more flexible @@ -462,12 +462,12 @@ grestore === See Also -* link:/docs/commands/references/clip/[`clip`] - Clip using non-zero winding rule -* link:/docs/commands/references/clippath/[`clippath`] - Get current clipping path -* link:/docs/commands/references/eofill/[`eofill`] - Fill using even-odd rule +* link:/commands/references/clip/[`clip`] - Clip using non-zero winding rule +* link:/commands/references/clippath/[`clippath`] - Get current clipping path +* link:/commands/references/eofill/[`eofill`] - Fill using even-odd rule * `rectclip` - Clip to rectangles (Level 2) * `initclip` - Reset to device default -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file diff --git a/docs/commands/references/eofill.adoc b/docs/commands/references/eofill.adoc index 529bc06..208dd7d 100644 --- a/docs/commands/references/eofill.adoc +++ b/docs/commands/references/eofill.adoc @@ -37,11 +37,11 @@ Paints the area enclosed by the current path using the even-odd rule. === Description -link:/docs/commands/references/eofill/[`eofill`] paints the inside of the current path with the current color, using the even-odd rule to determine what points are inside. Except for the choice of insideness rule, the behavior of link:/docs/commands/references/eofill/[`eofill`] is identical to that of link:/docs/commands/references/fill/[`fill`]. +link:/commands/references/eofill/[`eofill`] paints the inside of the current path with the current color, using the even-odd rule to determine what points are inside. Except for the choice of insideness rule, the behavior of link:/commands/references/eofill/[`eofill`] is identical to that of link:/commands/references/fill/[`fill`]. The even-odd rule determines whether a point is inside a path by drawing a ray from that point in any direction and counting the number of path segments that the ray crosses. If this number is odd, the point is inside; if even, the point is outside. This rule is useful for creating shapes with holes. -Like link:/docs/commands/references/fill/[`fill`], link:/docs/commands/references/eofill/[`eofill`] implicitly closes any open subpaths before painting and performs a link:/docs/commands/references/newpath/[`newpath`] after completion. +Like link:/commands/references/fill/[`fill`], link:/commands/references/eofill/[`eofill`] implicitly closes any open subpaths before painting and performs a link:/commands/references/newpath/[`newpath`] after completion. === PostScript Level @@ -147,7 +147,7 @@ eofill % Counter (hole) in 'O' is preserved === Common Pitfalls -WARNING: *Different Results from fill* - The even-odd rule produces different results than the non-zero winding number rule used by link:/docs/commands/references/fill/[`fill`]. +WARNING: *Different Results from fill* - The even-odd rule produces different results than the non-zero winding number rule used by link:/commands/references/fill/[`fill`]. [source,postscript] ---- @@ -170,7 +170,7 @@ grestore eofill % Even-odd: inner rectangle is a hole ---- -WARNING: *Path Direction Irrelevant* - Unlike link:/docs/commands/references/fill/[`fill`], the direction paths are drawn doesn't matter with link:/docs/commands/references/eofill/[`eofill`]. +WARNING: *Path Direction Irrelevant* - Unlike link:/commands/references/fill/[`fill`], the direction paths are drawn doesn't matter with link:/commands/references/eofill/[`eofill`]. [source,postscript] ---- @@ -192,7 +192,7 @@ closepath eofill % Same result regardless of direction ---- -TIP: *Use for Shapes with Holes* - link:/docs/commands/references/eofill/[`eofill`] is ideal for shapes with holes, regardless of path direction: +TIP: *Use for Shapes with Holes* - link:/commands/references/eofill/[`eofill`] is ideal for shapes with holes, regardless of path direction: [source,postscript] ---- @@ -225,14 +225,14 @@ eofill % Creates ring pattern === Comparing Even-Odd vs Non-Zero Winding -.Even-Odd Rule (link:/docs/commands/references/eofill/[`eofill`]) +.Even-Odd Rule (link:/commands/references/eofill/[`eofill`]) * Counts crossings: odd = inside, even = outside * Path direction doesn't matter * Simple to understand and predict * Natural for shapes with holes * Alternating fill pattern for overlapping paths -.Non-Zero Winding Rule (link:/docs/commands/references/fill/[`fill`]) +.Non-Zero Winding Rule (link:/commands/references/fill/[`fill`]) * Counts direction of crossings * Path direction matters * More complex but more flexible @@ -307,9 +307,9 @@ stroke % Then stroke the path === See Also -* link:/docs/commands/references/fill/[`fill`] - Fill using non-zero winding rule -* link:/docs/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule -* link:/docs/commands/references/ueofill/[`ueofill`] - Even-odd fill user path (Level 2) -* link:/docs/commands/references/stroke/[`stroke`] - Paint path outline -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file +* link:/commands/references/fill/[`fill`] - Fill using non-zero winding rule +* link:/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule +* link:/commands/references/ueofill/[`ueofill`] - Even-odd fill user path (Level 2) +* link:/commands/references/stroke/[`stroke`] - Paint path outline +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file diff --git a/docs/commands/references/exch.adoc b/docs/commands/references/exch.adoc index 0b10e54..9636b04 100644 --- a/docs/commands/references/exch.adoc +++ b/docs/commands/references/exch.adoc @@ -185,11 +185,11 @@ add % ERROR: typecheck (can't add string and number) == Related Commands -* link:/docs/commands/references/dup/[`dup`] - Duplicate top element before exchanging -* link:/docs/commands/references/roll/[`roll`] - General stack rotation for multiple elements -* link:/docs/commands/[`index`] - Access elements deeper in the stack -* link:/docs/commands/references/pop/[`pop`] - Remove top element -* link:/docs/commands/references/copy/[`copy`] - Copy multiple stack elements +* link:/commands/references/dup/[`dup`] - Duplicate top element before exchanging +* link:/commands/references/roll/[`roll`] - General stack rotation for multiple elements +* link:/commands/[`index`] - Access elements deeper in the stack +* link:/commands/references/pop/[`pop`] - Remove top element +* link:/commands/references/copy/[`copy`] - Copy multiple stack elements == PostScript Level @@ -236,6 +236,6 @@ The `exch` operator is extremely fast and has negligible performance impact. It' == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/exec.adoc b/docs/commands/references/exec.adoc index 40dc45b..dbde58c 100644 --- a/docs/commands/references/exec.adoc +++ b/docs/commands/references/exec.adoc @@ -37,7 +37,7 @@ any exec → – === Description -link:/docs/commands/references/exec/[`exec`] pushes the operand on the execution stack, executing it immediately. +link:/commands/references/exec/[`exec`] pushes the operand on the execution stack, executing it immediately. The effect depends on the object's type and literal/executable attribute: @@ -132,7 +132,7 @@ WARNING: *Security Risk* - Executing arbitrary strings can be dangerous. userInput cvx exec % Dangerous if userInput malicious! ---- -TIP: *Check Executable Attribute* - Use link:/docs/commands/references/xcheck/[`xcheck`] to verify before execution. +TIP: *Check Executable Attribute* - Use link:/commands/references/xcheck/[`xcheck`] to verify before execution. === Error Conditions @@ -191,8 +191,8 @@ TIP: *Check Executable Attribute* - Use link:/docs/commands/references/xcheck/[` === See Also -* link:/docs/commands/references/cvx/[`cvx`] - Convert to executable -* link:/docs/commands/references/cvlit/[`cvlit`] - Convert to literal -* link:/docs/commands/references/xcheck/[`xcheck`] - Check if executable -* link:/docs/commands/references/stopped/[`stopped`] - Execute with error catching -* link:/docs/commands/references/if/[`if`] / link:/docs/commands/references/ifelse/[`ifelse`] - Conditional execution \ No newline at end of file +* link:/commands/references/cvx/[`cvx`] - Convert to executable +* link:/commands/references/cvlit/[`cvlit`] - Convert to literal +* link:/commands/references/xcheck/[`xcheck`] - Check if executable +* link:/commands/references/stopped/[`stopped`] - Execute with error catching +* link:/commands/references/if/[`if`] / link:/commands/references/ifelse/[`ifelse`] - Conditional execution \ No newline at end of file diff --git a/docs/commands/references/exit.adoc b/docs/commands/references/exit.adoc index 1a81deb..3ce4114 100644 --- a/docs/commands/references/exit.adoc +++ b/docs/commands/references/exit.adoc @@ -28,17 +28,17 @@ Terminates the innermost enclosing loop. === Description -link:/docs/commands/references/exit/[`exit`] terminates execution of the innermost, dynamically enclosing looping context, regardless of lexical relationship. +link:/commands/references/exit/[`exit`] terminates execution of the innermost, dynamically enclosing looping context, regardless of lexical relationship. Valid looping contexts created by: -* link:/docs/commands/references/for/[`for`] -* link:/docs/commands/references/repeat/[`repeat`] -* link:/docs/commands/references/loop/[`loop`] -* link:/docs/commands/references/../array-string/forall/[`forall`] +* link:/commands/references/for/[`for`] +* link:/commands/references/repeat/[`repeat`] +* link:/commands/references/loop/[`loop`] +* link:/commands/references/forall/[`forall`] * `pathforall`, `kshow`, `cshow`, `filenameforall`, `resourceforall` -link:/docs/commands/references/exit/[`exit`] pops the execution stack to the level of the loop operator, then resumes execution at the next object after that operator. +link:/commands/references/exit/[`exit`] pops the execution stack to the level of the loop operator, then resumes execution at the next object after that operator. === PostScript Level @@ -133,7 +133,7 @@ link:/docs/commands/references/exit/[`exit`] pops the execution stack to the lev === Common Pitfalls -WARNING: *Must Be in Loop* - link:/docs/commands/references/exit/[`exit`] only works within a looping context. +WARNING: *Must Be in Loop* - link:/commands/references/exit/[`exit`] only works within a looping context. [source,postscript] ---- @@ -179,8 +179,8 @@ TIP: *Use Flag for Outer Loop Exit* - Set a flag variable to exit multiple level === See Also -* link:/docs/commands/references/for/[`for`] - Numeric loop -* link:/docs/commands/references/repeat/[`repeat`] - Fixed repetition -* link:/docs/commands/references/loop/[`loop`] - Indefinite loop -* link:/docs/commands/references/stop/[`stop`] - Exit stopped context -* link:/docs/commands/references/forall/[`forall`] - Collection iteration \ No newline at end of file +* link:/commands/references/for/[`for`] - Numeric loop +* link:/commands/references/repeat/[`repeat`] - Fixed repetition +* link:/commands/references/loop/[`loop`] - Indefinite loop +* link:/commands/references/stop/[`stop`] - Exit stopped context +* link:/commands/references/forall/[`forall`] - Collection iteration \ No newline at end of file diff --git a/docs/commands/references/exp.adoc b/docs/commands/references/exp.adoc index ba7616b..0d5ef79 100644 --- a/docs/commands/references/exp.adoc +++ b/docs/commands/references/exp.adoc @@ -87,10 +87,10 @@ base exponent exp real == Related Commands -* link:/docs/commands/references/sqrt/[`sqrt`] - Square root -* link:/docs/commands/references/ln/[`ln`] - Natural logarithm -* link:/docs/commands/references/log/[`log`] - Base-10 logarithm -* link:/docs/commands/references/mul/[`mul`] - Multiplication +* link:/commands/references/sqrt/[`sqrt`] - Square root +* link:/commands/references/ln/[`ln`] - Natural logarithm +* link:/commands/references/log/[`log`] - Base-10 logarithm +* link:/commands/references/mul/[`mul`] - Multiplication == PostScript Level @@ -114,4 +114,4 @@ Negative base with fractional exponent, or result out of range. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/fill.adoc b/docs/commands/references/fill.adoc index d603e6c..83fd737 100644 --- a/docs/commands/references/fill.adoc +++ b/docs/commands/references/fill.adoc @@ -37,11 +37,11 @@ Paints the area enclosed by the current path with the current color. === Description -link:/docs/commands/references/fill/[`fill`] paints the area enclosed by the current path with the current color. Any previous contents of that area on the current page are obscured, so areas may be erased by filling with color set to white. +link:/commands/references/fill/[`fill`] paints the area enclosed by the current path with the current color. Any previous contents of that area on the current page are obscured, so areas may be erased by filling with color set to white. -Before painting, link:/docs/commands/references/fill/[`fill`] implicitly closes any open subpaths of the current path. The inside of the current path is determined by the normal non-zero winding number rule. +Before painting, link:/commands/references/fill/[`fill`] implicitly closes any open subpaths of the current path. The inside of the current path is determined by the normal non-zero winding number rule. -link:/docs/commands/references/fill/[`fill`] implicitly performs a link:/docs/commands/references/newpath/[`newpath`] after it has finished filling the current path. To preserve the current path across a fill operation, use the sequence: +link:/commands/references/fill/[`fill`] implicitly performs a link:/commands/references/newpath/[`newpath`] after it has finished filling the current path. To preserve the current path across a fill operation, use the sequence: [source,postscript] ---- @@ -172,7 +172,7 @@ fill % Both rectangles filled (non-zero winding rule) === Common Pitfalls -WARNING: *Path Consumed After Fill* - link:/docs/commands/references/fill/[`fill`] clears the current path after execution. Use link:/docs/commands/references/gsave/[`gsave`] and link:/docs/commands/references/grestore/[`grestore`] to preserve it. +WARNING: *Path Consumed After Fill* - link:/commands/references/fill/[`fill`] clears the current path after execution. Use link:/commands/references/gsave/[`gsave`] and link:/commands/references/grestore/[`grestore`] to preserve it. [source,postscript] ---- @@ -223,7 +223,7 @@ stroke === Implementation Notes -* link:/docs/commands/references/fill/[`fill`] uses the non-zero winding number rule to determine which areas are inside the path +* link:/commands/references/fill/[`fill`] uses the non-zero winding number rule to determine which areas are inside the path * Overlapping subpaths may create holes or fills depending on their direction * The current color and color space determine the fill color * Clipping is applied after the fill area is determined @@ -231,14 +231,14 @@ stroke === Interaction with Graphics State -link:/docs/commands/references/fill/[`fill`] is affected by: +link:/commands/references/fill/[`fill`] is affected by: * Current color and color space * Current clipping path * Current transformation matrix (CTM) * Flatness parameter (for curved paths) -link:/docs/commands/references/fill/[`fill`] does not affect: +link:/commands/references/fill/[`fill`] does not affect: * Line width or line parameters * Current point (path is cleared) @@ -306,11 +306,11 @@ fill === See Also -* link:/docs/commands/references/eofill/[`eofill`] - Fill using even-odd rule -* link:/docs/commands/references/stroke/[`stroke`] - Paint path outline -* link:/docs/commands/references/clip/[`clip`] - Clip to path interior -* link:/docs/commands/references/ufill/[`ufill`] - Fill user path (Level 2) -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath -* link:/docs/commands/references/setgray/[`setgray`] - Set gray color -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color \ No newline at end of file +* link:/commands/references/eofill/[`eofill`] - Fill using even-odd rule +* link:/commands/references/stroke/[`stroke`] - Paint path outline +* link:/commands/references/clip/[`clip`] - Clip to path interior +* link:/commands/references/ufill/[`ufill`] - Fill user path (Level 2) +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/closepath/[`closepath`] - Close current subpath +* link:/commands/references/setgray/[`setgray`] - Set gray color +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color \ No newline at end of file diff --git a/docs/commands/references/findfont.adoc b/docs/commands/references/findfont.adoc index 3dc6b4a..b371b35 100644 --- a/docs/commands/references/findfont.adoc +++ b/docs/commands/references/findfont.adoc @@ -29,15 +29,15 @@ font === Description -link:/docs/commands/references/findfont/[`findfont`] obtains a font dictionary identified by the specified `key` and pushes it on the operand stack. The `key` may be a key previously passed to link:/docs/commands/references/definefont/[`definefont`], in which case the font dictionary associated with `key` (in the font directory) is returned. +link:/commands/references/findfont/[`findfont`] obtains a font dictionary identified by the specified `key` and pushes it on the operand stack. The `key` may be a key previously passed to link:/commands/references/definefont/[`definefont`], in which case the font dictionary associated with `key` (in the font directory) is returned. -If `key` is not registered as a font in VM, link:/docs/commands/references/findfont/[`findfont`] takes an action that varies according to the environment in which the PostScript interpreter is operating. In some environments, link:/docs/commands/references/findfont/[`findfont`] may attempt to read a font definition from an external source, such as a file. In other environments, link:/docs/commands/references/findfont/[`findfont`] substitutes a default font or executes the error `invalidfont`. +If `key` is not registered as a font in VM, link:/commands/references/findfont/[`findfont`] takes an action that varies according to the environment in which the PostScript interpreter is operating. In some environments, link:/commands/references/findfont/[`findfont`] may attempt to read a font definition from an external source, such as a file. In other environments, link:/commands/references/findfont/[`findfont`] substitutes a default font or executes the error `invalidfont`. -link:/docs/commands/references/findfont/[`findfont`] is a special case of `findresource` applied to the Font category. +link:/commands/references/findfont/[`findfont`] is a special case of `findresource` applied to the Font category. -link:/docs/commands/references/findfont/[`findfont`], like `findresource`, normally looks first for fonts defined in local VM, then for fonts defined in global VM. However, if the current VM allocation mode is global, link:/docs/commands/references/findfont/[`findfont`] considers only fonts defined in global VM. If link:/docs/commands/references/findfont/[`findfont`] needs to load a font into VM, it may use either local or global VM, depending on the font. Generally, Type 1 fonts are loaded into global VM; fonts of other types are loaded into local VM. +link:/commands/references/findfont/[`findfont`], like `findresource`, normally looks first for fonts defined in local VM, then for fonts defined in global VM. However, if the current VM allocation mode is global, link:/commands/references/findfont/[`findfont`] considers only fonts defined in global VM. If link:/commands/references/findfont/[`findfont`] needs to load a font into VM, it may use either local or global VM, depending on the font. Generally, Type 1 fonts are loaded into global VM; fonts of other types are loaded into local VM. -link:/docs/commands/references/findfont/[`findfont`] is not an operator, but rather a built-in procedure. It may be redefined by a PostScript language program that requires different strategies for finding fonts. +link:/commands/references/findfont/[`findfont`] is not an operator, but rather a built-in procedure. It may be redefined by a PostScript language program that requires different strategies for finding fonts. === Parameters @@ -92,8 +92,8 @@ setfont % Set as current font The font discovery mechanism varies by implementation: -1. **Local VM fonts** - Defined by link:/docs/commands/references/definefont/[`definefont`] in local VM -2. **Global VM fonts** - Defined by link:/docs/commands/references/definefont/[`definefont`] in global VM +1. **Local VM fonts** - Defined by link:/commands/references/definefont/[`definefont`] in local VM +2. **Global VM fonts** - Defined by link:/commands/references/definefont/[`definefont`] in global VM 3. **External fonts** - Loaded from font files or other external sources 4. **Substitution fonts** - Default fonts substituted when requested font not found @@ -107,8 +107,8 @@ When loading fonts from external sources: === See Also -- link:/docs/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor -- link:/docs/commands/references/makefont/[`makefont`] - Transform font by matrix -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font -- link:/docs/commands/references/definefont/[`definefont`] - Register font in font directory -- link:/docs/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file +- link:/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor +- link:/commands/references/makefont/[`makefont`] - Transform font by matrix +- link:/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/definefont/[`definefont`] - Register font in font directory +- link:/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file diff --git a/docs/commands/references/floor.adoc b/docs/commands/references/floor.adoc index fac2ed1..61b8a80 100644 --- a/docs/commands/references/floor.adoc +++ b/docs/commands/references/floor.adoc @@ -245,10 +245,10 @@ The operand must be numeric (integer or real). Other types will cause a `typeche == Related Commands -* link:/docs/commands/references/ceiling/[`ceiling`] - Round up to integer -* link:/docs/commands/references/round/[`round`] - Round to nearest integer -* link:/docs/commands/references/truncate/[`truncate`] - Truncate toward zero -* link:/docs/commands/references/div/[`div`] - Division (returns real) +* link:/commands/references/ceiling/[`ceiling`] - Round up to integer +* link:/commands/references/round/[`round`] - Round to nearest integer +* link:/commands/references/truncate/[`truncate`] - Truncate toward zero +* link:/commands/references/div/[`div`] - Division (returns real) == PostScript Level @@ -331,5 +331,5 @@ The `floor` operator is fast: == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/for.adoc b/docs/commands/references/for.adoc index bec043c..a3d76c4 100644 --- a/docs/commands/references/for.adoc +++ b/docs/commands/references/for.adoc @@ -46,7 +46,7 @@ initial increment limit proc for → – === Description -link:/docs/commands/references/for/[`for`] executes _proc_ repeatedly, passing it a sequence of values from _initial_ by steps of _increment_ to _limit_. +link:/commands/references/for/[`for`] executes _proc_ repeatedly, passing it a sequence of values from _initial_ by steps of _increment_ to _limit_. The operator maintains an internal control variable: 1. Sets control variable to _initial_ @@ -161,7 +161,7 @@ WARNING: *Increment Sign Matters* - Positive increment counts up, negative count 5 -1 1 { } for % Executes: 5, 4, 3, 2, 1 ---- -TIP: *Early Exit* - Use link:/docs/commands/references/exit/[`exit`] to terminate loop early. +TIP: *Early Exit* - Use link:/commands/references/exit/[`exit`] to terminate loop early. === Error Conditions @@ -192,19 +192,19 @@ TIP: *Early Exit* - Use link:/docs/commands/references/exit/[`exit`] to terminat |=== | Loop | Best For | Control Variable -| link:/docs/commands/references/for/[`for`] +| link:/commands/references/for/[`for`] | Numeric sequences | Yes -| link:/docs/commands/references/repeat/[`repeat`] +| link:/commands/references/repeat/[`repeat`] | Fixed count, no variable needed | No -| link:/docs/commands/references/loop/[`loop`] +| link:/commands/references/loop/[`loop`] | Indefinite/conditional termination | No -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Collection iteration | Yes (element) |=== @@ -227,8 +227,8 @@ TIP: *Early Exit* - Use link:/docs/commands/references/exit/[`exit`] to terminat === See Also -* link:/docs/commands/references/repeat/[`repeat`] - Fixed repetition -* link:/docs/commands/references/loop/[`loop`] - Indefinite loop -* link:/docs/commands/references/exit/[`exit`] - Exit loop early -* link:/docs/commands/references/forall/[`forall`] - Iterate collections -* link:/docs/commands/references/if/[`if`] / link:/docs/commands/references/ifelse/[`ifelse`] - Conditionals \ No newline at end of file +* link:/commands/references/repeat/[`repeat`] - Fixed repetition +* link:/commands/references/loop/[`loop`] - Indefinite loop +* link:/commands/references/exit/[`exit`] - Exit loop early +* link:/commands/references/forall/[`forall`] - Iterate collections +* link:/commands/references/if/[`if`] / link:/commands/references/ifelse/[`ifelse`] - Conditionals \ No newline at end of file diff --git a/docs/commands/references/forall.adoc b/docs/commands/references/forall.adoc index 6fd5edd..7d9d3a2 100644 --- a/docs/commands/references/forall.adoc +++ b/docs/commands/references/forall.adoc @@ -43,7 +43,7 @@ string proc forall → – === Description -link:/docs/commands/references/forall/[`forall`] enumerates elements of the first operand, executing _proc_ for each: +link:/commands/references/forall/[`forall`] enumerates elements of the first operand, executing _proc_ for each: * **Arrays/packed arrays**: Pushes each element and executes _proc_ * **Strings**: Pushes each character code (0-255) and executes _proc_ @@ -51,7 +51,7 @@ link:/docs/commands/references/forall/[`forall`] enumerates elements of the firs For arrays and strings, elements are processed in index order (0 to n-1). For dictionaries, the order is arbitrary. -If the composite object is empty (length 0), link:/docs/commands/references/forall/[`forall`] does not execute _proc_ at all. +If the composite object is empty (length 0), link:/commands/references/forall/[`forall`] does not execute _proc_ at all. === PostScript Level @@ -144,7 +144,7 @@ WARNING: *Dictionary Order is Arbitrary* - Dictionaries enumerate in unpredictab mydict { } forall % Order not guaranteed ---- -WARNING: *Modifying During Iteration* - Adding/removing dictionary entries during link:/docs/commands/references/forall/[`forall`] may or may not affect iteration. +WARNING: *Modifying During Iteration* - Adding/removing dictionary entries during link:/commands/references/forall/[`forall`] may or may not affect iteration. TIP: *Use exit for Early Termination* - Execute [`exit`] within _proc_ to stop iteration. @@ -201,11 +201,11 @@ TIP: *Use exit for Early Termination* - Execute [`exit`] within _proc_ to stop i } for ---- -link:/docs/commands/references/forall/[`forall`] is simpler and more efficient. +link:/commands/references/forall/[`forall`] is simpler and more efficient. === See Also -* link:/docs/commands/references/aload/[`aload`] - Load all elements onto stack -* link:/docs/commands/references/get/[`get`] - Get single element -* link:/docs/commands/references/length/[`length`] - Get number of elements +* link:/commands/references/aload/[`aload`] - Load all elements onto stack +* link:/commands/references/get/[`get`] - Get single element +* link:/commands/references/length/[`length`] - Get number of elements * Control Flow: `for`, `repeat`, `loop` - Other iteration constructs \ No newline at end of file diff --git a/docs/commands/references/get.adoc b/docs/commands/references/get.adoc index f4878e4..2e4b92a 100644 --- a/docs/commands/references/get.adoc +++ b/docs/commands/references/get.adoc @@ -64,7 +64,7 @@ string index get → int === Description -link:/docs/commands/references/get/[`get`] retrieves a single element from a composite object: +link:/commands/references/get/[`get`] retrieves a single element from a composite object: * For arrays and packed arrays: returns the element at the specified index * For strings: returns the integer character code (0-255) at the specified index @@ -134,7 +134,7 @@ configdict /PageSize get % Get page size setting === Common Pitfalls -WARNING: *String Returns Integer* - link:/docs/commands/references/get/[`get`] on a string returns an integer (character code), not a one-character string. +WARNING: *String Returns Integer* - link:/commands/references/get/[`get`] on a string returns an integer (character code), not a one-character string. [source,postscript] ---- @@ -155,7 +155,7 @@ WARNING: *Dictionary Key Not Found* - If the key doesn't exist in a dictionary, 5 dict /nokey get % Error: key not in dictionary ---- -TIP: *Use known/where First* - For dictionaries, use `where` or `known` to check if a key exists before using link:/docs/commands/references/get/[`get`]. +TIP: *Use known/where First* - For dictionaries, use `where` or `known` to check if a key exists before using link:/commands/references/get/[`get`]. === Error Conditions @@ -191,12 +191,12 @@ TIP: *Use known/where First* - For dictionaries, use `where` or `known` to check * Direct array indexing is very fast * String character access is equally fast * Dictionary lookup slightly slower but still efficient -* For sequential access, link:/docs/commands/references/forall/[`forall`] may be more efficient than repeated link:/docs/commands/references/get/[`get`] calls +* For sequential access, link:/commands/references/forall/[`forall`] may be more efficient than repeated link:/commands/references/get/[`get`] calls === See Also -* link:/docs/commands/references/put/[`put`] - Store value in array/string/dictionary -* link:/docs/commands/references/getinterval/[`getinterval`] - Get subarray or substring -* link:/docs/commands/references/length/[`length`] - Get length of array/string -* link:/docs/commands/references/aload/[`aload`] - Load all array elements -* link:/docs/commands/references/forall/[`forall`] - Iterate over elements \ No newline at end of file +* link:/commands/references/put/[`put`] - Store value in array/string/dictionary +* link:/commands/references/getinterval/[`getinterval`] - Get subarray or substring +* link:/commands/references/length/[`length`] - Get length of array/string +* link:/commands/references/aload/[`aload`] - Load all array elements +* link:/commands/references/forall/[`forall`] - Iterate over elements \ No newline at end of file diff --git a/docs/commands/references/getinterval.adoc b/docs/commands/references/getinterval.adoc index 21a739b..67973e7 100644 --- a/docs/commands/references/getinterval.adoc +++ b/docs/commands/references/getinterval.adoc @@ -45,7 +45,7 @@ string index count getinterval → substring === Description -link:/docs/commands/references/getinterval/[`getinterval`] creates a new array, packed array, or string object whose value consists of _count_ elements starting at position _index_ in the original object. +link:/commands/references/getinterval/[`getinterval`] creates a new array, packed array, or string object whose value consists of _count_ elements starting at position _index_ in the original object. The elements in the subsequence are **shared** between the original and new objects - modifying one affects the other. @@ -169,7 +169,7 @@ TIP: *Empty Intervals* - _count_ can be 0, which returns an empty array/string. === See Also -* link:/docs/commands/references/putinterval/[`putinterval`] - Insert array/string into another -* link:/docs/commands/references/get/[`get`] - Get single element -* link:/docs/commands/references/length/[`length`] - Get length -* link:/docs/commands/references/aload/[`aload`] - Load all elements onto stack \ No newline at end of file +* link:/commands/references/putinterval/[`putinterval`] - Insert array/string into another +* link:/commands/references/get/[`get`] - Get single element +* link:/commands/references/length/[`length`] - Get length +* link:/commands/references/aload/[`aload`] - Load all elements onto stack \ No newline at end of file diff --git a/docs/commands/references/grestore.adoc b/docs/commands/references/grestore.adoc index 7d2e3ac..a254830 100644 --- a/docs/commands/references/grestore.adoc +++ b/docs/commands/references/grestore.adoc @@ -28,9 +28,9 @@ Restores the graphics state from the top of the graphics state stack. === Description -link:/docs/commands/references/grestore/[`grestore`] resets the current graphics state from the one on top of the graphics state stack and pops that stack. +link:/commands/references/grestore/[`grestore`] resets the current graphics state from the one on top of the graphics state stack and pops that stack. -If there is no matching link:/docs/commands/references/gsave/[`gsave`], or if the most recent link:/docs/commands/references/gsave/[`gsave`] preceded the most recent unmatched `save`, link:/docs/commands/references/grestore/[`grestore`] does not pop the stack, but still restores the state from the top. +If there is no matching link:/commands/references/gsave/[`gsave`], or if the most recent link:/commands/references/gsave/[`gsave`] preceded the most recent unmatched `save`, link:/commands/references/grestore/[`grestore`] does not pop the stack, but still restores the state from the top. === PostScript Level @@ -109,7 +109,7 @@ grestore === Common Pitfalls -WARNING: *Must Have Matching gsave* - Unmatched link:/docs/commands/references/grestore/[`grestore`] doesn't error but doesn't pop stack. +WARNING: *Must Have Matching gsave* - Unmatched link:/commands/references/grestore/[`grestore`] doesn't error but doesn't pop stack. [source,postscript] ---- @@ -117,7 +117,7 @@ grestore % No matching gsave % State restored from top but stack not popped ---- -WARNING: *save Intervenes* - link:/docs/commands/references/grestore/[`grestore`] after `save` doesn't pop stack. +WARNING: *save Intervenes* - link:/commands/references/grestore/[`grestore`] after `save` doesn't pop stack. [source,postscript] ---- @@ -127,7 +127,7 @@ grestore % Doesn't pop due to save restore % Pops graphics state stack ---- -TIP: *Always Pair with gsave* - Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] pairs consistently. +TIP: *Always Pair with gsave* - Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] pairs consistently. === Error Conditions @@ -148,7 +148,7 @@ TIP: *Always Pair with gsave* - Use link:/docs/commands/references/gsave/[`gsave === What Gets Restored -All parameters saved by link:/docs/commands/references/gsave/[`gsave`]: +All parameters saved by link:/commands/references/gsave/[`gsave`]: * CTM, path, current point * Clipping path * Color space and color @@ -158,7 +158,7 @@ All parameters saved by link:/docs/commands/references/gsave/[`gsave`]: === See Also -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestoreall/[`grestoreall`] - Restore all levels -* link:/docs/commands/references/setgstate/[`setgstate`] - Set from gstate object +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestoreall/[`grestoreall`] - Restore all levels +* link:/commands/references/setgstate/[`setgstate`] - Set from gstate object * `save`, `restore` - VM and graphics state \ No newline at end of file diff --git a/docs/commands/references/grestoreall.adoc b/docs/commands/references/grestoreall.adoc index 6dd8389..4f19c0c 100644 --- a/docs/commands/references/grestoreall.adoc +++ b/docs/commands/references/grestoreall.adoc @@ -37,7 +37,7 @@ Restores graphics state to bottommost saved level. === Description -link:/docs/commands/references/grestoreall/[`grestoreall`] performs the equivalent of executing link:/docs/commands/references/grestore/[`grestore`] repeatedly until there are no saved graphics states remaining on the graphics state stack. After executing link:/docs/commands/references/grestoreall/[`grestoreall`], the current graphics state is the bottommost one that was saved by the first link:/docs/commands/references/gsave/[`gsave`] or by link:../resource-management/save/[`save`]. +link:/commands/references/grestoreall/[`grestoreall`] performs the equivalent of executing link:/commands/references/grestore/[`grestore`] repeatedly until there are no saved graphics states remaining on the graphics state stack. After executing link:/commands/references/grestoreall/[`grestoreall`], the current graphics state is the bottommost one that was saved by the first link:/commands/references/gsave/[`gsave`] or by link:/commands/references/save/[`save`]. This operator: @@ -46,7 +46,7 @@ This operator: * Resets the current path to empty * Does not affect the operand or dictionary stacks -link:/docs/commands/references/grestoreall/[`grestoreall`] is particularly useful for error recovery and cleanup, ensuring a known graphics state regardless of how many link:/docs/commands/references/gsave/[`gsave`] operations have been performed. +link:/commands/references/grestoreall/[`grestoreall`] is particularly useful for error recovery and cleanup, ensuring a known graphics state regardless of how many link:/commands/references/gsave/[`gsave`] operations have been performed. === PostScript Level @@ -176,7 +176,7 @@ grestoreall % All undone at once === Common Pitfalls -WARNING: *Clears ALL Saved States* - link:/docs/commands/references/grestoreall/[`grestoreall`] removes all graphics states, not just one. +WARNING: *Clears ALL Saved States* - link:/commands/references/grestoreall/[`grestoreall`] removes all graphics states, not just one. [source,postscript] ---- @@ -198,7 +198,7 @@ grestoreall % Stack: 1 2 3 4 5 6 (not 1 2 3) ---- -WARNING: *Current Path Reset* - Like link:/docs/commands/references/grestore/[`grestore`], the current path becomes empty. +WARNING: *Current Path Reset* - Like link:/commands/references/grestore/[`grestore`], the current path becomes empty. [source,postscript] ---- @@ -212,11 +212,11 @@ TIP: *Use for Error Handling* - Ideal for ensuring clean state after errors. === Error Conditions -No errors under normal operation. link:/docs/commands/references/grestoreall/[`grestoreall`] succeeds even if no graphics states were saved. +No errors under normal operation. link:/commands/references/grestoreall/[`grestoreall`] succeeds even if no graphics states were saved. === Implementation Notes -* Equivalent to repeated link:/docs/commands/references/grestore/[`grestore`] until no saved states remain +* Equivalent to repeated link:/commands/references/grestore/[`grestore`] until no saved states remain * Very fast operation * Safe to call even if no states are saved * Does not generate errors @@ -243,7 +243,7 @@ Saved State 0 ← current (bottommost) === Interaction with save/restore -link:/docs/commands/references/grestoreall/[`grestoreall`] restores graphics state to the bottommost level **within the current save context**. It does not cross link:../resource-management/save/[`save`] boundaries: +link:/commands/references/grestoreall/[`grestoreall`] restores graphics state to the bottommost level **within the current save context**. It does not cross link:/commands/references/save/[`save`] boundaries: [source,postscript] ---- @@ -258,8 +258,8 @@ restore % Returns to before save === See Also -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore one graphics state -* link:/docs/commands/references/gstate/[`gstate`] - Create graphics state object -* link:/docs/commands/references/setgstate/[`setgstate`] - Set graphics state from object -* link:/docs/commands/references/stopped/[`stopped`] - Error handling \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore one graphics state +* link:/commands/references/gstate/[`gstate`] - Create graphics state object +* link:/commands/references/setgstate/[`setgstate`] - Set graphics state from object +* link:/commands/references/stopped/[`stopped`] - Error handling \ No newline at end of file diff --git a/docs/commands/references/gsave.adoc b/docs/commands/references/gsave.adoc index 8f7bc4d..3975665 100644 --- a/docs/commands/references/gsave.adoc +++ b/docs/commands/references/gsave.adoc @@ -28,7 +28,7 @@ Pushes a copy of the current graphics state onto the graphics state stack. === Description -link:/docs/commands/references/gsave/[`gsave`] pushes a copy of the current graphics state onto the graphics state stack. All elements of the graphics state are saved, including: +link:/commands/references/gsave/[`gsave`] pushes a copy of the current graphics state onto the graphics state stack. All elements of the graphics state are saved, including: * Current transformation matrix (CTM) * Current path @@ -41,7 +41,7 @@ link:/docs/commands/references/gsave/[`gsave`] pushes a copy of the current grap Raster memory contents are NOT saved. -The saved state can later be restored by link:/docs/commands/references/grestore/[`grestore`]. +The saved state can later be restored by link:/commands/references/grestore/[`grestore`]. === PostScript Level @@ -136,7 +136,7 @@ elements { === Common Pitfalls -WARNING: *Must Match with grestore* - Every link:/docs/commands/references/gsave/[`gsave`] must have matching link:/docs/commands/references/grestore/[`grestore`]. +WARNING: *Must Match with grestore* - Every link:/commands/references/gsave/[`gsave`] must have matching link:/commands/references/grestore/[`grestore`]. [source,postscript] ---- @@ -153,7 +153,7 @@ WARNING: *Limited Stack Depth* - Graphics state stack has implementation-depende { gsave } repeat % Eventually: limitcheck ---- -TIP: *Use for All Temporary Changes* - Always bracket temporary state changes with link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`]. +TIP: *Use for All Temporary Changes* - Always bracket temporary state changes with link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`]. === Error Conditions @@ -193,8 +193,8 @@ TIP: *Use for All Temporary Changes* - Always bracket temporary state changes wi === See Also -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state -* link:/docs/commands/references/grestoreall/[`grestoreall`] - Restore all levels -* link:/docs/commands/references/gstate/[`gstate`] - Create gstate object (Level 2) -* link:/docs/commands/references/setgstate/[`setgstate`] - Set from gstate (Level 2) +* link:/commands/references/grestore/[`grestore`] - Restore graphics state +* link:/commands/references/grestoreall/[`grestoreall`] - Restore all levels +* link:/commands/references/gstate/[`gstate`] - Create gstate object (Level 2) +* link:/commands/references/setgstate/[`setgstate`] - Set from gstate (Level 2) * VM operations: `save`, `restore` - Also save graphics state \ No newline at end of file diff --git a/docs/commands/references/gstate.adoc b/docs/commands/references/gstate.adoc index f95b9cc..253ae57 100644 --- a/docs/commands/references/gstate.adoc +++ b/docs/commands/references/gstate.adoc @@ -37,7 +37,7 @@ Creates a graphics state object. === Description -link:/docs/commands/references/gstate/[`gstate`] creates a new gstate (graphics state) object and pushes it on the operand stack. Its initial value is a copy of the current graphics state, including all graphics parameters such as: +link:/commands/references/gstate/[`gstate`] creates a new gstate (graphics state) object and pushes it on the operand stack. Its initial value is a copy of the current graphics state, including all graphics parameters such as: * Current transformation matrix (CTM) * Color space and color @@ -49,7 +49,7 @@ link:/docs/commands/references/gstate/[`gstate`] creates a new gstate (graphics This operator consumes VM; it is the only graphics state operator that does. The gstate is allocated in either local or global VM according to the current VM allocation mode. -The gstate object can later be used with link:/docs/commands/references/setgstate/[`setgstate`] to restore the graphics state to the captured values, or with link:/docs/commands/references/currentgstate/[`currentgstate`] to update the saved state. +The gstate object can later be used with link:/commands/references/setgstate/[`setgstate`] to restore the graphics state to the captured values, or with link:/commands/references/currentgstate/[`currentgstate`] to update the saved state. === PostScript Level @@ -164,7 +164,7 @@ StateLibrary /NormalState get setgstate === Common Pitfalls -WARNING: *VM Consumption* - link:/docs/commands/references/gstate/[`gstate`] allocates memory; excessive use can exhaust VM. +WARNING: *VM Consumption* - link:/commands/references/gstate/[`gstate`] allocates memory; excessive use can exhaust VM. [source,postscript] ---- @@ -183,7 +183,7 @@ true setglobal gstate % Error: invalidaccess ---- -WARNING: *Not a Substitute for gsave* - Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] for simple state save/restore. +WARNING: *Not a Substitute for gsave* - Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] for simple state save/restore. [source,postscript] ---- @@ -198,7 +198,7 @@ drawShape grestore ---- -TIP: *Use for Templates* - link:/docs/commands/references/gstate/[`gstate`] is ideal for creating reusable state configurations. +TIP: *Use for Templates* - link:/commands/references/gstate/[`gstate`] is ideal for creating reusable state configurations. === Error Conditions @@ -221,8 +221,8 @@ TIP: *Use for Templates* - link:/docs/commands/references/gstate/[`gstate`] is i * Only graphics state operator that consumes VM * Allocated in local or global VM based on current allocation mode * Contains complete copy of graphics state -* Can be used repeatedly with link:/docs/commands/references/setgstate/[`setgstate`] -* More expensive than link:/docs/commands/references/gsave/[`gsave`] but more flexible +* Can be used repeatedly with link:/commands/references/setgstate/[`setgstate`] +* More expensive than link:/commands/references/gsave/[`gsave`] but more flexible * Best used for state templates, not simple save/restore === Graphics State Components @@ -242,8 +242,8 @@ The gstate object captures all of the following: === See Also -* link:/docs/commands/references/setgstate/[`setgstate`] - Replace graphics state from gstate -* link:/docs/commands/references/currentgstate/[`currentgstate`] - Update gstate with current state -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state on stack -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state from stack -* link:/docs/commands/references/grestoreall/[`grestoreall`] - Restore all saved states +* link:/commands/references/setgstate/[`setgstate`] - Replace graphics state from gstate +* link:/commands/references/currentgstate/[`currentgstate`] - Update gstate with current state +* link:/commands/references/gsave/[`gsave`] - Save graphics state on stack +* link:/commands/references/grestore/[`grestore`] - Restore graphics state from stack +* link:/commands/references/grestoreall/[`grestoreall`] - Restore all saved states diff --git a/docs/commands/references/identmatrix.adoc b/docs/commands/references/identmatrix.adoc index cb3acbf..34af44b 100644 --- a/docs/commands/references/identmatrix.adoc +++ b/docs/commands/references/identmatrix.adoc @@ -37,7 +37,7 @@ matrix identmatrix → matrix === Description -link:/docs/commands/references/identmatrix/[`identmatrix`] replaces the value of `matrix` with the identity matrix [1.0 0.0 0.0 1.0 0.0 0.0] and pushes the modified matrix back on the operand stack. +link:/commands/references/identmatrix/[`identmatrix`] replaces the value of `matrix` with the identity matrix [1.0 0.0 0.0 1.0 0.0 0.0] and pushes the modified matrix back on the operand stack. The identity matrix transforms any coordinate to itself without change. @@ -114,7 +114,7 @@ WARNING: *Array Size* - The array must have at least 6 elements. 8 array identmatrix % OK (only first 6 modified) ---- -WARNING: *Modifies Existing Array* - Unlike link:/docs/commands/references/matrix/[`matrix`], link:/docs/commands/references/identmatrix/[`identmatrix`] modifies an existing array. +WARNING: *Modifies Existing Array* - Unlike link:/commands/references/matrix/[`matrix`], link:/commands/references/identmatrix/[`identmatrix`] modifies an existing array. [source,postscript] ---- @@ -122,7 +122,7 @@ matrix % Creates new array 6 array identmatrix % Uses existing array ---- -TIP: *Use with Preallocated Arrays* - link:/docs/commands/references/identmatrix/[`identmatrix`] is useful when you want to reuse arrays: +TIP: *Use with Preallocated Arrays* - link:/commands/references/identmatrix/[`identmatrix`] is useful when you want to reuse arrays: [source,postscript] ---- @@ -183,7 +183,7 @@ Properties: === See Also -* link:/docs/commands/references/matrix/[`matrix`] - Create new identity matrix array -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/initmatrix/[`initmatrix`] - Reset CTM to identity \ No newline at end of file +* link:/commands/references/matrix/[`matrix`] - Create new identity matrix array +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/initmatrix/[`initmatrix`] - Reset CTM to identity \ No newline at end of file diff --git a/docs/commands/references/idiv.adoc b/docs/commands/references/idiv.adoc index 9e272d1..6eca08a 100644 --- a/docs/commands/references/idiv.adoc +++ b/docs/commands/references/idiv.adoc @@ -12,7 +12,7 @@ Divides two integers and returns the integer quotient, discarding any fractional The `idiv` operator pops two integers from the operand stack, divides int1 by int2, and pushes the integer part of the quotient back onto the stack. Any fractional part is discarded (truncated toward zero). Both operands *must be integers*, and the result is always an integer. -For division that preserves fractional parts, use link:/docs/commands/references/div/[`div`]. For the remainder of integer division, use link:/docs/commands/references/mod/[`mod`]. +For division that preserves fractional parts, use link:/commands/references/div/[`div`]. For the remainder of integer division, use link:/commands/references/mod/[`mod`]. This is a Level 1 operator, available in all PostScript implementations. @@ -239,13 +239,13 @@ Both operands *must* be integers. Real numbers will cause a `typecheck` error: == Related Commands -* link:/docs/commands/references/div/[`div`] - Division with real result -* link:/docs/commands/references/mod/[`mod`] - Modulo (remainder) -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers -* link:/docs/commands/references/truncate/[`truncate`] - Truncate real to integer -* link:/docs/commands/references/floor/[`floor`] - Round down to integer +* link:/commands/references/div/[`div`] - Division with real result +* link:/commands/references/mod/[`mod`] - Modulo (remainder) +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/truncate/[`truncate`] - Truncate real to integer +* link:/commands/references/floor/[`floor`] - Round down to integer == PostScript Level @@ -290,5 +290,5 @@ currentIndex arraySize idiv % Which page of array? == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/idtransform.adoc b/docs/commands/references/idtransform.adoc index 06ec90b..46f9ded 100644 --- a/docs/commands/references/idtransform.adoc +++ b/docs/commands/references/idtransform.adoc @@ -44,13 +44,13 @@ dx' dy' matrix idtransform → dx dy === Description -With no matrix operand, link:/docs/commands/references/idtransform/[`idtransform`] (inverse delta transform) transforms the device space distance vector (dx', dy') by the inverse of the CTM to produce the corresponding distance vector (dx, dy) in user space. +With no matrix operand, link:/commands/references/idtransform/[`idtransform`] (inverse delta transform) transforms the device space distance vector (dx', dy') by the inverse of the CTM to produce the corresponding distance vector (dx, dy) in user space. -If the `matrix` operand is supplied, link:/docs/commands/references/idtransform/[`idtransform`] transforms the distance vector by the inverse of `matrix` rather than by the inverse of CTM. +If the `matrix` operand is supplied, link:/commands/references/idtransform/[`idtransform`] transforms the distance vector by the inverse of `matrix` rather than by the inverse of CTM. A delta transformation is similar to a normal transformation, but the translation components (tx and ty) of the transformation matrix are not used, making the distance vectors position-independent in both user space and device space. -link:/docs/commands/references/idtransform/[`idtransform`] is the inverse of link:/docs/commands/references/dtransform/[`dtransform`]. It is useful for determining how distances map from device space to user space. +link:/commands/references/idtransform/[`idtransform`] is the inverse of link:/commands/references/dtransform/[`dtransform`]. It is useful for determining how distances map from device space to user space. === PostScript Level @@ -138,7 +138,7 @@ minDeviceWidth lt { === Common Pitfalls -WARNING: *For Distances Only* - link:/docs/commands/references/idtransform/[`idtransform`] is for distance vectors, not positions. +WARNING: *For Distances Only* - link:/commands/references/idtransform/[`idtransform`] is for distance vectors, not positions. [source,postscript] ---- @@ -153,7 +153,7 @@ WARNING: *For Distances Only* - link:/docs/commands/references/idtransform/[`idt 200 400 idtransform % → 100 200 (correct distance) ---- -WARNING: *Singular Matrices* - If CTM or matrix is singular, link:/docs/commands/references/idtransform/[`idtransform`] fails. +WARNING: *Singular Matrices* - If CTM or matrix is singular, link:/commands/references/idtransform/[`idtransform`] fails. [source,postscript] ---- @@ -221,7 +221,7 @@ TIP: *Round-Trip Testing* - Verify inverse relationship: === Implementation Notes -* More expensive than link:/docs/commands/references/dtransform/[`dtransform`] (requires inverse computation) +* More expensive than link:/commands/references/dtransform/[`dtransform`] (requires inverse computation) * Translation components are explicitly ignored * The inverse uses only [a b c d] components * Precision depends on matrix condition number @@ -257,19 +257,19 @@ dy = (2×60 - 0×20) / 6 = 120/6 = 20 |=== | Operation | Direction | Translation -| link:/docs/commands/references/dtransform/[`dtransform`] +| link:/commands/references/dtransform/[`dtransform`] | User → Device | Ignored -| link:/docs/commands/references/idtransform/[`idtransform`] +| link:/commands/references/idtransform/[`idtransform`] | Device → User | Ignored -| link:/docs/commands/references/transform/[`transform`] +| link:/commands/references/transform/[`transform`] | User → Device | Included -| link:/docs/commands/references/itransform/[`itransform`] +| link:/commands/references/itransform/[`itransform`] | Device → User | Included |=== @@ -312,7 +312,7 @@ Many graphics parameters are affected by transformations: === Performance Considerations * Requires matrix inversion computation -* More expensive than link:/docs/commands/references/dtransform/[`dtransform`] +* More expensive than link:/commands/references/dtransform/[`dtransform`] * Still very fast for occasional use * Consider caching inverse matrix for repeated use: @@ -335,9 +335,9 @@ matrix currentmatrix matrix invertmatrix === See Also -* link:/docs/commands/references/dtransform/[`dtransform`] - Transform distance vector (forward) -* link:/docs/commands/references/transform/[`transform`] - Transform coordinates (includes translation) -* link:/docs/commands/references/itransform/[`itransform`] - Inverse coordinate transformation -* link:/docs/commands/references/invertmatrix/[`invertmatrix`] - Invert transformation matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width \ No newline at end of file +* link:/commands/references/dtransform/[`dtransform`] - Transform distance vector (forward) +* link:/commands/references/transform/[`transform`] - Transform coordinates (includes translation) +* link:/commands/references/itransform/[`itransform`] - Inverse coordinate transformation +* link:/commands/references/invertmatrix/[`invertmatrix`] - Invert transformation matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width \ No newline at end of file diff --git a/docs/commands/references/if.adoc b/docs/commands/references/if.adoc index d1b2a61..c164279 100644 --- a/docs/commands/references/if.adoc +++ b/docs/commands/references/if.adoc @@ -123,7 +123,7 @@ true [code] if % Error: literal array true { code } if % Correct: executable array ---- -TIP: *Use ifelse for Two-Way* - For true/false cases, link:/docs/commands/references/ifelse/[`ifelse`] is more convenient than nested `if` statements. +TIP: *Use ifelse for Two-Way* - For true/false cases, link:/commands/references/ifelse/[`ifelse`] is more convenient than nested `if` statements. === Error Conditions @@ -146,8 +146,8 @@ TIP: *Use ifelse for Two-Way* - For true/false cases, link:/docs/commands/refere === See Also -* link:/docs/commands/references/ifelse/[`ifelse`] - Two-way conditional -* link:/docs/commands/references/loop/[`loop`] - Indefinite repetition -* link:/docs/commands/references/stopped/[`stopped`] - Error catching +* link:/commands/references/ifelse/[`ifelse`] - Two-way conditional +* link:/commands/references/loop/[`loop`] - Indefinite repetition +* link:/commands/references/stopped/[`stopped`] - Error catching * Comparison operators: `eq`, `ne`, `lt`, `le`, `gt`, `ge` * Boolean operators: `and`, `or`, `not` \ No newline at end of file diff --git a/docs/commands/references/ifelse.adoc b/docs/commands/references/ifelse.adoc index ee0d0f0..667bf1f 100644 --- a/docs/commands/references/ifelse.adoc +++ b/docs/commands/references/ifelse.adoc @@ -43,9 +43,9 @@ bool proc1 proc2 ifelse → – === Description -link:/docs/commands/references/ifelse/[`ifelse`] removes all three operands from the stack, then executes _proc1_ if _bool_ is `true`, or _proc2_ if _bool_ is `false`. +link:/commands/references/ifelse/[`ifelse`] removes all three operands from the stack, then executes _proc1_ if _bool_ is `true`, or _proc2_ if _bool_ is `false`. -The link:/docs/commands/references/ifelse/[`ifelse`] operator itself pushes no results, but the executed procedure may push results. +The link:/commands/references/ifelse/[`ifelse`] operator itself pushes no results, but the executed procedure may push results. === PostScript Level @@ -148,7 +148,7 @@ x 0 gt { x x mul } { } ifelse % Unbalanced x 0 gt { x x mul } { 0 } ifelse ---- -TIP: *Use for Single Branch* - If you only need one branch, link:/docs/commands/references/if/[`if`] is simpler. +TIP: *Use for Single Branch* - If you only need one branch, link:/commands/references/if/[`if`] is simpler. === Error Conditions @@ -172,7 +172,7 @@ TIP: *Use for Single Branch* - If you only need one branch, link:/docs/commands/ === Pattern: Multi-Way Branch -For multiple conditions, nest link:/docs/commands/references/ifelse/[`ifelse`] or use dictionary dispatch: +For multiple conditions, nest link:/commands/references/ifelse/[`ifelse`] or use dictionary dispatch: [source,postscript] ---- @@ -202,8 +202,8 @@ end === See Also -* link:/docs/commands/references/if/[`if`] - Single-branch conditional -* link:/docs/commands/references/loop/[`loop`] - Indefinite repetition -* link:/docs/commands/references/repeat/[`repeat`] - Fixed repetition +* link:/commands/references/if/[`if`] - Single-branch conditional +* link:/commands/references/loop/[`loop`] - Indefinite repetition +* link:/commands/references/repeat/[`repeat`] - Fixed repetition * Comparison operators: `eq`, `ne`, `lt`, `le`, `gt`, `ge` * Boolean operators: `and`, `or`, `not` \ No newline at end of file diff --git a/docs/commands/references/index.adoc b/docs/commands/references/index.adoc index f77c7da..db942cd 100644 --- a/docs/commands/references/index.adoc +++ b/docs/commands/references/index.adoc @@ -25,25 +25,25 @@ Each command page includes: == Navigation -Use the sidebar navigation to browse commands alphabetically, or visit the link:/docs/commands/by-category/[Commands by Category] page to find operators organized by functional area. +Use the sidebar navigation to browse commands alphabetically, or visit the link:/commands/by-category/[Commands by Category] page to find operators organized by functional area. == Command Categories For commands organized by functional area, see: -* link:/docs/commands/arithmetic-math/[Arithmetic and Math] -* link:/docs/commands/array-string/[Array and String Operations] -* link:/docs/commands/control-flow/[Control Flow] -* link:/docs/commands/dictionary/[Dictionary Operations] -* link:/docs/commands/font-text/[Font and Text] -* link:/docs/commands/graphics-state/[Graphics State] -* link:/docs/commands/painting/[Painting] -* link:/docs/commands/path-construction/[Path Construction] -* link:/docs/commands/stack-manipulation/[Stack Manipulation] -* link:/docs/commands/transformations/[Coordinate Transformations] -* link:/docs/commands/color/[Color] -* link:/docs/commands/image/[Image] -* link:/docs/commands/device-output/[Device and Output] -* link:/docs/commands/file-io/[File and I/O] -* link:/docs/commands/error-handling/[Error Handling] -* link:/docs/commands/resource-management/[Resource Management] +* link:/commands/arithmetic-math/[Arithmetic and Math] +* link:/commands/array-string/[Array and String Operations] +* link:/commands/control-flow/[Control Flow] +* link:/commands/dictionary/[Dictionary Operations] +* link:/commands/font-text/[Font and Text] +* link:/commands/graphics-state/[Graphics State] +* link:/commands/painting/[Painting] +* link:/commands/path-construction/[Path Construction] +* link:/commands/stack-manipulation/[Stack Manipulation] +* link:/commands/transformations/[Coordinate Transformations] +* link:/commands/color/[Color] +* link:/commands/image/[Image] +* link:/commands/device-output/[Device and Output] +* link:/commands/file-io/[File and I/O] +* link:/commands/error-handling/[Error Handling] +* link:/commands/resource-management/[Resource Management] diff --git a/docs/commands/references/initmatrix.adoc b/docs/commands/references/initmatrix.adoc index b1cf931..e9f0012 100644 --- a/docs/commands/references/initmatrix.adoc +++ b/docs/commands/references/initmatrix.adoc @@ -37,7 +37,7 @@ Resets the current transformation matrix to the device default. === Description -link:/docs/commands/references/initmatrix/[`initmatrix`] sets the current transformation matrix (CTM) to the default matrix for the current output device. This matrix transforms the default user coordinate system to device space. +link:/commands/references/initmatrix/[`initmatrix`] sets the current transformation matrix (CTM) to the default matrix for the current output device. This matrix transforms the default user coordinate system to device space. For page-oriented devices, the default matrix is initially established by the `setpagedevice` operator. @@ -48,7 +48,7 @@ This is equivalent to: matrix defaultmatrix setmatrix ---- -WARNING: There are few situations in which a PostScript program should execute link:/docs/commands/references/initmatrix/[`initmatrix`] explicitly. A page description that executes link:/docs/commands/references/initmatrix/[`initmatrix`] usually produces incorrect results if embedded within another, composite page. +WARNING: There are few situations in which a PostScript program should execute link:/commands/references/initmatrix/[`initmatrix`] explicitly. A page description that executes link:/commands/references/initmatrix/[`initmatrix`] usually produces incorrect results if embedded within another, composite page. === PostScript Level @@ -109,7 +109,7 @@ initgraphics % Reset other graphics parameters too === Common Pitfalls -WARNING: *Breaks Nested Transformations* - link:/docs/commands/references/initmatrix/[`initmatrix`] ignores all previous transformations. +WARNING: *Breaks Nested Transformations* - link:/commands/references/initmatrix/[`initmatrix`] ignores all previous transformations. [source,postscript] ---- @@ -124,7 +124,7 @@ initmatrix % Destroys the translate and scale! drawBox % Box appears at device origin, normal size ---- -WARNING: *Not for Typical Programs* - Normal PostScript programs should not use link:/docs/commands/references/initmatrix/[`initmatrix`]. +WARNING: *Not for Typical Programs* - Normal PostScript programs should not use link:/commands/references/initmatrix/[`initmatrix`]. [source,postscript] ---- @@ -137,7 +137,7 @@ gsave grestore ---- -TIP: *Use gsave/grestore* - For temporary transformations, use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`]: +TIP: *Use gsave/grestore* - For temporary transformations, use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`]: [source,postscript] ---- @@ -149,7 +149,7 @@ grestore % Original transformation restored ---- -TIP: *Part of initgraphics* - link:/docs/commands/references/initmatrix/[`initmatrix`] is one component of `initgraphics`: +TIP: *Part of initgraphics* - link:/commands/references/initmatrix/[`initmatrix`] is one component of `initgraphics`: [source,postscript] ---- @@ -172,7 +172,7 @@ initclip | Error | Condition | (none) -| link:/docs/commands/references/initmatrix/[`initmatrix`] cannot fail +| link:/commands/references/initmatrix/[`initmatrix`] cannot fail |=== === Implementation Notes @@ -180,7 +180,7 @@ initclip * The default matrix is device-dependent * For page devices, it's established during page setup * The transformation is instantaneous -* No previous CTM state is preserved (unlike link:/docs/commands/references/grestore/[`grestore`]) +* No previous CTM state is preserved (unlike link:/commands/references/grestore/[`grestore`]) === Default Matrix Characteristics @@ -213,7 +213,7 @@ initmatrix matrix defaultmatrix setmatrix ---- -link:/docs/commands/references/initmatrix/[`initmatrix`] is part of: +link:/commands/references/initmatrix/[`initmatrix`] is part of: [source,postscript] ---- @@ -230,8 +230,8 @@ Valid use cases (rare): Invalid use cases (common mistakes): -1. **Normal Drawing**: Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] instead -2. **Resetting After Transform**: Use link:/docs/commands/references/grestore/[`grestore`] instead +1. **Normal Drawing**: Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] instead +2. **Resetting After Transform**: Use link:/commands/references/grestore/[`grestore`] instead 3. **Embedded Pages**: Will break composition === Example of Proper Use @@ -252,8 +252,8 @@ Invalid use cases (common mistakes): === See Also -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Set CTM explicitly -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/setmatrix/[`setmatrix`] - Set CTM explicitly +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/invertmatrix.adoc b/docs/commands/references/invertmatrix.adoc index 733c568..b8b44df 100644 --- a/docs/commands/references/invertmatrix.adoc +++ b/docs/commands/references/invertmatrix.adoc @@ -40,13 +40,13 @@ matrix1 matrix2 invertmatrix → matrix2 === Description -link:/docs/commands/references/invertmatrix/[`invertmatrix`] replaces the value of `matrix2` with the inverse of `matrix1` and pushes the modified `matrix2` back on the operand stack. +link:/commands/references/invertmatrix/[`invertmatrix`] replaces the value of `matrix2` with the inverse of `matrix1` and pushes the modified `matrix2` back on the operand stack. The inverse matrix has the property that if `matrix1` transforms a coordinate (x, y) to (x', y'), then `matrix2` transforms (x', y') back to (x, y). Mathematically: M₁ × M₂ = M₂ × M₁ = I (identity matrix) -If `matrix1` is singular (determinant = 0), link:/docs/commands/references/invertmatrix/[`invertmatrix`] executes an [`undefinedresult`] error because the inverse does not exist. +If `matrix1` is singular (determinant = 0), link:/commands/references/invertmatrix/[`invertmatrix`] executes an [`undefinedresult`] error because the inverse does not exist. === PostScript Level @@ -182,7 +182,7 @@ myMatrix checkMatrix { } if ---- -TIP: *Use for Coordinate Conversion* - Primary use is with link:/docs/commands/references/itransform/[`itransform`] and link:/docs/commands/references/idtransform/[`idtransform`]: +TIP: *Use for Coordinate Conversion* - Primary use is with link:/commands/references/itransform/[`itransform`] and link:/commands/references/idtransform/[`idtransform`]: [source,postscript] ---- @@ -308,7 +308,7 @@ myMatrix determinant 0 eq { === Relationship to Transform Operators -link:/docs/commands/references/invertmatrix/[`invertmatrix`] is used with inverse transformation operators: +link:/commands/references/invertmatrix/[`invertmatrix`] is used with inverse transformation operators: [source,postscript] ---- @@ -324,8 +324,8 @@ fwd inv invertmatrix === See Also -* link:/docs/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices -* link:/docs/commands/references/itransform/[`itransform`] - Inverse coordinate transformation -* link:/docs/commands/references/idtransform/[`idtransform`] - Inverse distance transformation -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/matrix/[`matrix`] - Create identity matrix \ No newline at end of file +* link:/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices +* link:/commands/references/itransform/[`itransform`] - Inverse coordinate transformation +* link:/commands/references/idtransform/[`idtransform`] - Inverse distance transformation +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/matrix/[`matrix`] - Create identity matrix \ No newline at end of file diff --git a/docs/commands/references/itransform.adoc b/docs/commands/references/itransform.adoc index c6387bc..db6a52f 100644 --- a/docs/commands/references/itransform.adoc +++ b/docs/commands/references/itransform.adoc @@ -44,11 +44,11 @@ x' y' matrix itransform → x y === Description -With no matrix operand, link:/docs/commands/references/itransform/[`itransform`] (inverse transform) transforms the device space coordinate (x', y') by the inverse of the current transformation matrix (CTM) to produce the corresponding user space coordinate (x, y). +With no matrix operand, link:/commands/references/itransform/[`itransform`] (inverse transform) transforms the device space coordinate (x', y') by the inverse of the current transformation matrix (CTM) to produce the corresponding user space coordinate (x, y). -If the `matrix` operand is supplied, link:/docs/commands/references/itransform/[`itransform`] transforms (x', y') by the inverse of `matrix` rather than by the inverse of CTM. +If the `matrix` operand is supplied, link:/commands/references/itransform/[`itransform`] transforms (x', y') by the inverse of `matrix` rather than by the inverse of CTM. -This is the inverse operation of link:/docs/commands/references/transform/[`transform`]. It converts device coordinates (pixel positions) back to user coordinates (the coordinate system used for drawing). +This is the inverse operation of link:/commands/references/transform/[`transform`]. It converts device coordinates (pixel positions) back to user coordinates (the coordinate system used for drawing). === PostScript Level @@ -157,7 +157,7 @@ grestore === Common Pitfalls -WARNING: *Includes Translation* - link:/docs/commands/references/itransform/[`itransform`] uses the full inverse transformation including translation. Use link:/docs/commands/references/idtransform/[`idtransform`] for distance vectors. +WARNING: *Includes Translation* - link:/commands/references/itransform/[`itransform`] uses the full inverse transformation including translation. Use link:/commands/references/idtransform/[`idtransform`] for distance vectors. [source,postscript] ---- @@ -171,7 +171,7 @@ WARNING: *Includes Translation* - link:/docs/commands/references/itransform/[`it 100 100 idtransform % → 100 100 (correct - distance) ---- -WARNING: *Singular Matrices* - If CTM or matrix is singular (determinant = 0), link:/docs/commands/references/itransform/[`itransform`] fails. +WARNING: *Singular Matrices* - If CTM or matrix is singular (determinant = 0), link:/commands/references/itransform/[`itransform`] fails. [source,postscript] ---- @@ -250,7 +250,7 @@ TIP: *Verify Round-Trip* - Test that transform/itransform are inverses: === Implementation Notes * Requires computing the matrix inverse -* More expensive than link:/docs/commands/references/transform/[`transform`] (forward transformation) +* More expensive than link:/commands/references/transform/[`transform`] (forward transformation) * The inverse CTM is not cached; computed each time * Precision depends on CTM condition number * Used automatically by many interactive operators @@ -316,7 +316,7 @@ x y transform % Transform by inverse === Performance Considerations -* Slightly slower than link:/docs/commands/references/transform/[`transform`] (requires matrix inversion) +* Slightly slower than link:/commands/references/transform/[`transform`] (requires matrix inversion) * Still very fast for occasional use * If called frequently with same matrix, consider precomputing inverse: @@ -339,8 +339,8 @@ matrix currentmatrix matrix invertmatrix === See Also -* link:/docs/commands/references/transform/[`transform`] - Transform user to device coordinates -* link:/docs/commands/references/dtransform/[`dtransform`] - Transform distance vector -* link:/docs/commands/references/idtransform/[`idtransform`] - Inverse transform distance vector -* link:/docs/commands/references/invertmatrix/[`invertmatrix`] - Invert transformation matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM \ No newline at end of file +* link:/commands/references/transform/[`transform`] - Transform user to device coordinates +* link:/commands/references/dtransform/[`dtransform`] - Transform distance vector +* link:/commands/references/idtransform/[`idtransform`] - Inverse transform distance vector +* link:/commands/references/invertmatrix/[`invertmatrix`] - Invert transformation matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM \ No newline at end of file diff --git a/docs/commands/references/known.adoc b/docs/commands/references/known.adoc index 87950da..f040ce6 100644 --- a/docs/commands/references/known.adoc +++ b/docs/commands/references/known.adoc @@ -40,7 +40,7 @@ dict key known → bool === Description -link:/docs/commands/references/known/[`known`] returns `true` if there is an entry in dictionary _dict_ whose key is _key_. Otherwise, it returns `false`. +link:/commands/references/known/[`known`] returns `true` if there is an entry in dictionary _dict_ whose key is _key_. Otherwise, it returns `false`. The dictionary does not need to be on the dictionary stack - it can be any dictionary object. @@ -123,7 +123,7 @@ systemdict /setpagedevice known { === Common Pitfalls -WARNING: *Checks Specific Dictionary Only* - link:/docs/commands/references/known/[`known`] does NOT search the dictionary stack, only the specified dictionary. +WARNING: *Checks Specific Dictionary Only* - link:/commands/references/known/[`known`] does NOT search the dictionary stack, only the specified dictionary. [source,postscript] ---- @@ -133,9 +133,9 @@ WARNING: *Checks Specific Dictionary Only* - link:/docs/commands/references/know currentdict /x known % Returns true ---- -WARNING: *Different from where* - link:/docs/commands/references/known/[`known`] checks one dictionary; link:/docs/commands/references/where/[`where`] searches the entire dictionary stack. +WARNING: *Different from where* - link:/commands/references/known/[`known`] checks one dictionary; link:/commands/references/where/[`where`] searches the entire dictionary stack. -TIP: *Use for Validation* - Check before link:../array-string/get/[`get`] to avoid [`undefined`] errors. +TIP: *Use for Validation* - Check before link:/commands/references/get/[`get`] to avoid [`undefined`] errors. === Error Conditions @@ -162,7 +162,7 @@ TIP: *Use for Validation* - Check before link:../array-string/get/[`get`] to avo === See Also -* link:/docs/commands/references/where/[`where`] - Search dictionary stack for key -* link:/docs/commands/references/load/[`load`] - Get value from dictionary stack -* link:/docs/commands/references/get/[`get`] - Get value from specific dictionary -* link:/docs/commands/references/def/[`def`] - Define key-value pair \ No newline at end of file +* link:/commands/references/where/[`where`] - Search dictionary stack for key +* link:/commands/references/load/[`load`] - Get value from dictionary stack +* link:/commands/references/get/[`get`] - Get value from specific dictionary +* link:/commands/references/def/[`def`] - Define key-value pair \ No newline at end of file diff --git a/docs/commands/references/kshow.adoc b/docs/commands/references/kshow.adoc index d055fe4..fb4ac7f 100644 --- a/docs/commands/references/kshow.adoc +++ b/docs/commands/references/kshow.adoc @@ -29,9 +29,9 @@ proc string === Description -link:/docs/commands/references/kshow/[`kshow`] paints the characters of `string` in a manner similar to link:/docs/commands/references/show/[`show`], but allowing program intervention between characters. +link:/commands/references/kshow/[`kshow`] paints the characters of `string` in a manner similar to link:/commands/references/show/[`show`], but allowing program intervention between characters. -If the character codes in `string` are c₀, c₁, ... cₙ, link:/docs/commands/references/kshow/[`kshow`] proceeds as follows: +If the character codes in `string` are c₀, c₁, ... cₙ, link:/commands/references/kshow/[`kshow`] proceeds as follows: 1. Shows c₀ at the current point, updating the current point by c₀'s width 2. Pushes character codes c₀ and c₁ on the operand stack (as integers) @@ -39,11 +39,11 @@ If the character codes in `string` are c₀, c₁, ... cₙ, link:/docs/commands 4. Continues by showing c₁, pushing c₁ and c₂, executing `proc`, and so on 5. Finishes by pushing cₙ₋₁ and cₙ, executing `proc`, and showing cₙ -When `proc` is called for the first time, the graphics state (in particular, the CTM) is the same as it was at the time link:/docs/commands/references/kshow/[`kshow`] was invoked, except that the current point has been updated by the width of c₀. Execution of `proc` is permitted to have any side effects, including changes to the graphics state. Such changes persist from one call of `proc` to the next and may affect graphical output for the remainder of link:/docs/commands/references/kshow/[`kshow`]'s execution and afterward. +When `proc` is called for the first time, the graphics state (in particular, the CTM) is the same as it was at the time link:/commands/references/kshow/[`kshow`] was invoked, except that the current point has been updated by the width of c₀. Execution of `proc` is permitted to have any side effects, including changes to the graphics state. Such changes persist from one call of `proc` to the next and may affect graphical output for the remainder of link:/commands/references/kshow/[`kshow`]'s execution and afterward. -The name link:/docs/commands/references/kshow/[`kshow`] is derived from "kern-show." To kern characters is to adjust the spacing between adjacent pairs of characters in order to achieve a visually pleasing result. The link:/docs/commands/references/kshow/[`kshow`] operator enables user-defined kerning and other manipulations, because arbitrary computations can be performed between each pair of characters. +The name link:/commands/references/kshow/[`kshow`] is derived from "kern-show." To kern characters is to adjust the spacing between adjacent pairs of characters in order to achieve a visually pleasing result. The link:/commands/references/kshow/[`kshow`] operator enables user-defined kerning and other manipulations, because arbitrary computations can be performed between each pair of characters. -link:/docs/commands/references/kshow/[`kshow`] can be applied only to base fonts. If the current font is composite, link:/docs/commands/references/kshow/[`kshow`] issues an `invalidfont` error. +link:/commands/references/kshow/[`kshow`] can be applied only to base fonts. If the current font is composite, link:/commands/references/kshow/[`kshow`] issues an `invalidfont` error. === Parameters @@ -285,7 +285,7 @@ kshow - Slowest (procedure calls) === Limitations **Composite fonts:** -: link:/docs/commands/references/kshow/[`kshow`] cannot be used with composite fonts; use link:/docs/commands/references/cshow/[`cshow`] instead +: link:/commands/references/kshow/[`kshow`] cannot be used with composite fonts; use link:/commands/references/cshow/[`cshow`] instead **Character boundaries:** : Procedure is called between characters, not within character rendering @@ -295,9 +295,9 @@ kshow - Slowest (procedure calls) === See Also -- link:/docs/commands/references/show/[`show`] - Basic text painting -- link:/docs/commands/references/ashow/[`ashow`] - Uniform character spacing -- link:/docs/commands/references/widthshow/[`widthshow`] - Selective character width adjustment -- link:/docs/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character (Level 2) -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file +- link:/commands/references/show/[`show`] - Basic text painting +- link:/commands/references/ashow/[`ashow`] - Uniform character spacing +- link:/commands/references/widthshow/[`widthshow`] - Selective character width adjustment +- link:/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character (Level 2) +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file diff --git a/docs/commands/references/length.adoc b/docs/commands/references/length.adoc index d0807a2..56fbc19 100644 --- a/docs/commands/references/length.adoc +++ b/docs/commands/references/length.adoc @@ -41,14 +41,14 @@ name length → int === Description -link:/docs/commands/references/length/[`length`] returns the length of its operand: +link:/commands/references/length/[`length`] returns the length of its operand: * For arrays and packed arrays: number of elements * For strings: number of characters (bytes) * For dictionaries: current number of key-value pairs (not maximum capacity) * For names: number of characters in the name -For dictionaries, use link:/docs/commands/references/maxlength/[`maxlength`] to get the maximum capacity. +For dictionaries, use link:/commands/references/maxlength/[`maxlength`] to get the maximum capacity. === PostScript Level @@ -118,7 +118,7 @@ text length string % Allocate string of same length === Common Pitfalls -WARNING: *Dictionary Length vs. Capacity* - link:/docs/commands/references/length/[`length`] returns the current number of entries, not the maximum capacity. +WARNING: *Dictionary Length vs. Capacity* - link:/commands/references/length/[`length`] returns the current number of entries, not the maximum capacity. [source,postscript] ---- @@ -134,7 +134,7 @@ WARNING: *Name vs. String* - Name length counts characters in the name, not the (abc) length % Also returns 3 ---- -TIP: *Use with forall* - For iterating over all elements, link:/docs/commands/references/forall/[`forall`] is often more convenient than using link:/docs/commands/references/length/[`length`] with a loop. +TIP: *Use with forall* - For iterating over all elements, link:/commands/references/forall/[`forall`] is often more convenient than using link:/commands/references/length/[`length`] with a loop. === Error Conditions @@ -166,20 +166,20 @@ TIP: *Use with forall* - For iterating over all elements, link:/docs/commands/re |=== | Operator | Returns -| link:/docs/commands/references/length/[`length`] +| link:/commands/references/length/[`length`] | Current number of elements/entries -| link:/docs/commands/references/maxlength/[`maxlength`] +| link:/commands/references/maxlength/[`maxlength`] | Maximum capacity (dictionaries only) -| link:/docs/commands/references/count/[`count`] +| link:/commands/references/count/[`count`] | Number of objects on operand stack |=== === See Also -* link:/docs/commands/references/get/[`get`] - Get element at index -* link:/docs/commands/references/getinterval/[`getinterval`] - Get subarray/substring -* link:/docs/commands/references/forall/[`forall`] - Iterate over all elements -* link:/docs/commands/references/array/[`array`] - Create array with specific length -* link:/docs/commands/references/string/[`string`] - Create string with specific length \ No newline at end of file +* link:/commands/references/get/[`get`] - Get element at index +* link:/commands/references/getinterval/[`getinterval`] - Get subarray/substring +* link:/commands/references/forall/[`forall`] - Iterate over all elements +* link:/commands/references/array/[`array`] - Create array with specific length +* link:/commands/references/string/[`string`] - Create string with specific length \ No newline at end of file diff --git a/docs/commands/references/lineto.adoc b/docs/commands/references/lineto.adoc index eb50cb3..4561359 100644 --- a/docs/commands/references/lineto.adoc +++ b/docs/commands/references/lineto.adoc @@ -40,9 +40,9 @@ x y lineto → - === Description -link:/docs/commands/references/lineto/[`lineto`] appends a straight line segment to the current path. The line extends from the current point to the point (x, y) in user space; (x, y) then becomes the new current point. +link:/commands/references/lineto/[`lineto`] appends a straight line segment to the current path. The line extends from the current point to the point (x, y) in user space; (x, y) then becomes the new current point. -If the current point is undefined because the current path is empty, link:/docs/commands/references/lineto/[`lineto`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/lineto/[`lineto`] executes the [`nocurrentpoint`] error. The coordinates are interpreted as user space coordinates and are transformed by the current transformation matrix (CTM) when the path is constructed. @@ -148,7 +148,7 @@ stroke === Common Pitfalls -WARNING: *No Current Point* - link:/docs/commands/references/lineto/[`lineto`] requires an established current point. Always use link:/docs/commands/references/moveto/[`moveto`] first. +WARNING: *No Current Point* - link:/commands/references/lineto/[`lineto`] requires an established current point. Always use link:/commands/references/moveto/[`moveto`] first. [source,postscript] ---- @@ -156,7 +156,7 @@ newpath 200 200 lineto % Error: nocurrentpoint ---- -WARNING: *Coordinates Not Cumulative* - Unlike link:/docs/commands/references/rlineto/[`rlineto`], coordinates are absolute positions, not offsets. +WARNING: *Coordinates Not Cumulative* - Unlike link:/commands/references/rlineto/[`rlineto`], coordinates are absolute positions, not offsets. [source,postscript] ---- @@ -164,7 +164,7 @@ WARNING: *Coordinates Not Cumulative* - Unlike link:/docs/commands/references/rl 50 50 lineto % Goes to (50, 50), not (150, 150) ---- -TIP: *Use for Straight Segments* - For curved paths, use link:/docs/commands/references/curveto/[`curveto`] or link:/docs/commands/references/arc/[`arc`] instead of approximating with many short line segments. +TIP: *Use for Straight Segments* - For curved paths, use link:/commands/references/curveto/[`curveto`] or link:/commands/references/arc/[`arc`] instead of approximating with many short line segments. === Error Conditions @@ -190,7 +190,7 @@ TIP: *Use for Straight Segments* - For curved paths, use link:/docs/commands/ref * Creates a straight line segment in device space after CTM transformation * The endpoint becomes the new current point * Lines are not rendered until a painting operator is executed -* Multiple consecutive link:/docs/commands/references/lineto/[`lineto`] operations create a polyline +* Multiple consecutive link:/commands/references/lineto/[`lineto`] operations create a polyline * Line appearance depends on current line width, dash pattern, and line cap settings === Performance Considerations @@ -202,9 +202,9 @@ TIP: *Use for Straight Segments* - For curved paths, use link:/docs/commands/ref === See Also -* link:/docs/commands/references/rlineto/[`rlineto`] - Relative lineto -* link:/docs/commands/references/moveto/[`moveto`] - Move to point without drawing -* link:/docs/commands/references/curveto/[`curveto`] - Draw curved segment -* link:/docs/commands/references/arc/[`arc`] - Draw circular arc -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/rlineto/[`rlineto`] - Relative lineto +* link:/commands/references/moveto/[`moveto`] - Move to point without drawing +* link:/commands/references/curveto/[`curveto`] - Draw curved segment +* link:/commands/references/arc/[`arc`] - Draw circular arc +* link:/commands/references/closepath/[`closepath`] - Close current subpath +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/ln.adoc b/docs/commands/references/ln.adoc index 39bc56f..075b5f4 100644 --- a/docs/commands/references/ln.adoc +++ b/docs/commands/references/ln.adoc @@ -68,8 +68,8 @@ num ln real == Related Commands -* link:/docs/commands/references/log/[`log`] - Base-10 logarithm -* link:/docs/commands/references/exp/[`exp`] - Exponentiation (inverse operation) +* link:/commands/references/log/[`log`] - Base-10 logarithm +* link:/commands/references/exp/[`exp`] - Exponentiation (inverse operation) == PostScript Level @@ -94,4 +94,4 @@ The operand is zero or negative. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/load.adoc b/docs/commands/references/load.adoc index 46d1e72..a7fb1b1 100644 --- a/docs/commands/references/load.adoc +++ b/docs/commands/references/load.adoc @@ -37,12 +37,12 @@ key load → value === Description -link:/docs/commands/references/load/[`load`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. +link:/commands/references/load/[`load`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. * If found: pushes the associated value * If not found: executes [`undefined`] error -link:/docs/commands/references/load/[`load`] looks up keys the same way the interpreter looks up executable names, but always pushes the value (never executes it). +link:/commands/references/load/[`load`] looks up keys the same way the interpreter looks up executable names, but always pushes the value (never executes it). === PostScript Level @@ -102,7 +102,7 @@ add % Executes add operator === Common Pitfalls -WARNING: *Always Pushes Value* - link:/docs/commands/references/load/[`load`] never executes values, even executable ones. +WARNING: *Always Pushes Value* - link:/commands/references/load/[`load`] never executes values, even executable ones. [source,postscript] ---- @@ -159,7 +159,7 @@ TIP: *Use where First* - Check if key exists before loading: [cols="2,3,3"] |=== -| Operation | link:/docs/commands/references/load/[`load`] | link:/docs/commands/references/get/[`get`] +| Operation | link:/commands/references/load/[`load`] | link:/commands/references/get/[`get`] | Search scope | Entire dictionary stack @@ -176,8 +176,8 @@ TIP: *Use where First* - Check if key exists before loading: === See Also -* link:/docs/commands/references/store/[`store`] - Store value in dictionary stack -* link:/docs/commands/references/def/[`def`] - Define in current dictionary -* link:/docs/commands/references/where/[`where`] - Find which dictionary contains key -* link:/docs/commands/references/get/[`get`] - Get from specific dictionary -* link:/docs/commands/references/known/[`known`] - Check if key exists \ No newline at end of file +* link:/commands/references/store/[`store`] - Store value in dictionary stack +* link:/commands/references/def/[`def`] - Define in current dictionary +* link:/commands/references/where/[`where`] - Find which dictionary contains key +* link:/commands/references/get/[`get`] - Get from specific dictionary +* link:/commands/references/known/[`known`] - Check if key exists \ No newline at end of file diff --git a/docs/commands/references/log.adoc b/docs/commands/references/log.adoc index 08c83ac..06e7d5e 100644 --- a/docs/commands/references/log.adoc +++ b/docs/commands/references/log.adoc @@ -88,8 +88,8 @@ num log real == Related Commands -* link:/docs/commands/references/ln/[`ln`] - Natural logarithm (base e) -* link:/docs/commands/references/exp/[`exp`] - Exponentiation +* link:/commands/references/ln/[`ln`] - Natural logarithm (base e) +* link:/commands/references/exp/[`exp`] - Exponentiation == PostScript Level @@ -114,4 +114,4 @@ The operand is zero or negative. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/loop.adoc b/docs/commands/references/loop.adoc index ef9d3b6..ea8ca37 100644 --- a/docs/commands/references/loop.adoc +++ b/docs/commands/references/loop.adoc @@ -37,9 +37,9 @@ proc loop → – === Description -link:/docs/commands/references/loop/[`loop`] repeatedly executes _proc_ until _proc_ executes link:/docs/commands/references/exit/[`exit`], at which point interpretation resumes after the loop. +link:/commands/references/loop/[`loop`] repeatedly executes _proc_ until _proc_ executes link:/commands/references/exit/[`exit`], at which point interpretation resumes after the loop. -Control also leaves _proc_ if link:/docs/commands/references/stop/[`stop`] is executed. If _proc_ never executes link:/docs/commands/references/exit/[`exit`] or link:/docs/commands/references/stop/[`stop`], an infinite loop results. +Control also leaves _proc_ if link:/commands/references/stop/[`stop`] is executed. If _proc_ never executes link:/commands/references/exit/[`exit`] or link:/commands/references/stop/[`stop`], an infinite loop results. === PostScript Level @@ -118,7 +118,7 @@ file { === Common Pitfalls -WARNING: *Infinite Loops* - Without link:/docs/commands/references/exit/[`exit`] or link:/docs/commands/references/stop/[`stop`], loop runs forever. +WARNING: *Infinite Loops* - Without link:/commands/references/exit/[`exit`] or link:/commands/references/stop/[`stop`], loop runs forever. [source,postscript] ---- @@ -174,8 +174,8 @@ TIP: *Use External Interrupt* - Infinite loops can be broken via implementation- === See Also -* link:/docs/commands/references/exit/[`exit`] - Exit loop -* link:/docs/commands/references/for/[`for`] - Numeric loop -* link:/docs/commands/references/repeat/[`repeat`] - Fixed repetition -* link:/docs/commands/references/stop/[`stop`] - Exit stopped context -* link:/docs/commands/references/forall/[`forall`] - Iterate collections \ No newline at end of file +* link:/commands/references/exit/[`exit`] - Exit loop +* link:/commands/references/for/[`for`] - Numeric loop +* link:/commands/references/repeat/[`repeat`] - Fixed repetition +* link:/commands/references/stop/[`stop`] - Exit stopped context +* link:/commands/references/forall/[`forall`] - Iterate collections \ No newline at end of file diff --git a/docs/commands/references/makefont.adoc b/docs/commands/references/makefont.adoc index e49cd82..c0e886e 100644 --- a/docs/commands/references/makefont.adoc +++ b/docs/commands/references/makefont.adoc @@ -29,17 +29,17 @@ font' === Description -link:/docs/commands/references/makefont/[`makefont`] applies `matrix` to `font`, producing a new `font'` whose characters are transformed by `matrix` when they are shown. link:/docs/commands/references/makefont/[`makefont`] first creates a copy of `font`. Then it replaces the new font's `FontMatrix` entry with the result of concatenating the existing `FontMatrix` with `matrix`. It inserts two additional entries, `OrigFont` and `ScaleMatrix`, whose purpose is internal to the implementation. Finally, it returns the result as `font'`. +link:/commands/references/makefont/[`makefont`] applies `matrix` to `font`, producing a new `font'` whose characters are transformed by `matrix` when they are shown. link:/commands/references/makefont/[`makefont`] first creates a copy of `font`. Then it replaces the new font's `FontMatrix` entry with the result of concatenating the existing `FontMatrix` with `matrix`. It inserts two additional entries, `OrigFont` and `ScaleMatrix`, whose purpose is internal to the implementation. Finally, it returns the result as `font'`. -The link:/docs/commands/references/makefont/[`makefont`], link:/docs/commands/references/scalefont/[`scalefont`], and `selectfont` operators produce a font dictionary derived from an original font dictionary, but with the `FontMatrix` entry altered. The derived font dictionary is allocated in local or global VM according to whether the original font dictionary is in local or global VM. This is independent of the current VM allocation mode. +The link:/commands/references/makefont/[`makefont`], link:/commands/references/scalefont/[`scalefont`], and `selectfont` operators produce a font dictionary derived from an original font dictionary, but with the `FontMatrix` entry altered. The derived font dictionary is allocated in local or global VM according to whether the original font dictionary is in local or global VM. This is independent of the current VM allocation mode. -Normally, link:/docs/commands/references/makefont/[`makefont`] copies only the font dictionary. Subsidiary objects, such as the `CharStrings` and `FontInfo` dictionaries, are shared with the original font. However, if `font` is a composite font, link:/docs/commands/references/makefont/[`makefont`] also copies the font dictionaries of any descendant composite fonts. It does not copy descendant base fonts. +Normally, link:/commands/references/makefont/[`makefont`] copies only the font dictionary. Subsidiary objects, such as the `CharStrings` and `FontInfo` dictionaries, are shared with the original font. However, if `font` is a composite font, link:/commands/references/makefont/[`makefont`] also copies the font dictionaries of any descendant composite fonts. It does not copy descendant base fonts. -Showing characters from the transformed font produces the same results as showing from the original font after having transformed user space by the same matrix. link:/docs/commands/references/makefont/[`makefont`] is essentially a convenience operator that permits the desired transformation to be encapsulated in the font description. +Showing characters from the transformed font produces the same results as showing from the original font after having transformed user space by the same matrix. link:/commands/references/makefont/[`makefont`] is essentially a convenience operator that permits the desired transformation to be encapsulated in the font description. -The most common transformation is to scale a font by a uniform factor in both x and y. link:/docs/commands/references/scalefont/[`scalefont`] is a special case of the more general link:/docs/commands/references/makefont/[`makefont`] and should be used for such uniform scaling. +The most common transformation is to scale a font by a uniform factor in both x and y. link:/commands/references/scalefont/[`scalefont`] is a special case of the more general link:/commands/references/makefont/[`makefont`] and should be used for such uniform scaling. -The interpreter keeps track of font dictionaries recently created by link:/docs/commands/references/makefont/[`makefont`]. Calling link:/docs/commands/references/makefont/[`makefont`] multiple times with the same font and matrix will usually return the same `font'` rather than create a new one. However, it is usually more efficient for a PostScript language program to apply link:/docs/commands/references/makefont/[`makefont`] only once for each font that it needs and to keep track of the resulting font dictionaries on its own. +The interpreter keeps track of font dictionaries recently created by link:/commands/references/makefont/[`makefont`]. Calling link:/commands/references/makefont/[`makefont`] multiple times with the same font and matrix will usually return the same `font'` rather than create a new one. However, it is usually more efficient for a PostScript language program to apply link:/commands/references/makefont/[`makefont`] only once for each font that it needs and to keep track of the resulting font dictionaries on its own. === Parameters @@ -169,7 +169,7 @@ y' = b×x + d×y + ty === See Also -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name -- link:/docs/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor (simpler) -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font -- link:/docs/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor (simpler) +- link:/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file diff --git a/docs/commands/references/mark.adoc b/docs/commands/references/mark.adoc index 404f5e0..1c67605 100644 --- a/docs/commands/references/mark.adoc +++ b/docs/commands/references/mark.adoc @@ -10,7 +10,7 @@ Pushes a mark object onto the operand stack to serve as a delimiter or reference == Description -The `mark` operator pushes a special mark object onto the operand stack. This object has its own unique type (`marktype`) and serves as a stack delimiter that can be detected by operators like link:/docs/commands/references/counttomark/[`counttomark`] and link:/docs/commands/references/cleartomark/[`cleartomark`]. +The `mark` operator pushes a special mark object onto the operand stack. This object has its own unique type (`marktype`) and serves as a stack delimiter that can be detected by operators like link:/commands/references/counttomark/[`counttomark`] and link:/commands/references/cleartomark/[`cleartomark`]. Marks are commonly used to delimit variable-length argument lists, allowing operators to process all stack elements down to the mark. The most familiar use is in array construction, where `[` is a synonym for `mark` and `]` creates an array from all elements up to the mark. @@ -252,7 +252,7 @@ count 0 gt { } if ---- -TIP: Always ensure marks are properly matched with either link:/docs/commands/references/cleartomark/[`cleartomark`], `]`, or explicit removal. Unmatched marks can interfere with later operations. +TIP: Always ensure marks are properly matched with either link:/commands/references/cleartomark/[`cleartomark`], `]`, or explicit removal. Unmatched marks can interfere with later operations. === Multiple Marks @@ -268,11 +268,11 @@ cleartomark % Stack: (empty) == Related Commands -* link:/docs/commands/references/cleartomark/[`cleartomark`] - Remove elements up to and including mark -* link:/docs/commands/references/counttomark/[`counttomark`] - Count elements to nearest mark +* link:/commands/references/cleartomark/[`cleartomark`] - Remove elements up to and including mark +* link:/commands/references/counttomark/[`counttomark`] - Count elements to nearest mark * `[` - Synonym for mark (used with `]`) * `]` - Create array from elements after mark -* link:/docs/commands/references/pop/[`pop`] - Remove single element (including marks) +* link:/commands/references/pop/[`pop`] - Remove single element (including marks) == PostScript Level @@ -294,11 +294,11 @@ The operand stack is full and cannot accommodate the mark object. Pushing a mark is a very fast O(1) operation, identical in cost to pushing any other object. -However, operations that search for marks (like link:/docs/commands/references/counttomark/[`counttomark`]) must scan the stack, which is O(n) where n is the distance to the mark. +However, operations that search for marks (like link:/commands/references/counttomark/[`counttomark`]) must scan the stack, which is O(n) where n is the distance to the mark. == Best Practices -1. **Use with paired operations**: Always pair `mark` with link:/docs/commands/references/cleartomark/[`cleartomark`] or `]` +1. **Use with paired operations**: Always pair `mark` with link:/commands/references/cleartomark/[`cleartomark`] or `]` 2. **Prefer [ ] for arrays**: Use `[` and `]` for array construction (more readable) 3. **Use mark for variable args**: Use `mark` when implementing variable-argument procedures 4. **Document mark usage**: Make it clear when procedures expect marks on the stack @@ -341,7 +341,7 @@ cleartomark == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/usage/basic/arrays/[Arrays] - Using marks for array construction -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/usage/basic/arrays/[Arrays] - Using marks for array construction +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/matrix.adoc b/docs/commands/references/matrix.adoc index 8ac28ee..4dcb5a7 100644 --- a/docs/commands/references/matrix.adoc +++ b/docs/commands/references/matrix.adoc @@ -37,7 +37,7 @@ Creates an identity transformation matrix. === Description -link:/docs/commands/references/matrix/[`matrix`] creates a 6-element array object, fills it with the values of an identity matrix [1.0 0.0 0.0 1.0 0.0 0.0], and pushes this array on the operand stack. +link:/commands/references/matrix/[`matrix`] creates a 6-element array object, fills it with the values of an identity matrix [1.0 0.0 0.0 1.0 0.0 0.0], and pushes this array on the operand stack. The array is allocated in local or global VM according to the current VM allocation mode. @@ -122,7 +122,7 @@ savedCTM setmatrix % Restore CTM === Common Pitfalls -WARNING: *Not Just Array Creation* - link:/docs/commands/references/matrix/[`matrix`] creates an array AND fills it with identity matrix values. +WARNING: *Not Just Array Creation* - link:/commands/references/matrix/[`matrix`] creates an array AND fills it with identity matrix values. [source,postscript] ---- @@ -155,7 +155,7 @@ myMatrix currentmatrix pop myMatrix 100 100 translate pop ---- -TIP: *Equivalent to Array Creation* - This is equivalent to link:/docs/commands/references/matrix/[`matrix`]: +TIP: *Equivalent to Array Creation* - This is equivalent to link:/commands/references/matrix/[`matrix`]: [source,postscript] ---- @@ -253,10 +253,10 @@ matrix currentmatrix % Get CTM into new matrix === See Also -* link:/docs/commands/references/identmatrix/[`identmatrix`] - Initialize array as identity matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation matrix -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Set transformation matrix -* link:/docs/commands/references/concat/[`concat`] - Concatenate matrix with CTM -* link:/docs/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices -* link:/docs/commands/references/array/[`array`] - Create array \ No newline at end of file +* link:/commands/references/identmatrix/[`identmatrix`] - Initialize array as identity matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation matrix +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/setmatrix/[`setmatrix`] - Set transformation matrix +* link:/commands/references/concat/[`concat`] - Concatenate matrix with CTM +* link:/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices +* link:/commands/references/array/[`array`] - Create array \ No newline at end of file diff --git a/docs/commands/references/maxlength.adoc b/docs/commands/references/maxlength.adoc index 37d2fc8..347ab5c 100644 --- a/docs/commands/references/maxlength.adoc +++ b/docs/commands/references/maxlength.adoc @@ -37,9 +37,9 @@ dict maxlength → int === Description -link:/docs/commands/references/maxlength/[`maxlength`] returns the capacity of _dict_ - the maximum number of key-value pairs it can hold using the VM currently allocated to it. +link:/commands/references/maxlength/[`maxlength`] returns the capacity of _dict_ - the maximum number of key-value pairs it can hold using the VM currently allocated to it. -**Level 1**: Returns the _int_ operand originally passed to link:/docs/commands/references/dict/[`dict`] - the dictionary's fixed maximum capacity. +**Level 1**: Returns the _int_ operand originally passed to link:/commands/references/dict/[`dict`] - the dictionary's fixed maximum capacity. **Level 2**: Returns the current capacity, which may be larger than the original size if the dictionary has grown. @@ -110,7 +110,7 @@ requiredSlots lt { === Common Pitfalls -WARNING: *maxlength ≠ length* - link:/docs/commands/references/maxlength/[`maxlength`] is capacity, link:/docs/commands/references/length/[`length`] is current count. +WARNING: *maxlength ≠ length* - link:/commands/references/maxlength/[`maxlength`] is capacity, link:/commands/references/length/[`length`] is current count. [source,postscript] ---- @@ -164,11 +164,11 @@ TIP: *Don't Rely on Exact Values* - In Level 2, maxlength may increase unpredict | Measurement | Operator | Meaning | Current entries -| link:/docs/commands/references/length/[`length`] +| link:/commands/references/length/[`length`] | Number of key-value pairs | Maximum capacity -| link:/docs/commands/references/maxlength/[`maxlength`] +| link:/commands/references/maxlength/[`maxlength`] | Slots available with current VM allocation | Available space @@ -178,7 +178,7 @@ TIP: *Don't Rely on Exact Values* - In Level 2, maxlength may increase unpredict === See Also -* link:/docs/commands/references/length/[`length`] - Get current entry count -* link:/docs/commands/references/dict/[`dict`] - Create dictionary with initial capacity -* link:/docs/commands/references/def/[`def`] - Add entry to dictionary -* link:/docs/commands/references/known/[`known`] - Check if key exists \ No newline at end of file +* link:/commands/references/length/[`length`] - Get current entry count +* link:/commands/references/dict/[`dict`] - Create dictionary with initial capacity +* link:/commands/references/def/[`def`] - Add entry to dictionary +* link:/commands/references/known/[`known`] - Check if key exists \ No newline at end of file diff --git a/docs/commands/references/mod.adoc b/docs/commands/references/mod.adoc index abae5ba..302948f 100644 --- a/docs/commands/references/mod.adoc +++ b/docs/commands/references/mod.adoc @@ -279,11 +279,11 @@ Both operands *must* be integers. Real numbers or other types will cause a `type == Related Commands -* link:/docs/commands/references/idiv/[`idiv`] - Integer division (quotient) -* link:/docs/commands/references/div/[`div`] - Division with real result -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/idiv/[`idiv`] - Integer division (quotient) +* link:/commands/references/div/[`div`] - Division with real result +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers == PostScript Level @@ -358,5 +358,5 @@ The `mod` operator is fast, typically implemented as a single hardware instructi == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/moveto.adoc b/docs/commands/references/moveto.adoc index 3183ff4..6065542 100644 --- a/docs/commands/references/moveto.adoc +++ b/docs/commands/references/moveto.adoc @@ -40,9 +40,9 @@ x y moveto → - === Description -link:/docs/commands/references/moveto/[`moveto`] starts a new subpath of the current path by setting the current point in the graphics state to the user space coordinate (x, y) without adding any line segments to the current path. +link:/commands/references/moveto/[`moveto`] starts a new subpath of the current path by setting the current point in the graphics state to the user space coordinate (x, y) without adding any line segments to the current path. -If the previous path construction operation was also a link:/docs/commands/references/moveto/[`moveto`] or link:/docs/commands/references/rmoveto/[`rmoveto`], that point is deleted from the current path and the new link:/docs/commands/references/moveto/[`moveto`] point replaces it. +If the previous path construction operation was also a link:/commands/references/moveto/[`moveto`] or link:/commands/references/rmoveto/[`rmoveto`], that point is deleted from the current path and the new link:/commands/references/moveto/[`moveto`] point replaces it. The coordinates are interpreted as user space coordinates and are transformed by the current transformation matrix (CTM) to device space when the path is constructed. @@ -126,7 +126,7 @@ fill % Fill both squares === Common Pitfalls -WARNING: *No Current Point Initially* - After link:/docs/commands/references/newpath/[`newpath`], there is no current point. Always use link:/docs/commands/references/moveto/[`moveto`] to establish one before operations like link:/docs/commands/references/lineto/[`lineto`] or link:/docs/commands/references/curveto/[`curveto`]. +WARNING: *No Current Point Initially* - After link:/commands/references/newpath/[`newpath`], there is no current point. Always use link:/commands/references/moveto/[`moveto`] to establish one before operations like link:/commands/references/lineto/[`lineto`] or link:/commands/references/curveto/[`curveto`]. [source,postscript] ---- @@ -134,7 +134,7 @@ newpath 200 200 lineto % Error: nocurrentpoint ---- -WARNING: *Consecutive moveto* - Multiple consecutive link:/docs/commands/references/moveto/[`moveto`] operations cause only the last one to be effective. The previous points are discarded. +WARNING: *Consecutive moveto* - Multiple consecutive link:/commands/references/moveto/[`moveto`] operations cause only the last one to be effective. The previous points are discarded. [source,postscript] ---- @@ -145,7 +145,7 @@ newpath 40 40 lineto % Line starts from (30, 30) ---- -TIP: *Use for Positioning* - link:/docs/commands/references/moveto/[`moveto`] is essential for positioning before drawing or showing text. It doesn't consume the current point—it sets it. +TIP: *Use for Positioning* - link:/commands/references/moveto/[`moveto`] is essential for positioning before drawing or showing text. It doesn't consume the current point—it sets it. === Error Conditions @@ -165,7 +165,7 @@ TIP: *Use for Positioning* - link:/docs/commands/references/moveto/[`moveto`] is === Implementation Notes -* link:/docs/commands/references/moveto/[`moveto`] does not add any segments to the path +* link:/commands/references/moveto/[`moveto`] does not add any segments to the path * Coordinates are immediately transformed by CTM to device space * The point becomes the start of a new subpath * Subsequent path operations use this as the current point @@ -176,14 +176,14 @@ TIP: *Use for Positioning* - link:/docs/commands/references/moveto/[`moveto`] is * Very lightweight operation * No path segments are created * Transformation happens immediately -* Multiple consecutive link:/docs/commands/references/moveto/[`moveto`] operations have minimal overhead (only the last is retained) +* Multiple consecutive link:/commands/references/moveto/[`moveto`] operations have minimal overhead (only the last is retained) === See Also -* link:/docs/commands/references/rmoveto/[`rmoveto`] - Relative moveto -* link:/docs/commands/references/lineto/[`lineto`] - Draw line to point -* link:/docs/commands/references/curveto/[`curveto`] - Draw curve to point -* link:/docs/commands/references/arc/[`arc`] - Draw circular arc -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath -* link:/docs/commands/references/newpath/[`newpath`] - Initialize empty path -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point coordinates \ No newline at end of file +* link:/commands/references/rmoveto/[`rmoveto`] - Relative moveto +* link:/commands/references/lineto/[`lineto`] - Draw line to point +* link:/commands/references/curveto/[`curveto`] - Draw curve to point +* link:/commands/references/arc/[`arc`] - Draw circular arc +* link:/commands/references/closepath/[`closepath`] - Close current subpath +* link:/commands/references/newpath/[`newpath`] - Initialize empty path +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point coordinates \ No newline at end of file diff --git a/docs/commands/references/mul.adoc b/docs/commands/references/mul.adoc index 0745a53..098c138 100644 --- a/docs/commands/references/mul.adoc +++ b/docs/commands/references/mul.adoc @@ -240,13 +240,13 @@ Both operands must be numeric (integer or real). Other types will cause a `typec == Related Commands -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/div/[`div`] - Divide two numbers (real result) -* link:/docs/commands/references/idiv/[`idiv`] - Integer division -* link:/docs/commands/references/mod/[`mod`] - Modulo (remainder) -* link:/docs/commands/references/exp/[`exp`] - Exponentiation -* link:/docs/commands/references/sqrt/[`sqrt`] - Square root +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/div/[`div`] - Divide two numbers (real result) +* link:/commands/references/idiv/[`idiv`] - Integer division +* link:/commands/references/mod/[`mod`] - Modulo (remainder) +* link:/commands/references/exp/[`exp`] - Exponentiation +* link:/commands/references/sqrt/[`sqrt`] - Square root == PostScript Level @@ -318,5 +318,5 @@ price quantity mul % Less intuitive == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/neg.adoc b/docs/commands/references/neg.adoc index e2f9dac..0eecc2b 100644 --- a/docs/commands/references/neg.adoc +++ b/docs/commands/references/neg.adoc @@ -240,9 +240,9 @@ true neg % ERROR: typecheck == Related Commands -* link:/docs/commands/references/abs/[`abs`] - Absolute value -* link:/docs/commands/references/sub/[`sub`] - Subtract two numbers -* link:/docs/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/abs/[`abs`] - Absolute value +* link:/commands/references/sub/[`sub`] - Subtract two numbers +* link:/commands/references/add/[`add`] - Add two numbers == PostScript Level @@ -323,5 +323,5 @@ value neg neg % Same as abs for negative, but keeps positive positive == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/newpath.adoc b/docs/commands/references/newpath.adoc index a895ed7..5d12a6b 100644 --- a/docs/commands/references/newpath.adoc +++ b/docs/commands/references/newpath.adoc @@ -37,11 +37,11 @@ Initializes the current path to empty, making the current point undefined. === Description -link:/docs/commands/references/newpath/[`newpath`] initializes the current path to be empty, causing the current point to become undefined. +link:/commands/references/newpath/[`newpath`] initializes the current path to be empty, causing the current point to become undefined. This operator is typically used at the beginning of a path construction sequence to ensure that no leftover path segments from previous operations interfere with the new path being constructed. -After link:/docs/commands/references/newpath/[`newpath`], the first path construction operation must be link:/docs/commands/references/moveto/[`moveto`] (or link:/docs/commands/references/arc/[`arc`], which can start without a current point) to establish a current point before using operations like link:/docs/commands/references/lineto/[`lineto`] or link:/docs/commands/references/curveto/[`curveto`]. +After link:/commands/references/newpath/[`newpath`], the first path construction operation must be link:/commands/references/moveto/[`moveto`] (or link:/commands/references/arc/[`arc`], which can start without a current point) to establish a current point before using operations like link:/commands/references/lineto/[`lineto`] or link:/commands/references/curveto/[`curveto`]. === PostScript Level @@ -154,7 +154,7 @@ newpath === Common Pitfalls -WARNING: *No Current Point After newpath* - After link:/docs/commands/references/newpath/[`newpath`], you must use link:/docs/commands/references/moveto/[`moveto`] before link:/docs/commands/references/lineto/[`lineto`], link:/docs/commands/references/curveto/[`curveto`], etc. +WARNING: *No Current Point After newpath* - After link:/commands/references/newpath/[`newpath`], you must use link:/commands/references/moveto/[`moveto`] before link:/commands/references/lineto/[`lineto`], link:/commands/references/curveto/[`curveto`], etc. [source,postscript] ---- @@ -162,7 +162,7 @@ newpath 200 200 lineto % Error: nocurrentpoint ---- -WARNING: *Painting Operators Don't Clear Path* - Unlike painting operators in some graphics systems, PostScript's `stroke` and `fill` do not automatically clear the path. Use link:/docs/commands/references/newpath/[`newpath`] explicitly. +WARNING: *Painting Operators Don't Clear Path* - Unlike painting operators in some graphics systems, PostScript's `stroke` and `fill` do not automatically clear the path. Use link:/commands/references/newpath/[`newpath`] explicitly. [source,postscript] ---- @@ -181,11 +181,11 @@ stroke newpath % Explicitly clear ---- -TIP: *Use at Start of Path Procedures* - Always begin path construction procedures with link:/docs/commands/references/newpath/[`newpath`] to ensure a clean slate. +TIP: *Use at Start of Path Procedures* - Always begin path construction procedures with link:/commands/references/newpath/[`newpath`] to ensure a clean slate. === Error Conditions -None. link:/docs/commands/references/newpath/[`newpath`] cannot generate errors. +None. link:/commands/references/newpath/[`newpath`] cannot generate errors. === Implementation Notes @@ -194,11 +194,11 @@ None. link:/docs/commands/references/newpath/[`newpath`] cannot generate errors. * Does not affect the graphics state otherwise * Very lightweight operation * Does not consume or produce any stack values -* Idempotent: calling link:/docs/commands/references/newpath/[`newpath`] multiple times has same effect as calling once +* Idempotent: calling link:/commands/references/newpath/[`newpath`] multiple times has same effect as calling once === Interaction with Graphics State -link:/docs/commands/references/newpath/[`newpath`] only affects the current path. It does not change: +link:/commands/references/newpath/[`newpath`] only affects the current path. It does not change: * Current transformation matrix (CTM) * Current color @@ -267,6 +267,6 @@ newpath % Start fresh === See Also -* link:/docs/commands/references/moveto/[`moveto`] - Set current point -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/moveto/[`moveto`] - Set current point +* link:/commands/references/closepath/[`closepath`] - Close current subpath +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/packedarray.adoc b/docs/commands/references/packedarray.adoc index efecbe1..2ba030f 100644 --- a/docs/commands/references/packedarray.adoc +++ b/docs/commands/references/packedarray.adoc @@ -46,7 +46,7 @@ any₀ ... anyₙ₋₁ n packedarray → packedarray === Description -link:/docs/commands/references/packedarray/[`packedarray`] creates a packed array object of length _n_ containing the objects any₀ through anyₙ₋₁ as elements. It: +link:/commands/references/packedarray/[`packedarray`] creates a packed array object of length _n_ containing the objects any₀ through anyₙ₋₁ as elements. It: 1. Removes the integer _n_ from the stack 2. Removes _n_ objects from the stack @@ -117,7 +117,7 @@ true setpacking === Common Pitfalls -WARNING: *Cannot Modify Packed Arrays* - Packed arrays are read-only. Attempting to use link:/docs/commands/references/put/[`put`] or link:/docs/commands/references/putinterval/[`putinterval`] causes [`invalidaccess`] error. +WARNING: *Cannot Modify Packed Arrays* - Packed arrays are read-only. Attempting to use link:/commands/references/put/[`put`] or link:/commands/references/putinterval/[`putinterval`] causes [`invalidaccess`] error. [source,postscript] ---- @@ -136,7 +136,7 @@ true setpacking false setpacking ---- -TIP: *Read Operations Work Normally* - Can use link:/docs/commands/references/get/[`get`], link:/docs/commands/references/getinterval/[`getinterval`], link:/docs/commands/references/aload/[`aload`], link:/docs/commands/references/forall/[`forall`], etc. +TIP: *Read Operations Work Normally* - Can use link:/commands/references/get/[`get`], link:/commands/references/getinterval/[`getinterval`], link:/commands/references/aload/[`aload`], link:/commands/references/forall/[`forall`], etc. === Error Conditions @@ -197,8 +197,8 @@ TIP: *Read Operations Work Normally* - Can use link:/docs/commands/references/ge === See Also -* link:/docs/commands/references/array/[`array`] - Create regular (modifiable) array -* link:/docs/commands/references/brackets/[`[`] / link:/docs/commands/references/brackets/[`]`] - Array literal syntax -* link:/docs/commands/references/aload/[`aload`] - Load packed array elements -* link:/docs/commands/references/get/[`get`] - Get packed array element -* link:/docs/commands/references/forall/[`forall`] - Iterate over packed array \ No newline at end of file +* link:/commands/references/array/[`array`] - Create regular (modifiable) array +* link:/commands/references/brackets/[`[`] / link:/commands/references/brackets/[`]`] - Array literal syntax +* link:/commands/references/aload/[`aload`] - Load packed array elements +* link:/commands/references/get/[`get`] - Get packed array element +* link:/commands/references/forall/[`forall`] - Iterate over packed array \ No newline at end of file diff --git a/docs/commands/references/pop.adoc b/docs/commands/references/pop.adoc index 6175c98..e65e109 100644 --- a/docs/commands/references/pop.adoc +++ b/docs/commands/references/pop.adoc @@ -187,11 +187,11 @@ pop % Removes result if not needed == Related Commands -* link:/docs/commands/references/exch/[`exch`] - Exchange top two elements instead of removing -* link:/docs/commands/references/dup/[`dup`] - Duplicate top element -* link:/docs/commands/references/clear/[`clear`] - Remove all elements from stack -* link:/docs/commands/references/roll/[`roll`] - Rotate elements (can achieve similar effects) -* link:/docs/commands/references/count/[`count`] - Check stack depth before popping +* link:/commands/references/exch/[`exch`] - Exchange top two elements instead of removing +* link:/commands/references/dup/[`dup`] - Duplicate top element +* link:/commands/references/clear/[`clear`] - Remove all elements from stack +* link:/commands/references/roll/[`roll`] - Rotate elements (can achieve similar effects) +* link:/commands/references/count/[`count`] - Check stack depth before popping == PostScript Level @@ -235,6 +235,6 @@ The `pop` operator is extremely fast and has negligible performance impact. It's == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/psindex.adoc b/docs/commands/references/psindex.adoc index 8d99fce..c376e0d 100644 --- a/docs/commands/references/psindex.adoc +++ b/docs/commands/references/psindex.adoc @@ -12,7 +12,7 @@ Duplicates the nth element from the top of the operand stack, where n is counted The `index` operator removes a non-negative integer n from the operand stack, counts down to the nth element from the top (where the top is position 0), and pushes a copy of that element onto the stack. -This operator is particularly useful for accessing elements deep in the stack without disturbing the intervening elements. It's essentially a generalized form of link:/docs/commands/references/dup/[`dup`], where `0 index` is equivalent to `dup`. +This operator is particularly useful for accessing elements deep in the stack without disturbing the intervening elements. It's essentially a generalized form of link:/commands/references/dup/[`dup`], where `0 index` is equivalent to `dup`. This is a Level 1 operator, available in all PostScript implementations. @@ -270,11 +270,11 @@ TIP: Remember that stack positions are counted from 0, where 0 is the topmost el == Related Commands -* link:/docs/commands/references/dup/[`dup`] - Equivalent to `0 index` -* link:/docs/commands/references/copy/[`copy`] - Copy multiple top elements -* link:/docs/commands/references/roll/[`roll`] - Rotate stack elements -* link:/docs/commands/references/exch/[`exch`] - Exchange top two elements -* link:/docs/commands/references/count/[`count`] - Get stack depth for bounds checking +* link:/commands/references/dup/[`dup`] - Equivalent to `0 index` +* link:/commands/references/copy/[`copy`] - Copy multiple top elements +* link:/commands/references/roll/[`roll`] - Rotate stack elements +* link:/commands/references/exch/[`exch`] - Exchange top two elements +* link:/commands/references/count/[`count`] - Get stack depth for bounds checking == PostScript Level @@ -325,9 +325,9 @@ However, frequently using large index values may indicate poor stack management. 1. **Use for deep access**: `index` is ideal when you need an element buried in the stack 2. **Prefer dup for top element**: Use `dup` rather than `0 index` for clarity -3. **Check bounds**: Use link:/docs/commands/references/count/[`count`] to verify sufficient stack depth before large indices +3. **Check bounds**: Use link:/commands/references/count/[`count`] to verify sufficient stack depth before large indices 4. **Document stack layout**: When using `index`, clearly document which stack position contains what -5. **Consider roll instead**: For repeated access to deep elements, link:/docs/commands/references/roll/[`roll`] might be more efficient +5. **Consider roll instead**: For repeated access to deep elements, link:/commands/references/roll/[`roll`] might be more efficient === Clear Documentation @@ -357,6 +357,6 @@ However, frequently using large index values may indicate poor stack management. == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/put.adoc b/docs/commands/references/put.adoc index 9e75141..cc9713b 100644 --- a/docs/commands/references/put.adoc +++ b/docs/commands/references/put.adoc @@ -60,7 +60,7 @@ string index int put → – === Description -link:/docs/commands/references/put/[`put`] replaces a single element in a composite object: +link:/commands/references/put/[`put`] replaces a single element in a composite object: * For arrays: stores _any_ at position _index_ (0 to n-1) * For strings: stores integer _int_ (0-255) at position _index_ @@ -149,7 +149,7 @@ WARNING: *Index Range* - Array/string index must be 0 to length-1. [1 2 3] 3 99 put % Error: index 3 out of range ---- -WARNING: *Packed Arrays are Read-Only* - Cannot use link:/docs/commands/references/put/[`put`] on packed arrays. +WARNING: *Packed Arrays are Read-Only* - Cannot use link:/commands/references/put/[`put`] on packed arrays. [source,postscript] ---- @@ -192,14 +192,14 @@ TIP: *Dictionary Auto-Expands (Level 2)* - In Level 2, dictionaries automaticall === Performance Considerations -* Array and string link:/docs/commands/references/put/[`put`] are very fast (direct indexing) -* Dictionary link:/docs/commands/references/put/[`put`] slightly slower (hash table operation) +* Array and string link:/commands/references/put/[`put`] are very fast (direct indexing) +* Dictionary link:/commands/references/put/[`put`] slightly slower (hash table operation) * Repeated dictionary puts in Level 1 may trigger slow rehashing if dictionary grows full -* For bulk updates, consider link:/docs/commands/references/putinterval/[`putinterval`] +* For bulk updates, consider link:/commands/references/putinterval/[`putinterval`] === See Also -* link:/docs/commands/references/get/[`get`] - Get element from array/string/dictionary -* link:/docs/commands/references/putinterval/[`putinterval`] - Put subarray/substring -* link:/docs/commands/references/astore/[`astore`] - Store multiple elements into array -* link:/docs/commands/references/length/[`length`] - Get length of array/string \ No newline at end of file +* link:/commands/references/get/[`get`] - Get element from array/string/dictionary +* link:/commands/references/putinterval/[`putinterval`] - Put subarray/substring +* link:/commands/references/astore/[`astore`] - Store multiple elements into array +* link:/commands/references/length/[`length`] - Get length of array/string \ No newline at end of file diff --git a/docs/commands/references/putinterval.adoc b/docs/commands/references/putinterval.adoc index 7851c08..f0b27b5 100644 --- a/docs/commands/references/putinterval.adoc +++ b/docs/commands/references/putinterval.adoc @@ -45,9 +45,9 @@ string1 index string2 putinterval → – === Description -link:/docs/commands/references/putinterval/[`putinterval`] replaces a subsequence of the first operand starting at _index_ with the entire contents of the third operand. +link:/commands/references/putinterval/[`putinterval`] replaces a subsequence of the first operand starting at _index_ with the entire contents of the third operand. -The objects are copied from the source to the destination as if by a sequence of individual link:/docs/commands/references/get/[`get`] and link:/docs/commands/references/put/[`put`] operations. For arrays, if copied elements are composite objects, their values are shared between source and destination. +The objects are copied from the source to the destination as if by a sequence of individual link:/commands/references/get/[`get`] and link:/commands/references/put/[`put`] operations. For arrays, if copied elements are composite objects, their values are shared between source and destination. Requirements: * _index_ must be valid (0 to length-1) @@ -143,7 +143,7 @@ dest 0 get 0 99 put % Modifies BOTH arrays! WARNING: *VM Restrictions* - If destination is in global VM and source contains local VM objects, [`invalidaccess`] error occurs. -TIP: *Efficient Copying* - link:/docs/commands/references/putinterval/[`putinterval`] is more efficient than multiple link:/docs/commands/references/put/[`put`] operations for bulk copying. +TIP: *Efficient Copying* - link:/commands/references/putinterval/[`putinterval`] is more efficient than multiple link:/commands/references/put/[`put`] operations for bulk copying. === Error Conditions @@ -173,14 +173,14 @@ TIP: *Efficient Copying* - link:/docs/commands/references/putinterval/[`putinter === Performance Considerations -* Much faster than individual link:/docs/commands/references/put/[`put`] operations +* Much faster than individual link:/commands/references/put/[`put`] operations * Efficient for bulk array/string operations * No intermediate objects created * Memory bandwidth limited for large copies === See Also -* link:/docs/commands/references/getinterval/[`getinterval`] - Extract subarray/substring -* link:/docs/commands/references/put/[`put`] - Store single element -* link:/docs/commands/references/get/[`get`] - Get single element -* link:/docs/commands/references/astore/[`astore`] - Store stack into array \ No newline at end of file +* link:/commands/references/getinterval/[`getinterval`] - Extract subarray/substring +* link:/commands/references/put/[`put`] - Store single element +* link:/commands/references/get/[`get`] - Get single element +* link:/commands/references/astore/[`astore`] - Store stack into array \ No newline at end of file diff --git a/docs/commands/references/quit.adoc b/docs/commands/references/quit.adoc index 4e29f42..5bf99fa 100644 --- a/docs/commands/references/quit.adoc +++ b/docs/commands/references/quit.adoc @@ -28,13 +28,13 @@ Terminates operation of the PostScript interpreter. === Description -link:/docs/commands/references/quit/[`quit`] terminates operation of the PostScript interpreter. The precise action depends on the environment: +link:/commands/references/quit/[`quit`] terminates operation of the PostScript interpreter. The precise action depends on the environment: * May return control to operating system * May halt or restart the machine * In multi-context systems (DPS): terminates current context only -In job server environments, link:/docs/commands/references/quit/[`quit`] in `userdict` is usually redefined to mean link:/docs/commands/references/stop/[`stop`] (terminate job, not interpreter). +In job server environments, link:/commands/references/quit/[`quit`] in `userdict` is usually redefined to mean link:/commands/references/stop/[`stop`] (terminate job, not interpreter). === PostScript Level @@ -96,7 +96,7 @@ quit % Usually stops job, not interpreter systemdict /quit get exec % Actually quits ---- -WARNING: *Immediate Termination* - link:/docs/commands/references/quit/[`quit`] terminates immediately, no cleanup. +WARNING: *Immediate Termination* - link:/commands/references/quit/[`quit`] terminates immediately, no cleanup. [source,postscript] ---- @@ -108,7 +108,7 @@ WARNING: *Immediate Termination* - link:/docs/commands/references/quit/[`quit`] } if ---- -TIP: *Use stop in Jobs* - In encapsulated jobs, use link:/docs/commands/references/stop/[`stop`] instead of link:/docs/commands/references/quit/[`quit`]. +TIP: *Use stop in Jobs* - In encapsulated jobs, use link:/commands/references/stop/[`stop`] instead of link:/commands/references/quit/[`quit`]. === Error Conditions @@ -145,6 +145,6 @@ end === See Also -* link:/docs/commands/references/stop/[`stop`] - Terminate stopped context -* link:/docs/commands/references/exit/[`exit`] - Exit loop -* link:/docs/commands/references/stopped/[`stopped`] - Error catching \ No newline at end of file +* link:/commands/references/stop/[`stop`] - Terminate stopped context +* link:/commands/references/exit/[`exit`] - Exit loop +* link:/commands/references/stopped/[`stopped`] - Error catching \ No newline at end of file diff --git a/docs/commands/references/rand.adoc b/docs/commands/references/rand.adoc index 58ab73e..5c445bb 100644 --- a/docs/commands/references/rand.adoc +++ b/docs/commands/references/rand.adoc @@ -10,7 +10,7 @@ Generates a pseudo-random integer. == Description -The `rand` operator generates and returns a pseudo-random integer in the range 0 to 2³¹ - 1 (2147483647). The sequence is deterministic and can be controlled using link:/docs/commands/references/srand/[`srand`] to set the seed and link:/docs/commands/references/rrand/[`rrand`] to get/restore the generator state. +The `rand` operator generates and returns a pseudo-random integer in the range 0 to 2³¹ - 1 (2147483647). The sequence is deterministic and can be controlled using link:/commands/references/srand/[`srand`] to set the seed and link:/commands/references/rrand/[`rrand`] to get/restore the generator state. This is a Level 1 operator, available in all PostScript implementations. @@ -134,8 +134,8 @@ rand % → 1804289383 (same sequence) == Related Commands -* link:/docs/commands/references/srand/[`srand`] - Seed random generator -* link:/docs/commands/references/rrand/[`rrand`] - Get/set random seed +* link:/commands/references/srand/[`srand`] - Seed random generator +* link:/commands/references/rrand/[`rrand`] - Get/set random seed == PostScript Level @@ -148,4 +148,4 @@ The operand stack is full (cannot push result). == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/rcheck.adoc b/docs/commands/references/rcheck.adoc index 3e75bbe..bab2d39 100644 --- a/docs/commands/references/rcheck.adoc +++ b/docs/commands/references/rcheck.adoc @@ -41,7 +41,7 @@ string rcheck → bool === Description -link:/docs/commands/references/rcheck/[`rcheck`] tests whether the operand's access attribute permits its value to be read explicitly by PostScript operators. +link:/commands/references/rcheck/[`rcheck`] tests whether the operand's access attribute permits its value to be read explicitly by PostScript operators. Returns: * `true` if access is **unlimited** or **readonly** @@ -124,9 +124,9 @@ dup rcheck % false (cannot read) dup exec % Works! (can execute) ---- -WARNING: *Confusing rcheck with xcheck* - link:/docs/commands/references/rcheck/[`rcheck`] tests read access, link:/docs/commands/references/xcheck/[`xcheck`] tests executable attribute. +WARNING: *Confusing rcheck with xcheck* - link:/commands/references/rcheck/[`rcheck`] tests read access, link:/commands/references/xcheck/[`xcheck`] tests executable attribute. -TIP: *Check Before Reading* - Use link:/docs/commands/references/rcheck/[`rcheck`] before operations that read object values. +TIP: *Check Before Reading* - Use link:/commands/references/rcheck/[`rcheck`] before operations that read object values. === Error Conditions @@ -177,7 +177,7 @@ TIP: *Check Before Reading* - Use link:/docs/commands/references/rcheck/[`rcheck === See Also -* link:/docs/commands/references/wcheck/[`wcheck`] - Test if writable -* link:/docs/commands/references/xcheck/[`xcheck`] - Test if executable +* link:/commands/references/wcheck/[`wcheck`] - Test if writable +* link:/commands/references/xcheck/[`xcheck`] - Test if executable * Access operators: `readonly`, `executeonly`, `noaccess` -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/rcurveto.adoc b/docs/commands/references/rcurveto.adoc index a64e14a..c9e3231 100644 --- a/docs/commands/references/rcurveto.adoc +++ b/docs/commands/references/rcurveto.adoc @@ -52,11 +52,11 @@ dx1 dy1 dx2 dy2 dx3 dy3 rcurveto → - === Description -link:/docs/commands/references/rcurveto/[`rcurveto`] (relative curveto) adds a Bézier cubic section to the current path in the same manner as link:/docs/commands/references/curveto/[`curveto`]. However, the three number pairs are interpreted as displacements relative to the current point (x0, y0) rather than as absolute coordinates. +link:/commands/references/rcurveto/[`rcurveto`] (relative curveto) adds a Bézier cubic section to the current path in the same manner as link:/commands/references/curveto/[`curveto`]. However, the three number pairs are interpreted as displacements relative to the current point (x0, y0) rather than as absolute coordinates. -That is, link:/docs/commands/references/rcurveto/[`rcurveto`] constructs a curve from (x0, y0) to (x0+dx3, y0+dy3), using (x0+dx1, y0+dy1) and (x0+dx2, y0+dy2) as Bézier control points. +That is, link:/commands/references/rcurveto/[`rcurveto`] constructs a curve from (x0, y0) to (x0+dx3, y0+dy3), using (x0+dx1, y0+dy1) and (x0+dx2, y0+dy2) as Bézier control points. -If the current point is undefined because the current path is empty, link:/docs/commands/references/rcurveto/[`rcurveto`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/rcurveto/[`rcurveto`] executes the [`nocurrentpoint`] error. === PostScript Level @@ -170,7 +170,7 @@ fill === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/rcurveto/[`rcurveto`] needs a current point. Use link:/docs/commands/references/moveto/[`moveto`] first. +WARNING: *Requires Current Point* - link:/commands/references/rcurveto/[`rcurveto`] needs a current point. Use link:/commands/references/moveto/[`moveto`] first. [source,postscript] ---- @@ -178,7 +178,7 @@ newpath 50 50 100 50 150 0 rcurveto % Error: nocurrentpoint ---- -WARNING: *All Coordinates Are Relative* - Unlike link:/docs/commands/references/curveto/[`curveto`], all six parameters are displacements from the current point, not absolute positions. +WARNING: *All Coordinates Are Relative* - Unlike link:/commands/references/curveto/[`curveto`], all six parameters are displacements from the current point, not absolute positions. [source,postscript] ---- @@ -187,7 +187,7 @@ WARNING: *All Coordinates Are Relative* - Unlike link:/docs/commands/references/ % Actually draws to (250, 250), not (150, 150) ---- -TIP: *Ideal for Patterns* - link:/docs/commands/references/rcurveto/[`rcurveto`] excels at creating repeating curved patterns where each curve relates to the previous position. +TIP: *Ideal for Patterns* - link:/commands/references/rcurveto/[`rcurveto`] excels at creating repeating curved patterns where each curve relates to the previous position. === Error Conditions @@ -221,15 +221,15 @@ TIP: *Ideal for Patterns* - link:/docs/commands/references/rcurveto/[`rcurveto`] === Performance Considerations -* No performance difference from link:/docs/commands/references/curveto/[`curveto`] +* No performance difference from link:/commands/references/curveto/[`curveto`] * Reduces coordinate calculation in code * More maintainable for relative patterns * Can accumulate rounding errors in long sequences === See Also -* link:/docs/commands/references/curveto/[`curveto`] - Absolute curveto -* link:/docs/commands/references/rlineto/[`rlineto`] - Relative lineto -* link:/docs/commands/references/rmoveto/[`rmoveto`] - Relative moveto -* link:/docs/commands/references/arc/[`arc`] - Draw circular arc -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file +* link:/commands/references/curveto/[`curveto`] - Absolute curveto +* link:/commands/references/rlineto/[`rlineto`] - Relative lineto +* link:/commands/references/rmoveto/[`rmoveto`] - Relative moveto +* link:/commands/references/arc/[`arc`] - Draw circular arc +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point \ No newline at end of file diff --git a/docs/commands/references/rectclip.adoc b/docs/commands/references/rectclip.adoc index a6865e2..cc58b42 100644 --- a/docs/commands/references/rectclip.adoc +++ b/docs/commands/references/rectclip.adoc @@ -66,11 +66,11 @@ numstring rectclip → - === Description -link:/docs/commands/references/rectclip/[`rectclip`] intersects the inside of the current clipping path with a rectangular path the operands describe. In the first form, the operands are four numbers that describe a single rectangle. In the other two forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. +link:/commands/references/rectclip/[`rectclip`] intersects the inside of the current clipping path with a rectangular path the operands describe. In the first form, the operands are four numbers that describe a single rectangle. In the other two forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. -After computing the new clipping path, link:/docs/commands/references/rectclip/[`rectclip`] resets the current path to empty, as if by link:/docs/commands/references/newpath/[`newpath`]. +After computing the new clipping path, link:/commands/references/rectclip/[`rectclip`] resets the current path to empty, as if by link:/commands/references/newpath/[`newpath`]. -In the first form, assuming width and height are positive, link:/docs/commands/references/rectclip/[`rectclip`] is equivalent to: +In the first form, assuming width and height are positive, link:/commands/references/rectclip/[`rectclip`] is equivalent to: [source,postscript] ---- @@ -248,7 +248,7 @@ grestore === Common Pitfalls -WARNING: *Clipping Can Only Shrink* - Like link:/docs/commands/references/clip/[`clip`], you cannot enlarge the clipping region. +WARNING: *Clipping Can Only Shrink* - Like link:/commands/references/clip/[`clip`], you cannot enlarge the clipping region. [source,postscript] ---- @@ -259,7 +259,7 @@ WARNING: *Clipping Can Only Shrink* - Like link:/docs/commands/references/clip/[ 0 0 300 300 rectclip % Still limited to intersection ---- -WARNING: *Path Is Cleared* - Unlike link:/docs/commands/references/clip/[`clip`], link:/docs/commands/references/rectclip/[`rectclip`] automatically clears the current path. +WARNING: *Path Is Cleared* - Unlike link:/commands/references/clip/[`clip`], link:/commands/references/rectclip/[`rectclip`] automatically clears the current path. [source,postscript] ---- @@ -318,26 +318,26 @@ grestore === Implementation Notes -* link:/docs/commands/references/rectclip/[`rectclip`] is optimized for rectangular clipping regions +* link:/commands/references/rectclip/[`rectclip`] is optimized for rectangular clipping regions * Multiple rectangles create a union clip region -* Much faster than constructing paths with link:/docs/commands/references/clip/[`clip`] +* Much faster than constructing paths with link:/commands/references/clip/[`clip`] * The current path is automatically cleared after operation * All rectangles use non-zero winding number rule * Very efficient for simple rectangular masking === Graphics State Interaction -link:/docs/commands/references/rectclip/[`rectclip`] affects: +link:/commands/references/rectclip/[`rectclip`] affects: * Current clipping path - Intersected with rectangles * Current path - Cleared to empty -link:/docs/commands/references/rectclip/[`rectclip`] does not affect other graphics state parameters. +link:/commands/references/rectclip/[`rectclip`] does not affect other graphics state parameters. The new clipping path is part of the graphics state and is affected by: -* link:/docs/commands/references/gsave/[`gsave`] - Saves clipping path -* link:/docs/commands/references/grestore/[`grestore`] - Restores saved clipping path +* link:/commands/references/gsave/[`gsave`] - Saves clipping path +* link:/commands/references/grestore/[`grestore`] - Restores saved clipping path * `save`/`restore` - Saves/restores with VM state === Best Practices @@ -424,8 +424,8 @@ grestore === Performance Considerations -* link:/docs/commands/references/rectclip/[`rectclip`] is highly optimized for rectangular regions -* Much faster than equivalent link:/docs/commands/references/clip/[`clip`] with constructed paths +* link:/commands/references/rectclip/[`rectclip`] is highly optimized for rectangular regions +* Much faster than equivalent link:/commands/references/clip/[`clip`] with constructed paths * Multiple rectangles in one operation are efficient * Simple rectangular clips have minimal performance impact * More efficient than complex path-based clipping @@ -452,7 +452,7 @@ newpath 100 100 80 60 rectclip ---- -Benefits of link:/docs/commands/references/rectclip/[`rectclip`]: +Benefits of link:/commands/references/rectclip/[`rectclip`]: * More concise syntax * Faster execution @@ -565,12 +565,12 @@ drawWindows === See Also -* link:/docs/commands/references/clip/[`clip`] - Clip to arbitrary path (non-zero winding) -* link:/docs/commands/references/eoclip/[`eoclip`] - Clip to path (even-odd rule) -* link:/docs/commands/references/clippath/[`clippath`] - Get current clipping path -* link:/docs/commands/references/rectfill/[`rectfill`] - Fill rectangles (Level 2) -* link:/docs/commands/references/rectstroke/[`rectstroke`] - Stroke rectangles (Level 2) +* link:/commands/references/clip/[`clip`] - Clip to arbitrary path (non-zero winding) +* link:/commands/references/eoclip/[`eoclip`] - Clip to path (even-odd rule) +* link:/commands/references/clippath/[`clippath`] - Get current clipping path +* link:/commands/references/rectfill/[`rectfill`] - Fill rectangles (Level 2) +* link:/commands/references/rectstroke/[`rectstroke`] - Stroke rectangles (Level 2) * `initclip` - Reset to device default clip -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state +* link:/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file diff --git a/docs/commands/references/rectfill.adoc b/docs/commands/references/rectfill.adoc index 14c28e7..f89c022 100644 --- a/docs/commands/references/rectfill.adoc +++ b/docs/commands/references/rectfill.adoc @@ -66,11 +66,11 @@ numstring rectfill → - === Description -link:/docs/commands/references/rectfill/[`rectfill`] fills a path consisting of one or more rectangles the operands describe. In the first form, the operands are four numbers that describe a single rectangle. In the other two forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. +link:/commands/references/rectfill/[`rectfill`] fills a path consisting of one or more rectangles the operands describe. In the first form, the operands are four numbers that describe a single rectangle. In the other two forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. -link:/docs/commands/references/rectfill/[`rectfill`] neither reads nor alters the current path in the graphics state. +link:/commands/references/rectfill/[`rectfill`] neither reads nor alters the current path in the graphics state. -In the first form, assuming width and height are positive, link:/docs/commands/references/rectfill/[`rectfill`] is equivalent to: +In the first form, assuming width and height are positive, link:/commands/references/rectfill/[`rectfill`] is equivalent to: [source,postscript] ---- @@ -222,7 +222,7 @@ drawWindows === Common Pitfalls -WARNING: *Current Path Unaffected* - link:/docs/commands/references/rectfill/[`rectfill`] does not modify the current path. +WARNING: *Current Path Unaffected* - link:/commands/references/rectfill/[`rectfill`] does not modify the current path. [source,postscript] ---- @@ -254,7 +254,7 @@ WARNING: *Array Must Have Quadruples* - Array length must be a multiple of 4. [100 100 50 50] rectfill ---- -TIP: *More Efficient Than Manual Construction* - link:/docs/commands/references/rectfill/[`rectfill`] is optimized and faster than constructing paths manually: +TIP: *More Efficient Than Manual Construction* - link:/commands/references/rectfill/[`rectfill`] is optimized and faster than constructing paths manually: [source,postscript] ---- @@ -291,7 +291,7 @@ grestore === Implementation Notes -* link:/docs/commands/references/rectfill/[`rectfill`] is optimized for efficiency +* link:/commands/references/rectfill/[`rectfill`] is optimized for efficiency * Multiple rectangles are filled as a single operation * The operation is enclosed in implicit gsave/grestore * Rectangles can overlap without issue @@ -300,13 +300,13 @@ grestore === Graphics State Interaction -link:/docs/commands/references/rectfill/[`rectfill`] uses these graphics state parameters: +link:/commands/references/rectfill/[`rectfill`] uses these graphics state parameters: * Current color and color space * Current clipping path * Current transformation matrix (CTM) -link:/docs/commands/references/rectfill/[`rectfill`] does not affect: +link:/commands/references/rectfill/[`rectfill`] does not affect: * Current path - Completely isolated * Any graphics state parameters @@ -391,7 +391,7 @@ rectangles rectfill === Performance Considerations -* link:/docs/commands/references/rectfill/[`rectfill`] is highly optimized for rectangular regions +* link:/commands/references/rectfill/[`rectfill`] is highly optimized for rectangular regions * Significantly faster than equivalent path construction and fill * Multiple rectangles in one operation are more efficient than separate operations * Encoded number strings provide maximum efficiency @@ -420,7 +420,7 @@ grestore 100 100 50 50 rectfill ---- -Benefits of link:/docs/commands/references/rectfill/[`rectfill`]: +Benefits of link:/commands/references/rectfill/[`rectfill`]: * More concise syntax * Faster execution @@ -496,12 +496,12 @@ Benefits of link:/docs/commands/references/rectfill/[`rectfill`]: === See Also -* link:/docs/commands/references/fill/[`fill`] - Fill arbitrary path -* link:/docs/commands/references/rectstroke/[`rectstroke`] - Stroke rectangles (Level 2) -* link:/docs/commands/references/rectclip/[`rectclip`] - Clip to rectangles (Level 2) -* link:/docs/commands/references/stroke/[`stroke`] - Stroke path -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/setgray/[`setgray`] - Set gray color -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/fill/[`fill`] - Fill arbitrary path +* link:/commands/references/rectstroke/[`rectstroke`] - Stroke rectangles (Level 2) +* link:/commands/references/rectclip/[`rectclip`] - Clip to rectangles (Level 2) +* link:/commands/references/stroke/[`stroke`] - Stroke path +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/setgray/[`setgray`] - Set gray color +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/rectstroke.adoc b/docs/commands/references/rectstroke.adoc index e232178..5610e93 100644 --- a/docs/commands/references/rectstroke.adoc +++ b/docs/commands/references/rectstroke.adoc @@ -93,13 +93,13 @@ numstring matrix rectstroke → - === Description -link:/docs/commands/references/rectstroke/[`rectstroke`] strokes a path consisting of one or more rectangles the operands describe. In the first two forms, the operands are four numbers that describe a single rectangle. In the remaining forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. +link:/commands/references/rectstroke/[`rectstroke`] strokes a path consisting of one or more rectangles the operands describe. In the first two forms, the operands are four numbers that describe a single rectangle. In the remaining forms, the operand is an array or an encoded number string that describes an arbitrary number of rectangles. -link:/docs/commands/references/rectstroke/[`rectstroke`] neither reads nor alters the current path in the graphics state. +link:/commands/references/rectstroke/[`rectstroke`] neither reads nor alters the current path in the graphics state. -If the matrix operand is present, link:/docs/commands/references/rectstroke/[`rectstroke`] concatenates matrix to the CTM after defining the path, but before stroking it. The matrix applies to the line width and dash pattern, if any, but not to the path itself. +If the matrix operand is present, link:/commands/references/rectstroke/[`rectstroke`] concatenates matrix to the CTM after defining the path, but before stroking it. The matrix applies to the line width and dash pattern, if any, but not to the path itself. -In the first two forms, assuming width and height are positive, link:/docs/commands/references/rectstroke/[`rectstroke`] is equivalent to: +In the first two forms, assuming width and height are positive, link:/commands/references/rectstroke/[`rectstroke`] is equivalent to: [source,postscript] ---- @@ -243,7 +243,7 @@ drawBorders === Common Pitfalls -WARNING: *Current Path Unaffected* - link:/docs/commands/references/rectstroke/[`rectstroke`] does not modify the current path. +WARNING: *Current Path Unaffected* - link:/commands/references/rectstroke/[`rectstroke`] does not modify the current path. [source,postscript] ---- @@ -315,7 +315,7 @@ rectstroke % Uniform 2-point line === Implementation Notes -* link:/docs/commands/references/rectstroke/[`rectstroke`] is optimized for efficiency +* link:/commands/references/rectstroke/[`rectstroke`] is optimized for efficiency * Multiple rectangles are stroked as a single operation * The operation is enclosed in implicit gsave/grestore * Rectangles can overlap without issue @@ -324,18 +324,18 @@ rectstroke % Uniform 2-point line === Graphics State Parameters -link:/docs/commands/references/rectstroke/[`rectstroke`] uses these parameters: +link:/commands/references/rectstroke/[`rectstroke`] uses these parameters: -* Line width - from link:/docs/commands/references/setlinewidth/[`setlinewidth`] -* Line cap - from link:/docs/commands/references/setlinecap/[`setlinecap`] -* Line join - from link:/docs/commands/references/setlinejoin/[`setlinejoin`] -* Miter limit - from link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] -* Dash pattern - from link:/docs/commands/references/setdash/[`setdash`] +* Line width - from link:/commands/references/setlinewidth/[`setlinewidth`] +* Line cap - from link:/commands/references/setlinecap/[`setlinecap`] +* Line join - from link:/commands/references/setlinejoin/[`setlinejoin`] +* Miter limit - from link:/commands/references/setmiterlimit/[`setmiterlimit`] +* Dash pattern - from link:/commands/references/setdash/[`setdash`] * Current color and color space * Current clipping path * Current transformation matrix (CTM) -link:/docs/commands/references/rectstroke/[`rectstroke`] does not affect: +link:/commands/references/rectstroke/[`rectstroke`] does not affect: * Current path - Completely isolated * Any graphics state parameters @@ -459,7 +459,7 @@ origMatrix setmatrix === Performance Considerations -* link:/docs/commands/references/rectstroke/[`rectstroke`] is highly optimized +* link:/commands/references/rectstroke/[`rectstroke`] is highly optimized * Significantly faster than manual path construction * Multiple rectangles in one operation are more efficient * Matrix parameter adds minimal overhead @@ -491,7 +491,7 @@ grestore 100 100 50 50 rectstroke ---- -Benefits of link:/docs/commands/references/rectstroke/[`rectstroke`]: +Benefits of link:/commands/references/rectstroke/[`rectstroke`]: * More concise syntax * Faster execution @@ -608,7 +608,7 @@ Benefits of link:/docs/commands/references/rectstroke/[`rectstroke`]: === Common Pitfalls -WARNING: *Current Path Unaffected* - link:/docs/commands/references/rectstroke/[`rectstroke`] does not modify the current path. +WARNING: *Current Path Unaffected* - link:/commands/references/rectstroke/[`rectstroke`] does not modify the current path. [source,postscript] ---- @@ -630,7 +630,7 @@ WARNING: *Matrix Parameter Affects Stroke, Not Coordinates* - The matrix affects rectstroke % Rectangle at same position ---- -WARNING: *Graphics State Must Be Set First* - Set line parameters before calling link:/docs/commands/references/rectstroke/[`rectstroke`]. +WARNING: *Graphics State Must Be Set First* - Set line parameters before calling link:/commands/references/rectstroke/[`rectstroke`]. [source,postscript] ---- @@ -676,7 +676,7 @@ rectstroke % Uniform 2-point line === Implementation Notes -* link:/docs/commands/references/rectstroke/[`rectstroke`] is optimized for efficiency +* link:/commands/references/rectstroke/[`rectstroke`] is optimized for efficiency * Multiple rectangles are stroked as a single operation * The operation is enclosed in implicit gsave/grestore * All current line parameters are applied @@ -685,7 +685,7 @@ rectstroke % Uniform 2-point line === Graphics State Parameters -All stroke-related parameters affect link:/docs/commands/references/rectstroke/[`rectstroke`]: +All stroke-related parameters affect link:/commands/references/rectstroke/[`rectstroke`]: * **Line width** - Thickness of stroked lines * **Line cap** - Appearance of rectangle corners (with line join) @@ -789,7 +789,7 @@ rects rectstroke === Performance Considerations -* link:/docs/commands/references/rectstroke/[`rectstroke`] is highly optimized +* link:/commands/references/rectstroke/[`rectstroke`] is highly optimized * Much faster than manual path construction * Multiple rectangles are more efficient than separate operations * Matrix parameter adds minimal overhead @@ -866,13 +866,13 @@ rects rectstroke === See Also -* link:/docs/commands/references/stroke/[`stroke`] - Stroke arbitrary path -* link:/docs/commands/references/rectfill/[`rectfill`] - Fill rectangles (Level 2) -* link:/docs/commands/references/rectclip/[`rectclip`] - Clip to rectangles (Level 2) -* link:/docs/commands/references/ustroke/[`ustroke`] - Stroke user path (Level 2) -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file +* link:/commands/references/stroke/[`stroke`] - Stroke arbitrary path +* link:/commands/references/rectfill/[`rectfill`] - Fill rectangles (Level 2) +* link:/commands/references/rectclip/[`rectclip`] - Clip to rectangles (Level 2) +* link:/commands/references/ustroke/[`ustroke`] - Stroke user path (Level 2) +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit +* link:/commands/references/setdash/[`setdash`] - Set dash pattern +* link:/commands/references/newpath/[`newpath`] - Clear current path \ No newline at end of file diff --git a/docs/commands/references/repeat.adoc b/docs/commands/references/repeat.adoc index 3c92af7..ace994f 100644 --- a/docs/commands/references/repeat.adoc +++ b/docs/commands/references/repeat.adoc @@ -40,11 +40,11 @@ int proc repeat → – === Description -link:/docs/commands/references/repeat/[`repeat`] executes _proc_ exactly _int_ times, where _int_ must be a non-negative integer. +link:/commands/references/repeat/[`repeat`] executes _proc_ exactly _int_ times, where _int_ must be a non-negative integer. The operator removes both operands before executing _proc_ for the first time. If _int_ is 0, _proc_ is not executed at all. -If _proc_ executes link:/docs/commands/references/exit/[`exit`], the loop terminates prematurely. +If _proc_ executes link:/commands/references/exit/[`exit`], the loop terminates prematurely. === PostScript Level @@ -127,14 +127,14 @@ WARNING: *Stack Accumulation* - If _proc_ pushes values without consuming them, % Stack has 10 copies of 42! ---- -WARNING: *No Control Variable* - Unlike link:/docs/commands/references/for/[`for`], link:/docs/commands/references/repeat/[`repeat`] doesn't provide iteration index. +WARNING: *No Control Variable* - Unlike link:/commands/references/for/[`for`], link:/commands/references/repeat/[`repeat`] doesn't provide iteration index. [source,postscript] ---- 5 { % No way to know which iteration } repeat ---- -TIP: *Use for if Index Needed* - If you need to know the iteration number, use link:/docs/commands/references/for/[`for`] instead: +TIP: *Use for if Index Needed* - If you need to know the iteration number, use link:/commands/references/for/[`for`] instead: [source,postscript] ---- @@ -171,25 +171,25 @@ TIP: *Use for if Index Needed* - If you need to know the iteration number, use l | Use Case | Operator | Reason | Need iteration index -| link:/docs/commands/references/for/[`for`] +| link:/commands/references/for/[`for`] | Provides control variable | Fixed count, no index -| link:/docs/commands/references/repeat/[`repeat`] +| link:/commands/references/repeat/[`repeat`] | Simpler, faster | Conditional termination -| link:/docs/commands/references/loop/[`loop`] +| link:/commands/references/loop/[`loop`] | Exit when condition met | Iterate collection -| link:/docs/commands/references/forall/[`forall`] +| link:/commands/references/forall/[`forall`] | Works with arrays/strings |=== === See Also -* link:/docs/commands/references/for/[`for`] - Loop with control variable -* link:/docs/commands/references/loop/[`loop`] - Indefinite loop -* link:/docs/commands/references/exit/[`exit`] - Exit loop early -* link:/docs/commands/references/forall/[`forall`] - Iterate collections \ No newline at end of file +* link:/commands/references/for/[`for`] - Loop with control variable +* link:/commands/references/loop/[`loop`] - Indefinite loop +* link:/commands/references/exit/[`exit`] - Exit loop early +* link:/commands/references/forall/[`forall`] - Iterate collections \ No newline at end of file diff --git a/docs/commands/references/rlineto.adoc b/docs/commands/references/rlineto.adoc index ed4a0e1..c6e6c1d 100644 --- a/docs/commands/references/rlineto.adoc +++ b/docs/commands/references/rlineto.adoc @@ -40,9 +40,9 @@ dx dy rlineto → - === Description -link:/docs/commands/references/rlineto/[`rlineto`] (relative lineto) appends a straight line segment to the current path in the same manner as link:/docs/commands/references/lineto/[`lineto`]. However, the number pair is interpreted as a displacement relative to the current point (x, y) rather than as an absolute coordinate. That is, link:/docs/commands/references/rlineto/[`rlineto`] constructs a line from (x, y) to (x + dx, y + dy) and makes (x + dx, y + dy) the new current point. +link:/commands/references/rlineto/[`rlineto`] (relative lineto) appends a straight line segment to the current path in the same manner as link:/commands/references/lineto/[`lineto`]. However, the number pair is interpreted as a displacement relative to the current point (x, y) rather than as an absolute coordinate. That is, link:/commands/references/rlineto/[`rlineto`] constructs a line from (x, y) to (x + dx, y + dy) and makes (x + dx, y + dy) the new current point. -If the current point is undefined because the current path is empty, link:/docs/commands/references/rlineto/[`rlineto`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/rlineto/[`rlineto`] executes the [`nocurrentpoint`] error. === PostScript Level @@ -152,7 +152,7 @@ stroke === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/rlineto/[`rlineto`] requires an established current point. Use link:/docs/commands/references/moveto/[`moveto`] first. +WARNING: *Requires Current Point* - link:/commands/references/rlineto/[`rlineto`] requires an established current point. Use link:/commands/references/moveto/[`moveto`] first. [source,postscript] ---- @@ -169,7 +169,7 @@ WARNING: *Displacements Not Absolute* - The arguments are relative displacements -25 0 rlineto % Moves to (125, 100), not (-25, 100) ---- -TIP: *Ideal for Regular Patterns* - link:/docs/commands/references/rlineto/[`rlineto`] excels at creating regular, repeating patterns where each segment relates to the previous one. +TIP: *Ideal for Regular Patterns* - link:/commands/references/rlineto/[`rlineto`] excels at creating regular, repeating patterns where each segment relates to the previous one. === Error Conditions @@ -195,20 +195,20 @@ TIP: *Ideal for Regular Patterns* - link:/docs/commands/references/rlineto/[`rli * Displacements are in user space, transformed by CTM * More convenient than calculating absolute coordinates * Equivalent to: `currentpoint transform dx dy add transform lineto` -* Successive link:/docs/commands/references/rlineto/[`rlineto`] calls build polylines efficiently +* Successive link:/commands/references/rlineto/[`rlineto`] calls build polylines efficiently * Negative displacements move backward or downward === Performance Considerations -* No performance difference from link:/docs/commands/references/lineto/[`lineto`] +* No performance difference from link:/commands/references/lineto/[`lineto`] * Reduces calculation overhead in code * More maintainable for relative patterns * Can reduce rounding errors in repetitive patterns === See Also -* link:/docs/commands/references/lineto/[`lineto`] - Absolute lineto -* link:/docs/commands/references/rmoveto/[`rmoveto`] - Relative moveto -* link:/docs/commands/references/rcurveto/[`rcurveto`] - Relative curveto -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point -* link:/docs/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file +* link:/commands/references/lineto/[`lineto`] - Absolute lineto +* link:/commands/references/rmoveto/[`rmoveto`] - Relative moveto +* link:/commands/references/rcurveto/[`rcurveto`] - Relative curveto +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point +* link:/commands/references/closepath/[`closepath`] - Close current subpath \ No newline at end of file diff --git a/docs/commands/references/rmoveto.adoc b/docs/commands/references/rmoveto.adoc index 23d3e21..7650d9a 100644 --- a/docs/commands/references/rmoveto.adoc +++ b/docs/commands/references/rmoveto.adoc @@ -40,9 +40,9 @@ dx dy rmoveto → - === Description -link:/docs/commands/references/rmoveto/[`rmoveto`] (relative moveto) starts a new subpath of the current path in the same manner as link:/docs/commands/references/moveto/[`moveto`]. However, the number pair is interpreted as a displacement relative to the current point (x, y) rather than as an absolute coordinate. That is, link:/docs/commands/references/rmoveto/[`rmoveto`] makes (x + dx, y + dy) the new current point, without connecting it to the previous point. +link:/commands/references/rmoveto/[`rmoveto`] (relative moveto) starts a new subpath of the current path in the same manner as link:/commands/references/moveto/[`moveto`]. However, the number pair is interpreted as a displacement relative to the current point (x, y) rather than as an absolute coordinate. That is, link:/commands/references/rmoveto/[`rmoveto`] makes (x + dx, y + dy) the new current point, without connecting it to the previous point. -If the current point is undefined because the current path is empty, link:/docs/commands/references/rmoveto/[`rmoveto`] executes the [`nocurrentpoint`] error. +If the current point is undefined because the current path is empty, link:/commands/references/rmoveto/[`rmoveto`] executes the [`nocurrentpoint`] error. === PostScript Level @@ -137,7 +137,7 @@ newpath === Common Pitfalls -WARNING: *Requires Current Point* - link:/docs/commands/references/rmoveto/[`rmoveto`] requires a current point. Use link:/docs/commands/references/moveto/[`moveto`] first to establish one. +WARNING: *Requires Current Point* - link:/commands/references/rmoveto/[`rmoveto`] requires a current point. Use link:/commands/references/moveto/[`moveto`] first to establish one. [source,postscript] ---- @@ -153,7 +153,7 @@ WARNING: *Displacement Not Position* - The arguments are displacements (dx, dy), -50 -50 rmoveto % Moves to (50, 50), not (-50, -50) ---- -TIP: *Use for Relative Layouts* - link:/docs/commands/references/rmoveto/[`rmoveto`] is ideal for creating shapes or text layouts where elements are positioned relative to each other. +TIP: *Use for Relative Layouts* - link:/commands/references/rmoveto/[`rmoveto`] is ideal for creating shapes or text layouts where elements are positioned relative to each other. === Error Conditions @@ -184,14 +184,14 @@ TIP: *Use for Relative Layouts* - link:/docs/commands/references/rmoveto/[`rmove === Performance Considerations -* Slightly faster than computing absolute coordinates and using link:/docs/commands/references/moveto/[`moveto`] +* Slightly faster than computing absolute coordinates and using link:/commands/references/moveto/[`moveto`] * Useful for patterns and repeated structures -* No performance difference from link:/docs/commands/references/moveto/[`moveto`] in terms of path complexity +* No performance difference from link:/commands/references/moveto/[`moveto`] in terms of path complexity === See Also -* link:/docs/commands/references/moveto/[`moveto`] - Absolute moveto -* link:/docs/commands/references/rlineto/[`rlineto`] - Relative lineto -* link:/docs/commands/references/rcurveto/[`rcurveto`] - Relative curveto -* link:/docs/commands/references/currentpoint/[`currentpoint`] - Get current point coordinates -* link:/docs/commands/references/newpath/[`newpath`] - Initialize empty path \ No newline at end of file +* link:/commands/references/moveto/[`moveto`] - Absolute moveto +* link:/commands/references/rlineto/[`rlineto`] - Relative lineto +* link:/commands/references/rcurveto/[`rcurveto`] - Relative curveto +* link:/commands/references/currentpoint/[`currentpoint`] - Get current point coordinates +* link:/commands/references/newpath/[`newpath`] - Initialize empty path \ No newline at end of file diff --git a/docs/commands/references/roll.adoc b/docs/commands/references/roll.adoc index e5085f7..69c979e 100644 --- a/docs/commands/references/roll.adoc +++ b/docs/commands/references/roll.adoc @@ -239,10 +239,10 @@ TIP: The actual rotation is j mod n. Rolling by j and j+n produces identical res == Related Commands -* link:/docs/commands/references/exch/[`exch`] - Equivalent to `2 1 roll` or `2 -1 roll` -* link:/docs/commands/[`index`] - Access element without reordering -* link:/docs/commands/references/copy/[`copy`] - Duplicate elements -* link:/docs/commands/references/pop/[`pop`] - Remove elements +* link:/commands/references/exch/[`exch`] - Equivalent to `2 1 roll` or `2 -1 roll` +* link:/commands/[`index`] - Access element without reordering +* link:/commands/references/copy/[`copy`] - Duplicate elements +* link:/commands/references/pop/[`pop`] - Remove elements == PostScript Level @@ -289,9 +289,9 @@ Frequently rotating large numbers of elements may indicate poor stack management == Best Practices -1. **Use exch for two elements**: `2 1 roll` and `2 -1 roll` both work, but link:/docs/commands/references/exch/[`exch`] is clearer +1. **Use exch for two elements**: `2 1 roll` and `2 -1 roll` both work, but link:/commands/references/exch/[`exch`] is clearer 2. **Document rotations**: Always comment what `roll` is doing, as it's not immediately obvious -3. **Consider index instead**: Sometimes link:/docs/commands/references/psindex/[`psindex`] is clearer than `roll` for accessing buried elements +3. **Consider index instead**: Sometimes link:/commands/references/psindex/[`psindex`] is clearer than `roll` for accessing buried elements 4. **Keep n small**: Large rotations suggest stack management issues 5. **Use standard patterns**: Establish conventions like `3 1 roll` for rotating three elements @@ -332,6 +332,6 @@ Frequently rotating large numbers of elements may indicate poor stack management == See Also -* link:/docs/syntax/operators/[Operators Overview] - Understanding PostScript operators -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial -* link:/docs/commands/references/[Stack Manipulation] - All stack operators +* link:/syntax/operators/[Operators Overview] - Understanding PostScript operators +* link:/usage/basic/stack-operations/[Stack Operations Guide] - Stack manipulation tutorial +* link:/commands/references/[Stack Manipulation] - All stack operators diff --git a/docs/commands/references/rotate.adoc b/docs/commands/references/rotate.adoc index 2bb54ac..89a59d7 100644 --- a/docs/commands/references/rotate.adoc +++ b/docs/commands/references/rotate.adoc @@ -47,11 +47,11 @@ angle matrix rotate → matrix === Description -With no matrix operand, link:/docs/commands/references/rotate/[`rotate`] builds a temporary transformation matrix R and concatenates it with the current transformation matrix (CTM). Precisely, link:/docs/commands/references/rotate/[`rotate`] replaces the CTM by R × CTM. +With no matrix operand, link:/commands/references/rotate/[`rotate`] builds a temporary transformation matrix R and concatenates it with the current transformation matrix (CTM). Precisely, link:/commands/references/rotate/[`rotate`] replaces the CTM by R × CTM. The effect is to rotate the user coordinate system axes about their origin by `angle` degrees. Positive angles rotate counterclockwise; negative angles rotate clockwise. The position of the user coordinate origin and the sizes of the x and y units are unchanged. -If the `matrix` operand is supplied, link:/docs/commands/references/rotate/[`rotate`] replaces the value of `matrix` by R and pushes the modified matrix back on the operand stack. In this case, link:/docs/commands/references/rotate/[`rotate`] does not affect the CTM. +If the `matrix` operand is supplied, link:/commands/references/rotate/[`rotate`] replaces the value of `matrix` by R and pushes the modified matrix back on the operand stack. In this case, link:/commands/references/rotate/[`rotate`] does not affect the CTM. The rotation matrix R for angle θ (in degrees) has the form: @@ -175,7 +175,7 @@ grestore === Common Pitfalls -WARNING: *Rotation Center* - link:/docs/commands/references/rotate/[`rotate`] always rotates around the current origin, not around drawn content. +WARNING: *Rotation Center* - link:/commands/references/rotate/[`rotate`] always rotates around the current origin, not around drawn content. [source,postscript] ---- @@ -262,7 +262,7 @@ TIP: *Order Matters* - Rotation before translation is different from translation === Matrix Mathematics -The rotation matrix for link:/docs/commands/references/rotate/[`rotate`] by angle θ is: +The rotation matrix for link:/commands/references/rotate/[`rotate`] by angle θ is: ---- R = [cos(θ) sin(θ) -sin(θ) cos(θ) 0 0] @@ -345,10 +345,10 @@ concat === See Also -* link:/docs/commands/references/translate/[`translate`] - Move origin -* link:/docs/commands/references/scale/[`scale`] - Change unit size -* link:/docs/commands/references/concat/[`concat`] - Concatenate arbitrary matrix -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/translate/[`translate`] - Move origin +* link:/commands/references/scale/[`scale`] - Change unit size +* link:/commands/references/concat/[`concat`] - Concatenate arbitrary matrix +* link:/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/round.adoc b/docs/commands/references/round.adoc index 024fa86..792f3b1 100644 --- a/docs/commands/references/round.adoc +++ b/docs/commands/references/round.adoc @@ -93,9 +93,9 @@ WARNING: Ties (0.5) always round toward the greater value. == Related Commands -* link:/docs/commands/references/ceiling/[`ceiling`] - Round up -* link:/docs/commands/references/floor/[`floor`] - Round down -* link:/docs/commands/references/truncate/[`truncate`] - Truncate toward zero +* link:/commands/references/ceiling/[`ceiling`] - Round up +* link:/commands/references/floor/[`floor`] - Round down +* link:/commands/references/truncate/[`truncate`] - Truncate toward zero == PostScript Level @@ -111,4 +111,4 @@ The operand is not a number. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/rrand.adoc b/docs/commands/references/rrand.adoc index 1a65d0e..69cf2cd 100644 --- a/docs/commands/references/rrand.adoc +++ b/docs/commands/references/rrand.adoc @@ -10,7 +10,7 @@ Returns the current state of the random number generator. == Description -The `rrand` operator returns an integer representing the current state of the random number generator used by link:/docs/commands/references/rand/[`rand`]. This state value can later be passed to link:/docs/commands/references/srand/[`srand`] to restore the generator to this exact position in its sequence, allowing you to reproduce or continue a specific random sequence. +The `rrand` operator returns an integer representing the current state of the random number generator used by link:/commands/references/rand/[`rand`]. This state value can later be passed to link:/commands/references/srand/[`srand`] to restore the generator to this exact position in its sequence, allowing you to reproduce or continue a specific random sequence. This is a Level 1 operator, available in all PostScript implementations. @@ -89,8 +89,8 @@ rand % Same sequence as after saved state == Related Commands -* link:/docs/commands/references/rand/[`rand`] - Generate random integer -* link:/docs/commands/references/srand/[`srand`] - Seed random generator +* link:/commands/references/rand/[`rand`] - Generate random integer +* link:/commands/references/srand/[`srand`] - Seed random generator == PostScript Level @@ -109,4 +109,4 @@ The operand stack is full (cannot push result). == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/scale.adoc b/docs/commands/references/scale.adoc index 5eb1014..f88b532 100644 --- a/docs/commands/references/scale.adoc +++ b/docs/commands/references/scale.adoc @@ -50,11 +50,11 @@ sx sy matrix scale → matrix === Description -With no matrix operand, link:/docs/commands/references/scale/[`scale`] builds a temporary transformation matrix S and concatenates it with the current transformation matrix (CTM). Precisely, link:/docs/commands/references/scale/[`scale`] replaces the CTM by S × CTM. +With no matrix operand, link:/commands/references/scale/[`scale`] builds a temporary transformation matrix S and concatenates it with the current transformation matrix (CTM). Precisely, link:/commands/references/scale/[`scale`] replaces the CTM by S × CTM. The effect is to make the x and y units in the user coordinate system the size of `sx` and `sy` units in the former user coordinate system. The position of the user coordinate origin and the orientation of the axes are unchanged. -If the `matrix` operand is supplied, link:/docs/commands/references/scale/[`scale`] replaces the value of `matrix` by S and pushes the modified matrix back on the operand stack. In this case, link:/docs/commands/references/scale/[`scale`] does not affect the CTM. +If the `matrix` operand is supplied, link:/commands/references/scale/[`scale`] replaces the value of `matrix` by S and pushes the modified matrix back on the operand stack. In this case, link:/commands/references/scale/[`scale`] does not affect the CTM. The scaling matrix S has the form: @@ -232,7 +232,7 @@ TIP: *Preserve Aspect Ratio* - For proportional scaling, use the same value for === Matrix Mathematics -The scaling matrix for link:/docs/commands/references/scale/[`scale`] by (`sx`, `sy`) is: +The scaling matrix for link:/commands/references/scale/[`scale`] by (`sx`, `sy`) is: ---- S = [sx 0 0 sy 0 0] @@ -281,11 +281,11 @@ grestore === See Also -* link:/docs/commands/references/translate/[`translate`] - Move origin -* link:/docs/commands/references/rotate/[`rotate`] - Rotate axes -* link:/docs/commands/references/concat/[`concat`] - Concatenate arbitrary matrix -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/translate/[`translate`] - Move origin +* link:/commands/references/rotate/[`rotate`] - Rotate axes +* link:/commands/references/concat/[`concat`] - Concatenate arbitrary matrix +* link:/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/scalefont.adoc b/docs/commands/references/scalefont.adoc index 805544f..dab006e 100644 --- a/docs/commands/references/scalefont.adoc +++ b/docs/commands/references/scalefont.adoc @@ -29,19 +29,19 @@ font' === Description -link:/docs/commands/references/scalefont/[`scalefont`] applies the scale factor `scale` to `font`, producing a new `font'` whose characters are scaled by `scale` (in both x and y) when they are shown. link:/docs/commands/references/scalefont/[`scalefont`] first creates a copy of `font`, then replaces the new font's `FontMatrix` entry with the result of scaling the existing `FontMatrix` by `scale`. +link:/commands/references/scalefont/[`scalefont`] applies the scale factor `scale` to `font`, producing a new `font'` whose characters are scaled by `scale` (in both x and y) when they are shown. link:/commands/references/scalefont/[`scalefont`] first creates a copy of `font`, then replaces the new font's `FontMatrix` entry with the result of scaling the existing `FontMatrix` by `scale`. It inserts two additional entries, `OrigFont` and `ScaleMatrix`, whose purpose is internal to the implementation. Finally, it returns the result as `font'`. -Showing characters from the transformed font produces the same results as showing from the original font after having scaled user space by the factor `scale` in both x and y by means of the link:../transformations/scale/[`scale`] operator. +Showing characters from the transformed font produces the same results as showing from the original font after having scaled user space by the factor `scale` in both x and y by means of the link:/commands/references/scale/[`scale`] operator. -link:/docs/commands/references/scalefont/[`scalefont`] is essentially a convenience operator that enables the desired scale factor to be encapsulated in the font description. Another operator, link:/docs/commands/references/makefont/[`makefont`], performs more general transformations than simple scaling. +link:/commands/references/scalefont/[`scalefont`] is essentially a convenience operator that enables the desired scale factor to be encapsulated in the font description. Another operator, link:/commands/references/makefont/[`makefont`], performs more general transformations than simple scaling. -The interpreter keeps track of font dictionaries recently created by link:/docs/commands/references/scalefont/[`scalefont`]. Calling link:/docs/commands/references/scalefont/[`scalefont`] multiple times with the same font and scale will usually return the same `font'` rather than create a new one each time. However, it is usually more efficient for a PostScript language program to apply link:/docs/commands/references/scalefont/[`scalefont`] only once for each font that it needs and to keep track of the resulting font dictionaries on its own. +The interpreter keeps track of font dictionaries recently created by link:/commands/references/scalefont/[`scalefont`]. Calling link:/commands/references/scalefont/[`scalefont`] multiple times with the same font and scale will usually return the same `font'` rather than create a new one each time. However, it is usually more efficient for a PostScript language program to apply link:/commands/references/scalefont/[`scalefont`] only once for each font that it needs and to keep track of the resulting font dictionaries on its own. === VM Allocation -The link:/docs/commands/references/makefont/[`makefont`], link:/docs/commands/references/scalefont/[`scalefont`], and link:../graphics-state/selectfont/[`selectfont`] operators produce a font dictionary derived from an original font dictionary, but with the `FontMatrix` entry altered. The derived font dictionary is allocated in local or global VM according to whether the original font dictionary is in local or global VM. This is independent of the current VM allocation mode. +The link:/commands/references/makefont/[`makefont`], link:/commands/references/scalefont/[`scalefont`], and link:/commands/references/selectfont/[`selectfont`] operators produce a font dictionary derived from an original font dictionary, but with the `FontMatrix` entry altered. The derived font dictionary is allocated in local or global VM according to whether the original font dictionary is in local or global VM. This is independent of the current VM allocation mode. === Parameters @@ -116,7 +116,7 @@ FontMatrix' = [scale 0 0 scale 0 0] × FontMatrix === See Also -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name -- link:/docs/commands/references/makefont/[`makefont`] - Transform font by matrix (for non-uniform scaling) -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font -- link:/docs/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/makefont/[`makefont`] - Transform font by matrix (for non-uniform scaling) +- link:/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/currentfont/[`currentfont`] - Get current font dictionary \ No newline at end of file diff --git a/docs/commands/references/search.adoc b/docs/commands/references/search.adoc index fdabe8a..c769708 100644 --- a/docs/commands/references/search.adoc +++ b/docs/commands/references/search.adoc @@ -62,7 +62,7 @@ string seek search → post match pre true (if found) === Description -link:/docs/commands/references/search/[`search`] looks for the first occurrence of _seek_ within _string_. +link:/commands/references/search/[`search`] looks for the first occurrence of _seek_ within _string_. If found, it splits _string_ into three segments: * _pre_: portion before the match @@ -172,7 +172,7 @@ WARNING: *Stack Order* - Results are post, match, pre (reversed from read order) % Actually: true (he) (ll) (o) ---- -TIP: *Use anchorsearch for Prefixes* - If you only need to check the start of a string, link:/docs/commands/references/anchorsearch/[`anchorsearch`] is simpler. +TIP: *Use anchorsearch for Prefixes* - If you only need to check the start of a string, link:/commands/references/anchorsearch/[`anchorsearch`] is simpler. === Error Conditions @@ -239,6 +239,6 @@ TIP: *Use anchorsearch for Prefixes* - If you only need to check the start of a === See Also -* link:/docs/commands/references/anchorsearch/[`anchorsearch`] - Test for prefix match -* link:/docs/commands/references/token/[`token`] - Parse token from string -* link:/docs/commands/references/getinterval/[`getinterval`] - Extract substring \ No newline at end of file +* link:/commands/references/anchorsearch/[`anchorsearch`] - Test for prefix match +* link:/commands/references/token/[`token`] - Parse token from string +* link:/commands/references/getinterval/[`getinterval`] - Extract substring \ No newline at end of file diff --git a/docs/commands/references/setcmykcolor.adoc b/docs/commands/references/setcmykcolor.adoc index 935e464..1235c10 100644 --- a/docs/commands/references/setcmykcolor.adoc +++ b/docs/commands/references/setcmykcolor.adoc @@ -46,7 +46,7 @@ cyan magenta yellow black setcmykcolor → – === Description -link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] sets the color space to DeviceCMYK and sets the current color using cyan, magenta, yellow, and black components. +link:/commands/references/setcmykcolor/[`setcmykcolor`] sets the color space to DeviceCMYK and sets the current color using cyan, magenta, yellow, and black components. Each component must be in range 0.0 to 1.0: @@ -56,7 +56,7 @@ Each component must be in range 0.0 to 1.0: This establishes the color for subsequent painting operations (lines, fills, text). CMYK is a **subtractive** color model primarily used for printing. -**Important:** Color values set by link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] are **not** affected by black generation and undercolor removal operations. +**Important:** Color values set by link:/commands/references/setcmykcolor/[`setcmykcolor`] are **not** affected by black generation and undercolor removal operations. === PostScript Level @@ -159,7 +159,7 @@ This establishes the color for subsequent painting operations (lines, fills, tex === Common Pitfalls -WARNING: *Changes Color Space* - link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] changes color space to DeviceCMYK. +WARNING: *Changes Color Space* - link:/commands/references/setcmykcolor/[`setcmykcolor`] changes color space to DeviceCMYK. [source,postscript] ---- @@ -287,7 +287,7 @@ Manually implement UCR: === See Also -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/setgray/[`setgray`] - Set grayscale -* link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color -* link:/docs/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/setgray/[`setgray`] - Set grayscale +* link:/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color +* link:/commands/references/currentcmykcolor/[`currentcmykcolor`] - Get CMYK color (Level 2) diff --git a/docs/commands/references/setdash.adoc b/docs/commands/references/setdash.adoc index ff3bf7e..c11370f 100644 --- a/docs/commands/references/setdash.adoc +++ b/docs/commands/references/setdash.adoc @@ -40,7 +40,7 @@ array offset setdash → – === Description -link:/docs/commands/references/setdash/[`setdash`] sets the dash pattern parameter in the graphics state. This controls the pattern of dashes and gaps used by subsequent [`stroke`] operations. +link:/commands/references/setdash/[`setdash`] sets the dash pattern parameter in the graphics state. This controls the pattern of dashes and gaps used by subsequent [`stroke`] operations. The **array** specifies the pattern: @@ -51,7 +51,7 @@ The **array** specifies the pattern: The **offset** specifies how far into the pattern to start (in user space units). -The dash pattern is interpreted in user space and is unaffected by transformations applied after link:/docs/commands/references/setdash/[`setdash`] is called. +The dash pattern is interpreted in user space and is unaffected by transformations applied after link:/commands/references/setdash/[`setdash`] is called. === PostScript Level @@ -285,7 +285,7 @@ stroke === See Also -* link:/docs/commands/references/currentdash/[`currentdash`] - Get current dash pattern -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line end style -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set corner style +* link:/commands/references/currentdash/[`currentdash`] - Get current dash pattern +* link:/commands/references/setlinecap/[`setlinecap`] - Set line end style +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set corner style diff --git a/docs/commands/references/setfont.adoc b/docs/commands/references/setfont.adoc index 54b8679..5ed685e 100644 --- a/docs/commands/references/setfont.adoc +++ b/docs/commands/references/setfont.adoc @@ -29,9 +29,9 @@ font === Description -link:/docs/commands/references/setfont/[`setfont`] establishes the font dictionary parameter in the graphics state. This specifies the font to be used by subsequent character operators, such as link:/docs/commands/references/show/[`show`] and link:/docs/commands/references/stringwidth/[`stringwidth`]. The `font` must be a valid font dictionary previously returned by link:/docs/commands/references/findfont/[`findfont`], link:/docs/commands/references/scalefont/[`scalefont`], or link:/docs/commands/references/makefont/[`makefont`]. +link:/commands/references/setfont/[`setfont`] establishes the font dictionary parameter in the graphics state. This specifies the font to be used by subsequent character operators, such as link:/commands/references/show/[`show`] and link:/commands/references/stringwidth/[`stringwidth`]. The `font` must be a valid font dictionary previously returned by link:/commands/references/findfont/[`findfont`], link:/commands/references/scalefont/[`scalefont`], or link:/commands/references/makefont/[`makefont`]. -The font remains current until changed by another link:/docs/commands/references/setfont/[`setfont`] or `selectfont` operation, or until the graphics state is restored by `grestore` or `grestoreall`. +The font remains current until changed by another link:/commands/references/setfont/[`setfont`] or `selectfont` operation, or until the graphics state is restored by `grestore` or `grestoreall`. === Parameters @@ -112,7 +112,7 @@ For Type 3 fonts: === Graphics State Impact -link:/docs/commands/references/setfont/[`setfont`] only modifies the font parameter of the graphics state. It does not affect: +link:/commands/references/setfont/[`setfont`] only modifies the font parameter of the graphics state. It does not affect: - Current transformation matrix - Current path @@ -140,9 +140,9 @@ newpath === See Also -- link:/docs/commands/references/currentfont/[`currentfont`] - Get current font dictionary -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name -- link:/docs/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor -- link:/docs/commands/references/makefont/[`makefont`] - Transform font by matrix -- link:/docs/commands/references/show/[`show`] - Paint text string at current point -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file +- link:/commands/references/currentfont/[`currentfont`] - Get current font dictionary +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/scalefont/[`scalefont`] - Scale font by uniform factor +- link:/commands/references/makefont/[`makefont`] - Transform font by matrix +- link:/commands/references/show/[`show`] - Paint text string at current point +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file diff --git a/docs/commands/references/setgray.adoc b/docs/commands/references/setgray.adoc index d465b70..472ae5d 100644 --- a/docs/commands/references/setgray.adoc +++ b/docs/commands/references/setgray.adoc @@ -37,7 +37,7 @@ num setgray → – === Description -link:/docs/commands/references/setgray/[`setgray`] sets the color space to DeviceGray and sets the current color to a gray shade corresponding to _num_. +link:/commands/references/setgray/[`setgray`] sets the color space to DeviceGray and sets the current color to a gray shade corresponding to _num_. * **0** = black * **1** = white @@ -126,7 +126,7 @@ Values outside 0-1 are clamped to nearest legal value (no error). === Common Pitfalls -WARNING: *Changes Color Space* - link:/docs/commands/references/setgray/[`setgray`] changes color space to DeviceGray. +WARNING: *Changes Color Space* - link:/commands/references/setgray/[`setgray`] changes color space to DeviceGray. [source,postscript] ---- @@ -169,8 +169,8 @@ TIP: *Use for Monochrome* - Most efficient color operation for monochrome output === See Also -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) -* link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color -* link:/docs/commands/references/currentgray/[`currentgray`] - Get current gray value +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) +* link:/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB color +* link:/commands/references/currentgray/[`currentgray`] - Get current gray value * Color operations (to be documented) - Advanced color spaces \ No newline at end of file diff --git a/docs/commands/references/setgstate.adoc b/docs/commands/references/setgstate.adoc index 1478455..b5798f9 100644 --- a/docs/commands/references/setgstate.adoc +++ b/docs/commands/references/setgstate.adoc @@ -37,7 +37,7 @@ gstate setgstate → – === Description -link:/docs/commands/references/setgstate/[`setgstate`] replaces the current graphics state by the value of the gstate object. This is a **copying operation**, so subsequent modifications to the value of gstate will not affect the current graphics state or vice versa. +link:/commands/references/setgstate/[`setgstate`] replaces the current graphics state by the value of the gstate object. This is a **copying operation**, so subsequent modifications to the value of gstate will not affect the current graphics state or vice versa. This is a **wholesale replacement** of all components of the graphics state. In particular: @@ -210,7 +210,7 @@ items { === Common Pitfalls -WARNING: *Clipping Path Replaced* - link:/docs/commands/references/setgstate/[`setgstate`] replaces the clipping path, not intersects. +WARNING: *Clipping Path Replaced* - link:/commands/references/setgstate/[`setgstate`] replaces the clipping path, not intersects. [source,postscript] ---- @@ -236,7 +236,7 @@ temp setgstate % Path is still empty, not restored ---- -WARNING: *Not for Simple Save/Restore* - Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] for temporary changes. +WARNING: *Not for Simple Save/Restore* - Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] for temporary changes. [source,postscript] ---- @@ -278,7 +278,7 @@ TIP: *Reusable Templates* - Create gstate objects once, reuse many times. === Graphics State Replacement -link:/docs/commands/references/setgstate/[`setgstate`] replaces: +link:/commands/references/setgstate/[`setgstate`] replaces: * ✓ Transformation matrix (CTM) * ✓ Color space and color @@ -291,8 +291,8 @@ link:/docs/commands/references/setgstate/[`setgstate`] replaces: === See Also -* link:/docs/commands/references/gstate/[`gstate`] - Create graphics state object -* link:/docs/commands/references/currentgstate/[`currentgstate`] - Update gstate with current state -* link:/docs/commands/references/gsave/[`gsave`] - Save state on graphics state stack -* link:/docs/commands/references/grestore/[`grestore`] - Restore state from stack -* link:/docs/commands/references/grestoreall/[`grestoreall`] - Restore all saved states +* link:/commands/references/gstate/[`gstate`] - Create graphics state object +* link:/commands/references/currentgstate/[`currentgstate`] - Update gstate with current state +* link:/commands/references/gsave/[`gsave`] - Save state on graphics state stack +* link:/commands/references/grestore/[`grestore`] - Restore state from stack +* link:/commands/references/grestoreall/[`grestoreall`] - Restore all saved states diff --git a/docs/commands/references/sethsbcolor.adoc b/docs/commands/references/sethsbcolor.adoc index 60b71fe..e384bb2 100644 --- a/docs/commands/references/sethsbcolor.adoc +++ b/docs/commands/references/sethsbcolor.adoc @@ -43,7 +43,7 @@ hue saturation brightness sethsbcolor → – === Description -link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] sets the color space to DeviceRGB and sets the current color using hue, saturation, and brightness components. +link:/commands/references/sethsbcolor/[`sethsbcolor`] sets the color space to DeviceRGB and sets the current color using hue, saturation, and brightness components. **HSB components:** @@ -54,9 +54,9 @@ link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] sets the color space * **Brightness** (0.0 to 1.0): Color intensity - 0.0 = black, 1.0 = maximum brightness -NOTE: HSB is **not a color space** in its own right, merely a means for entering RGB color values in a different coordinate system. The color value entered by link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] is immediately converted into the RGB model and used with the DeviceRGB color space. +NOTE: HSB is **not a color space** in its own right, merely a means for entering RGB color values in a different coordinate system. The color value entered by link:/commands/references/sethsbcolor/[`sethsbcolor`] is immediately converted into the RGB model and used with the DeviceRGB color space. -link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] does not give a rangecheck error for values outside the range 0 to 1; it substitutes the nearest legal value. +link:/commands/references/sethsbcolor/[`sethsbcolor`] does not give a rangecheck error for values outside the range 0 to 1; it substitutes the nearest legal value. === PostScript Level @@ -310,7 +310,7 @@ Green-+-Red === See Also -* link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color -* link:/docs/commands/references/setgray/[`setgray`] - Set grayscale -* link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) -* link:/docs/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color +* link:/commands/references/setrgbcolor/[`setrgbcolor`] - Set RGB color +* link:/commands/references/setgray/[`setgray`] - Set grayscale +* link:/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK color (Level 2) +* link:/commands/references/currenthsbcolor/[`currenthsbcolor`] - Get HSB color diff --git a/docs/commands/references/setlinecap.adoc b/docs/commands/references/setlinecap.adoc index bb423a7..e5bbb52 100644 --- a/docs/commands/references/setlinecap.adoc +++ b/docs/commands/references/setlinecap.adoc @@ -37,7 +37,7 @@ int setlinecap → – === Description -link:/docs/commands/references/setlinecap/[`setlinecap`] sets the line cap parameter to _int_, which must be 0, 1, or 2. This controls the shape of line ends for open subpaths painted by [`stroke`]. +link:/commands/references/setlinecap/[`setlinecap`] sets the line cap parameter to _int_, which must be 0, 1, or 2. This controls the shape of line ends for open subpaths painted by [`stroke`]. **Cap styles:** * **0** = Butt cap: squared off at endpoint (no projection) @@ -163,7 +163,7 @@ Square (2): [──────────] === See Also -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set corner style -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/currentlinecap/[`currentlinecap`] - Get current cap +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set corner style +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/currentlinecap/[`currentlinecap`] - Get current cap * Stroke operations (to be documented) \ No newline at end of file diff --git a/docs/commands/references/setlinejoin.adoc b/docs/commands/references/setlinejoin.adoc index df23507..be82020 100644 --- a/docs/commands/references/setlinejoin.adoc +++ b/docs/commands/references/setlinejoin.adoc @@ -37,7 +37,7 @@ int setlinejoin → – === Description -link:/docs/commands/references/setlinejoin/[`setlinejoin`] sets the line join parameter to _int_, which must be 0, 1, or 2. This controls how corners are rendered when path segments meet at an angle during [`stroke`]. +link:/commands/references/setlinejoin/[`setlinejoin`] sets the line join parameter to _int_, which must be 0, 1, or 2. This controls how corners are rendered when path segments meet at an angle during [`stroke`]. **Join styles:** * **0** = Miter join: outer edges extended until they meet @@ -106,7 +106,7 @@ drawMechanicalParts === Common Pitfalls -WARNING: *Miter Limit* - Very sharp miters may be converted to bevels (see link:/docs/commands/references/setmiterlimit/[`setmiterlimit`]). +WARNING: *Miter Limit* - Very sharp miters may be converted to bevels (see link:/commands/references/setmiterlimit/[`setmiterlimit`]). [source,postscript] ---- @@ -164,7 +164,7 @@ Bevel (2): ╱─╲ === See Also -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Control miter join behavior -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line end style -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/currentlinejoin/[`currentlinejoin`] - Get current join \ No newline at end of file +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Control miter join behavior +* link:/commands/references/setlinecap/[`setlinecap`] - Set line end style +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/currentlinejoin/[`currentlinejoin`] - Get current join \ No newline at end of file diff --git a/docs/commands/references/setlinewidth.adoc b/docs/commands/references/setlinewidth.adoc index c706387..d59686a 100644 --- a/docs/commands/references/setlinewidth.adoc +++ b/docs/commands/references/setlinewidth.adoc @@ -37,7 +37,7 @@ num setlinewidth → – === Description -link:/docs/commands/references/setlinewidth/[`setlinewidth`] sets the line width parameter in the graphics state to _num_. This controls the thickness of lines rendered by subsequent [`stroke`] operations. +link:/commands/references/setlinewidth/[`setlinewidth`] sets the line width parameter in the graphics state to _num_. This controls the thickness of lines rendered by subsequent [`stroke`] operations. The line width is measured in user space units. The actual rendered width in device space depends on the current transformation matrix (CTM). @@ -179,8 +179,8 @@ Width 5: ▓▓▓▓▓▓▓▓▓ === See Also -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line end style -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set corner style -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern -* link:/docs/commands/references/currentlinewidth/[`currentlinewidth`] - Get current width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line end style +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set corner style +* link:/commands/references/setdash/[`setdash`] - Set dash pattern +* link:/commands/references/currentlinewidth/[`currentlinewidth`] - Get current width * Stroke operations (to be documented) \ No newline at end of file diff --git a/docs/commands/references/setmatrix.adoc b/docs/commands/references/setmatrix.adoc index 514e2b2..35f16b1 100644 --- a/docs/commands/references/setmatrix.adoc +++ b/docs/commands/references/setmatrix.adoc @@ -37,11 +37,11 @@ matrix setmatrix → - === Description -link:/docs/commands/references/setmatrix/[`setmatrix`] replaces the current transformation matrix (CTM) in the graphics state with the value of `matrix`. +link:/commands/references/setmatrix/[`setmatrix`] replaces the current transformation matrix (CTM) in the graphics state with the value of `matrix`. This establishes an arbitrary transformation from user space to device space without reference to the former CTM. The `matrix` operand must be a 6-element array of numbers representing a transformation matrix. -WARNING: Except in device setup procedures, use of link:/docs/commands/references/setmatrix/[`setmatrix`] should be very rare. PostScript programs should ordinarily modify the CTM using link:/docs/commands/references/translate/[`translate`], link:/docs/commands/references/scale/[`scale`], link:/docs/commands/references/rotate/[`rotate`], and link:/docs/commands/references/concat/[`concat`] rather than replace it. +WARNING: Except in device setup procedures, use of link:/commands/references/setmatrix/[`setmatrix`] should be very rare. PostScript programs should ordinarily modify the CTM using link:/commands/references/translate/[`translate`], link:/commands/references/scale/[`scale`], link:/commands/references/rotate/[`rotate`], and link:/commands/references/concat/[`concat`] rather than replace it. === PostScript Level @@ -114,7 +114,7 @@ myDeviceMatrix setmatrix === Common Pitfalls -WARNING: *Breaks Encapsulation* - link:/docs/commands/references/setmatrix/[`setmatrix`] can break assumptions about coordinate system. +WARNING: *Breaks Encapsulation* - link:/commands/references/setmatrix/[`setmatrix`] can break assumptions about coordinate system. [source,postscript] ---- @@ -153,7 +153,7 @@ grestore % Transformation undone - setmatrix changes are saved/restored ---- -TIP: *Prefer Transform Operators* - Use transformation operators instead of link:/docs/commands/references/setmatrix/[`setmatrix`]: +TIP: *Prefer Transform Operators* - Use transformation operators instead of link:/commands/references/setmatrix/[`setmatrix`]: [source,postscript] ---- @@ -197,7 +197,7 @@ saved setmatrix % Restore * Very large or very small matrix values may cause precision issues * Degenerate matrices (determinant = 0) create non-invertible transformations * The matrix operand is not modified -* Unlike link:/docs/commands/references/concat/[`concat`], link:/docs/commands/references/setmatrix/[`setmatrix`] completely replaces the CTM +* Unlike link:/commands/references/concat/[`concat`], link:/commands/references/setmatrix/[`setmatrix`] completely replaces the CTM === Matrix Format @@ -218,10 +218,10 @@ Where: In well-structured PostScript programs: -1. **Initialization**: Device setup uses link:/docs/commands/references/initmatrix/[`initmatrix`] -2. **Modifications**: Use link:/docs/commands/references/translate/[`translate`], link:/docs/commands/references/scale/[`scale`], link:/docs/commands/references/rotate/[`rotate`], link:/docs/commands/references/concat/[`concat`] -3. **State Management**: Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] -4. **Restoration**: Use link:/docs/commands/references/grestore/[`grestore`] or saved matrix with link:/docs/commands/references/setmatrix/[`setmatrix`] +1. **Initialization**: Device setup uses link:/commands/references/initmatrix/[`initmatrix`] +2. **Modifications**: Use link:/commands/references/translate/[`translate`], link:/commands/references/scale/[`scale`], link:/commands/references/rotate/[`rotate`], link:/commands/references/concat/[`concat`] +3. **State Management**: Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] +4. **Restoration**: Use link:/commands/references/grestore/[`grestore`] or saved matrix with link:/commands/references/setmatrix/[`setmatrix`] === Comparison with Other Operators @@ -245,16 +245,16 @@ matrix currentmatrix % Assume [1 0 0 1 0 0] * Very fast operation * No matrix computation required * Just replaces 6 values in graphics state -* No different in performance from link:/docs/commands/references/concat/[`concat`] +* No different in performance from link:/commands/references/concat/[`concat`] === See Also -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default -* link:/docs/commands/references/concat/[`concat`] - Concatenate matrix with CTM -* link:/docs/commands/references/translate/[`translate`] - Move origin -* link:/docs/commands/references/scale/[`scale`] - Change unit size -* link:/docs/commands/references/rotate/[`rotate`] - Rotate axes -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default +* link:/commands/references/concat/[`concat`] - Concatenate matrix with CTM +* link:/commands/references/translate/[`translate`] - Move origin +* link:/commands/references/scale/[`scale`] - Change unit size +* link:/commands/references/rotate/[`rotate`] - Rotate axes +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/setmiterlimit.adoc b/docs/commands/references/setmiterlimit.adoc index fb3b64b..037153c 100644 --- a/docs/commands/references/setmiterlimit.adoc +++ b/docs/commands/references/setmiterlimit.adoc @@ -37,7 +37,7 @@ num setmiterlimit → – === Description -link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] sets the miter limit parameter in the graphics state to _num_. This parameter controls when sharp miter joins are converted to bevel joins during stroking operations. +link:/commands/references/setmiterlimit/[`setmiterlimit`] sets the miter limit parameter in the graphics state to _num_. This parameter controls when sharp miter joins are converted to bevel joins during stroking operations. The miter limit is the **maximum ratio** of miter length to line width. When the ratio exceeds this limit (at very sharp angles), a bevel join is used instead of a miter join. @@ -276,7 +276,7 @@ Else: === See Also -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join style -* link:/docs/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get current miter limit -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap style +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join style +* link:/commands/references/currentmiterlimit/[`currentmiterlimit`] - Get current miter limit +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap style diff --git a/docs/commands/references/setrgbcolor.adoc b/docs/commands/references/setrgbcolor.adoc index 298014e..2aadb8a 100644 --- a/docs/commands/references/setrgbcolor.adoc +++ b/docs/commands/references/setrgbcolor.adoc @@ -43,7 +43,7 @@ red green blue setrgbcolor → – === Description -link:/docs/commands/references/setrgbcolor/[`setrgbcolor`] sets the color space to DeviceRGB and sets the current color using red, green, and blue components. +link:/commands/references/setrgbcolor/[`setrgbcolor`] sets the color space to DeviceRGB and sets the current color using red, green, and blue components. Each component must be in range 0.0 to 1.0: * **0.0** = none of that color @@ -177,7 +177,7 @@ R + G + B = White === See Also -* link:/docs/commands/references/setgray/[`setgray`] - Set grayscale -* link:/docs/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK (Level 2) -* link:/docs/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB -* link:/docs/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color \ No newline at end of file +* link:/commands/references/setgray/[`setgray`] - Set grayscale +* link:/commands/references/setcmykcolor/[`setcmykcolor`] - Set CMYK (Level 2) +* link:/commands/references/sethsbcolor/[`sethsbcolor`] - Set HSB +* link:/commands/references/currentrgbcolor/[`currentrgbcolor`] - Get RGB color \ No newline at end of file diff --git a/docs/commands/references/show.adoc b/docs/commands/references/show.adoc index 3038a07..d3353ae 100644 --- a/docs/commands/references/show.adoc +++ b/docs/commands/references/show.adoc @@ -29,11 +29,11 @@ string === Description -link:/docs/commands/references/show/[`show`] paints the characters identified by the elements of `string` on the current page starting at the current point, using the font face, size, and orientation specified by the most recent link:/docs/commands/references/setfont/[`setfont`] or `selectfont`. +link:/commands/references/show/[`show`] paints the characters identified by the elements of `string` on the current page starting at the current point, using the font face, size, and orientation specified by the most recent link:/commands/references/setfont/[`setfont`] or `selectfont`. -The spacing from each character of the string to the next is determined by the character's width, which is an (x, y) displacement that is part of the character's definition. When it is finished, link:/docs/commands/references/show/[`show`] adjusts the current point in the graphics state by the sum of the widths of all the characters shown. +The spacing from each character of the string to the next is determined by the character's width, which is an (x, y) displacement that is part of the character's definition. When it is finished, link:/commands/references/show/[`show`] adjusts the current point in the graphics state by the sum of the widths of all the characters shown. -link:/docs/commands/references/show/[`show`] requires that the current point initially be defined (for example, by `moveto`); otherwise, it executes the error `nocurrentpoint`. +link:/commands/references/show/[`show`] requires that the current point initially be defined (for example, by `moveto`); otherwise, it executes the error `nocurrentpoint`. If a character code would index beyond the end of the font's Encoding, or the character mapping algorithm goes out of bounds in other ways, a `rangecheck` error occurs. @@ -198,10 +198,10 @@ grestore === Performance Considerations -- link:/docs/commands/references/show/[`show`] is the fastest text rendering operator +- link:/commands/references/show/[`show`] is the fastest text rendering operator - Characters are cached for efficiency - Font cache improves performance for repeated characters -- Use link:/docs/commands/references/show/[`show`] over link:/docs/commands/references/charpath/[`charpath`] when possible +- Use link:/commands/references/show/[`show`] over link:/commands/references/charpath/[`charpath`] when possible === Comparison with Other Text Operators @@ -209,36 +209,36 @@ grestore |=== | Operator | Purpose -| link:/docs/commands/references/show/[`show`] +| link:/commands/references/show/[`show`] | Basic text painting (fastest) -| link:/docs/commands/references/ashow/[`ashow`] +| link:/commands/references/ashow/[`ashow`] | Add uniform spacing to all characters -| link:/docs/commands/references/widthshow/[`widthshow`] +| link:/commands/references/widthshow/[`widthshow`] | Adjust width of specific character -| link:/docs/commands/references/awidthshow/[`awidthshow`] -| Combine link:/docs/commands/references/ashow/[`ashow`] and link:/docs/commands/references/widthshow/[`widthshow`] +| link:/commands/references/awidthshow/[`awidthshow`] +| Combine link:/commands/references/ashow/[`ashow`] and link:/commands/references/widthshow/[`widthshow`] -| link:/docs/commands/references/kshow/[`kshow`] +| link:/commands/references/kshow/[`kshow`] | Execute procedure between characters (kerning) -| link:/docs/commands/references/cshow/[`cshow`] +| link:/commands/references/cshow/[`cshow`] | Execute procedure for each character (Level 2) -| link:/docs/commands/references/charpath/[`charpath`] +| link:/commands/references/charpath/[`charpath`] | Get character outlines as path |=== === See Also -- link:/docs/commands/references/ashow/[`ashow`] - Show with character spacing adjustment -- link:/docs/commands/references/widthshow/[`widthshow`] - Show with selective character width adjustment -- link:/docs/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow -- link:/docs/commands/references/kshow/[`kshow`] - Show with kerning procedure -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character (Level 2) -- link:/docs/commands/references/charpath/[`charpath`] - Get character outlines as path -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/ashow/[`ashow`] - Show with character spacing adjustment +- link:/commands/references/widthshow/[`widthshow`] - Show with selective character width adjustment +- link:/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow +- link:/commands/references/kshow/[`kshow`] - Show with kerning procedure +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character (Level 2) +- link:/commands/references/charpath/[`charpath`] - Get character outlines as path +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width +- link:/commands/references/setfont/[`setfont`] - Establish current font - `moveto` - Set current point \ No newline at end of file diff --git a/docs/commands/references/sin.adoc b/docs/commands/references/sin.adoc index 58f1238..6cb96e9 100644 --- a/docs/commands/references/sin.adoc +++ b/docs/commands/references/sin.adoc @@ -67,8 +67,8 @@ WARNING: PostScript uses *degrees*, not radians! == Related Commands -* link:/docs/commands/references/cos/[`cos`] - Cosine (degrees) -* link:/docs/commands/references/atan/[`atan`] - Arctangent (returns degrees) +* link:/commands/references/cos/[`cos`] - Cosine (degrees) +* link:/commands/references/atan/[`atan`] - Arctangent (returns degrees) == PostScript Level @@ -84,4 +84,4 @@ The operand is not a number. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/sqrt.adoc b/docs/commands/references/sqrt.adoc index d370985..2897837 100644 --- a/docs/commands/references/sqrt.adoc +++ b/docs/commands/references/sqrt.adoc @@ -178,8 +178,8 @@ WARNING: Negative arguments cause `rangecheck` error. == Related Commands -* link:/docs/commands/references/exp/[`exp`] - Exponentiation -* link:/docs/commands/references/mul/[`mul`] - Multiplication +* link:/commands/references/exp/[`exp`] - Exponentiation +* link:/commands/references/mul/[`mul`] - Multiplication == PostScript Level @@ -203,4 +203,4 @@ The operand is negative. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/srand.adoc b/docs/commands/references/srand.adoc index 5c0c55b..e2c3699 100644 --- a/docs/commands/references/srand.adoc +++ b/docs/commands/references/srand.adoc @@ -10,7 +10,7 @@ Seeds the random number generator with a specific value. == Description -The `srand` operator pops an integer from the operand stack and uses it to initialize (seed) the random number generator. Executing `srand` with a particular seed value causes subsequent calls to link:/docs/commands/references/rand/[`rand`] to generate a reproducible, deterministic sequence of pseudo-random numbers. +The `srand` operator pops an integer from the operand stack and uses it to initialize (seed) the random number generator. Executing `srand` with a particular seed value causes subsequent calls to link:/commands/references/rand/[`rand`] to generate a reproducible, deterministic sequence of pseudo-random numbers. This is a Level 1 operator, available in all PostScript implementations. @@ -91,8 +91,8 @@ rand % Different each run == Related Commands -* link:/docs/commands/references/rand/[`rand`] - Generate random integer -* link:/docs/commands/references/rrand/[`rrand`] - Get/set random seed +* link:/commands/references/rand/[`rand`] - Generate random integer +* link:/commands/references/rrand/[`rrand`] - Get/set random seed == PostScript Level @@ -120,4 +120,4 @@ The operand is not an integer. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/stop.adoc b/docs/commands/references/stop.adoc index 44317b1..8540a71 100644 --- a/docs/commands/references/stop.adoc +++ b/docs/commands/references/stop.adoc @@ -28,12 +28,12 @@ Terminates execution of the innermost stopped context. === Description -link:/docs/commands/references/stop/[`stop`] terminates execution of the innermost, dynamically enclosing instance of a link:/docs/commands/references/stopped/[`stopped`] context, without regard to lexical relationship. +link:/commands/references/stop/[`stop`] terminates execution of the innermost, dynamically enclosing instance of a link:/commands/references/stopped/[`stopped`] context, without regard to lexical relationship. -When link:/docs/commands/references/stop/[`stop`] executes: -1. Pops execution stack down to the link:/docs/commands/references/stopped/[`stopped`] operator level +When link:/commands/references/stop/[`stop`] executes: +1. Pops execution stack down to the link:/commands/references/stopped/[`stopped`] operator level 2. Pushes `true` on the operand stack -3. Resumes execution after the link:/docs/commands/references/stopped/[`stopped`] operator +3. Resumes execution after the link:/commands/references/stopped/[`stopped`] operator The operand and dictionary stacks are not affected - any objects pushed during stopped context execution remain. @@ -132,7 +132,7 @@ The operand and dictionary stacks are not affected - any objects pushed during s === Common Pitfalls -WARNING: *Requires stopped Context* - Without enclosing link:/docs/commands/references/stopped/[`stopped`], prints error and calls link:/docs/commands/references/quit/[`quit`]. +WARNING: *Requires stopped Context* - Without enclosing link:/commands/references/stopped/[`stopped`], prints error and calls link:/commands/references/quit/[`quit`]. [source,postscript] ---- @@ -193,7 +193,7 @@ TIP: *Use for Error Signaling* - Preferred way to signal errors in custom operat === See Also -* link:/docs/commands/references/stopped/[`stopped`] - Create stopped context -* link:/docs/commands/references/exit/[`exit`] - Exit loop -* link:/docs/commands/references/quit/[`quit`] - Terminate interpreter +* link:/commands/references/stopped/[`stopped`] - Create stopped context +* link:/commands/references/exit/[`exit`] - Exit loop +* link:/commands/references/quit/[`quit`] - Terminate interpreter * Error Handling (to be documented) \ No newline at end of file diff --git a/docs/commands/references/stopped.adoc b/docs/commands/references/stopped.adoc index 57ea596..9ff5107 100644 --- a/docs/commands/references/stopped.adoc +++ b/docs/commands/references/stopped.adoc @@ -52,12 +52,12 @@ any stopped → bool === Description -link:/docs/commands/references/stopped/[`stopped`] executes _any_ (typically a procedure). +link:/commands/references/stopped/[`stopped`] executes _any_ (typically a procedure). * If _any_ runs to completion normally: returns `false` -* If _any_ terminates via link:/docs/commands/references/stop/[`stop`]: returns `true` +* If _any_ terminates via link:/commands/references/stop/[`stop`]: returns `true` -Regardless of outcome, execution resumes at the next object after link:/docs/commands/references/stopped/[`stopped`]. +Regardless of outcome, execution resumes at the next object after link:/commands/references/stopped/[`stopped`]. This provides PostScript's primary error-catching mechanism. @@ -149,7 +149,7 @@ file closefile % Always close === Common Pitfalls -WARNING: *Catches All Errors* - link:/docs/commands/references/stopped/[`stopped`] catches ALL errors, including those you might not expect. +WARNING: *Catches All Errors* - link:/commands/references/stopped/[`stopped`] catches ALL errors, including those you might not expect. [source,postscript] ---- @@ -194,7 +194,7 @@ TIP: *Standard Error Pattern* - Default PostScript error handlers use this patte === Standard Error Handler -The default error handler uses link:/docs/commands/references/stopped/[`stopped`]: +The default error handler uses link:/commands/references/stopped/[`stopped`]: [source,postscript] ---- @@ -231,7 +231,7 @@ The default error handler uses link:/docs/commands/references/stopped/[`stopped` === See Also -* link:/docs/commands/references/stop/[`stop`] - Terminate stopped context -* link:/docs/commands/references/exit/[`exit`] - Exit loop -* link:/docs/commands/references/exec/[`exec`] - Execute object +* link:/commands/references/stop/[`stop`] - Terminate stopped context +* link:/commands/references/exit/[`exit`] - Exit loop +* link:/commands/references/exec/[`exec`] - Execute object * Error Handling (to be documented) \ No newline at end of file diff --git a/docs/commands/references/store.adoc b/docs/commands/references/store.adoc index fa49ce1..75c1abd 100644 --- a/docs/commands/references/store.adoc +++ b/docs/commands/references/store.adoc @@ -40,12 +40,12 @@ key value store → – === Description -link:/docs/commands/references/store/[`store`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. +link:/commands/references/store/[`store`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. * If found: replaces the value in that dictionary * If not found: creates new entry in current dictionary -This differs from link:/docs/commands/references/def/[`def`], which always uses the current dictionary. +This differs from link:/commands/references/def/[`def`], which always uses the current dictionary. === PostScript Level @@ -105,7 +105,7 @@ end === Common Pitfalls -WARNING: *Searches Dictionary Stack* - link:/docs/commands/references/store/[`store`] may modify a dictionary other than the current one! +WARNING: *Searches Dictionary Stack* - link:/commands/references/store/[`store`] may modify a dictionary other than the current one! [source,postscript] ---- @@ -116,11 +116,11 @@ WARNING: *Searches Dictionary Stack* - link:/docs/commands/references/store/[`st end ---- -WARNING: *Global/Local VM Restrictions* - Same VM rules as link:/docs/commands/references/def/[`def`] apply. +WARNING: *Global/Local VM Restrictions* - Same VM rules as link:/commands/references/def/[`def`] apply. -TIP: *Use def for New Definitions* - Use link:/docs/commands/references/def/[`def`] when you want to ensure definition goes in current dictionary. +TIP: *Use def for New Definitions* - Use link:/commands/references/def/[`def`] when you want to ensure definition goes in current dictionary. -TIP: *Use store for Updates* - Use link:/docs/commands/references/store/[`store`] when you want to update an existing definition regardless of where it is. +TIP: *Use store for Updates* - Use link:/commands/references/store/[`store`] when you want to update an existing definition regardless of where it is. === Error Conditions @@ -152,7 +152,7 @@ TIP: *Use store for Updates* - Use link:/docs/commands/references/store/[`store` [cols="2,3,3"] |=== -| Aspect | link:/docs/commands/references/def/[`def`] | link:/docs/commands/references/store/[`store`] +| Aspect | link:/commands/references/def/[`def`] | link:/commands/references/store/[`store`] | Target | Always current dictionary @@ -173,7 +173,7 @@ TIP: *Use store for Updates* - Use link:/docs/commands/references/store/[`store` === See Also -* link:/docs/commands/references/def/[`def`] - Define in current dictionary -* link:/docs/commands/references/load/[`load`] - Load from dictionary stack -* link:/docs/commands/references/where/[`where`] - Find which dictionary contains key -* link:/docs/commands/references/put/[`put`] - Put into specific dictionary \ No newline at end of file +* link:/commands/references/def/[`def`] - Define in current dictionary +* link:/commands/references/load/[`load`] - Load from dictionary stack +* link:/commands/references/where/[`where`] - Find which dictionary contains key +* link:/commands/references/put/[`put`] - Put into specific dictionary \ No newline at end of file diff --git a/docs/commands/references/string.adoc b/docs/commands/references/string.adoc index 11faa92..23d5ed9 100644 --- a/docs/commands/references/string.adoc +++ b/docs/commands/references/string.adoc @@ -37,7 +37,7 @@ int string → string === Description -link:/docs/commands/references/string/[`string`] creates a string object of length _int_, with each element initialized to the integer 0 (null character). The string is allocated in local or global VM according to the current VM allocation mode. +link:/commands/references/string/[`string`] creates a string object of length _int_, with each element initialized to the integer 0 (null character). The string is allocated in local or global VM according to the current VM allocation mode. The _int_ operand must be: * A non-negative integer @@ -110,7 +110,7 @@ WARNING: *All Elements Initialized to Zero* - The string contains null character 5 string % Not empty, contains 5 null chars ---- -WARNING: *String Literals vs. string Operator* - For known text, use string literals `(...)`. Use link:/docs/commands/references/string/[`string`] for dynamic buffers. +WARNING: *String Literals vs. string Operator* - For known text, use string literals `(...)`. Use link:/commands/references/string/[`string`] for dynamic buffers. [source,postscript] ---- @@ -118,7 +118,7 @@ WARNING: *String Literals vs. string Operator* - For known text, use string lite 5 string % Dynamic allocation (for buffers) ---- -TIP: *Calculate Size Dynamically* - Use link:/docs/commands/references/length/[`length`] to determine buffer sizes. +TIP: *Calculate Size Dynamically* - Use link:/commands/references/length/[`length`] to determine buffer sizes. [source,postscript] ---- @@ -163,9 +163,9 @@ original length string % Same size as original === See Also -* link:/docs/commands/references/length/[`length`] - Get string length -* link:/docs/commands/references/get/[`get`] - Get character code -* link:/docs/commands/references/put/[`put`] - Put character code -* link:/docs/commands/references/getinterval/[`getinterval`] - Get substring -* link:/docs/commands/references/putinterval/[`putinterval`] - Put substring -* link:/docs/commands/references/cvs/[`cvs`] - Convert object to string \ No newline at end of file +* link:/commands/references/length/[`length`] - Get string length +* link:/commands/references/get/[`get`] - Get character code +* link:/commands/references/put/[`put`] - Put character code +* link:/commands/references/getinterval/[`getinterval`] - Get substring +* link:/commands/references/putinterval/[`putinterval`] - Put substring +* link:/commands/references/cvs/[`cvs`] - Convert object to string \ No newline at end of file diff --git a/docs/commands/references/stringwidth.adoc b/docs/commands/references/stringwidth.adoc index f94936f..d6d98f3 100644 --- a/docs/commands/references/stringwidth.adoc +++ b/docs/commands/references/stringwidth.adoc @@ -29,13 +29,13 @@ wx wy === Description -link:/docs/commands/references/stringwidth/[`stringwidth`] calculates the change in the current point that would occur if `string` were given as the operand to link:/docs/commands/references/show/[`show`] with the current font. `wx` and `wy` are computed by adding together the width vectors of all the individual characters in `string` and converting the result to user space. +link:/commands/references/stringwidth/[`stringwidth`] calculates the change in the current point that would occur if `string` were given as the operand to link:/commands/references/show/[`show`] with the current font. `wx` and `wy` are computed by adding together the width vectors of all the individual characters in `string` and converting the result to user space. -They form a distance vector in x and y describing the width of the entire string in user space. To obtain the character widths, link:/docs/commands/references/stringwidth/[`stringwidth`] may execute the descriptions of one or more of the characters in the current font and may cause the results to be placed in the font cache. +They form a distance vector in x and y describing the width of the entire string in user space. To obtain the character widths, link:/commands/references/stringwidth/[`stringwidth`] may execute the descriptions of one or more of the characters in the current font and may cause the results to be placed in the font cache. -However, link:/docs/commands/references/stringwidth/[`stringwidth`] prevents the graphics operators that are executed from painting anything into the current page. +However, link:/commands/references/stringwidth/[`stringwidth`] prevents the graphics operators that are executed from painting anything into the current page. -Note that the "width" of a string is defined as movement of the current point. It has nothing to do with the dimensions of the character outlines (see link:/docs/commands/references/charpath/[`charpath`]) and `pathbbox`. +Note that the "width" of a string is defined as movement of the current point. It has nothing to do with the dimensions of the character outlines (see link:/commands/references/charpath/[`charpath`]) and `pathbbox`. === Parameters @@ -268,7 +268,7 @@ pop exch pop sub % e.g., 115 units (tighter) === Performance Considerations -- Fast operation (similar cost to link:/docs/commands/references/show/[`show`]) +- Fast operation (similar cost to link:/commands/references/show/[`show`]) - May trigger character caching - Does not paint (no output overhead) - Can be called repeatedly without side effects @@ -289,9 +289,9 @@ For vertical writing fonts, `wy` may be non-zero: === See Also -- link:/docs/commands/references/show/[`show`] - Paint text string -- link:/docs/commands/references/charpath/[`charpath`] - Get character outlines as path +- link:/commands/references/show/[`show`] - Paint text string +- link:/commands/references/charpath/[`charpath`] - Get character outlines as path - `pathbbox` - Get path bounding box -- link:/docs/commands/references/setfont/[`setfont`] - Establish current font -- link:/docs/commands/references/ashow/[`ashow`] - Show with spacing adjustment -- link:/docs/commands/references/widthshow/[`widthshow`] - Show with selective adjustment \ No newline at end of file +- link:/commands/references/setfont/[`setfont`] - Establish current font +- link:/commands/references/ashow/[`ashow`] - Show with spacing adjustment +- link:/commands/references/widthshow/[`widthshow`] - Show with selective adjustment \ No newline at end of file diff --git a/docs/commands/references/stroke.adoc b/docs/commands/references/stroke.adoc index 2f86d07..ce8afcb 100644 --- a/docs/commands/references/stroke.adoc +++ b/docs/commands/references/stroke.adoc @@ -37,13 +37,13 @@ Paints a line following the current path using current line parameters. === Description -link:/docs/commands/references/stroke/[`stroke`] paints a line following the current path using the current color. This line is centered on the path, has sides parallel to the path segments, and has a width (thickness) given by the current line width parameter in the graphics state. +link:/commands/references/stroke/[`stroke`] paints a line following the current path using the current color. This line is centered on the path, has sides parallel to the path segments, and has a width (thickness) given by the current line width parameter in the graphics state. -link:/docs/commands/references/stroke/[`stroke`] paints the joints between connected path segments with the current line join and the ends of open subpaths with the current line cap. The line is either solid or broken according to the dash pattern established by link:/docs/commands/references/setdash/[`setdash`]. +link:/commands/references/stroke/[`stroke`] paints the joints between connected path segments with the current line join and the ends of open subpaths with the current line cap. The line is either solid or broken according to the dash pattern established by link:/commands/references/setdash/[`setdash`]. -The parameters in the graphics state controlling line rendition (line width, line join, line cap, dash pattern, etc.) are consulted at the time link:/docs/commands/references/stroke/[`stroke`] is executed. Their values during path construction are irrelevant. +The parameters in the graphics state controlling line rendition (line width, line join, line cap, dash pattern, etc.) are consulted at the time link:/commands/references/stroke/[`stroke`] is executed. Their values during path construction are irrelevant. -link:/docs/commands/references/stroke/[`stroke`] implicitly performs a link:/docs/commands/references/newpath/[`newpath`] after it has finished painting the current path. +link:/commands/references/stroke/[`stroke`] implicitly performs a link:/commands/references/newpath/[`newpath`] after it has finished painting the current path. === PostScript Level @@ -171,7 +171,7 @@ stroke === Common Pitfalls -WARNING: *Path Consumed After Stroke* - link:/docs/commands/references/stroke/[`stroke`] clears the current path. Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] to preserve it. +WARNING: *Path Consumed After Stroke* - link:/commands/references/stroke/[`stroke`] clears the current path. Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] to preserve it. [source,postscript] ---- @@ -256,13 +256,13 @@ stroke === Graphics State Parameters -link:/docs/commands/references/stroke/[`stroke`] is affected by: +link:/commands/references/stroke/[`stroke`] is affected by: -* **Line width** - Set by link:/docs/commands/references/setlinewidth/[`setlinewidth`] -* **Line cap** - Set by link:/docs/commands/references/setlinecap/[`setlinecap`] (0=butt, 1=round, 2=square) -* **Line join** - Set by link:/docs/commands/references/setlinejoin/[`setlinejoin`] (0=miter, 1=round, 2=bevel) -* **Miter limit** - Set by link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] -* **Dash pattern** - Set by link:/docs/commands/references/setdash/[`setdash`] +* **Line width** - Set by link:/commands/references/setlinewidth/[`setlinewidth`] +* **Line cap** - Set by link:/commands/references/setlinecap/[`setlinecap`] (0=butt, 1=round, 2=square) +* **Line join** - Set by link:/commands/references/setlinejoin/[`setlinejoin`] (0=miter, 1=round, 2=bevel) +* **Miter limit** - Set by link:/commands/references/setmiterlimit/[`setmiterlimit`] +* **Dash pattern** - Set by link:/commands/references/setdash/[`setdash`] * **Stroke adjustment** - Set by `setstrokeadjust` (Level 2) * **Current color** - Set by color operators * **Current transformation matrix (CTM)** - Affects line width and dash pattern @@ -403,15 +403,15 @@ stroke === See Also -* link:/docs/commands/references/fill/[`fill`] - Fill path interior -* link:/docs/commands/references/strokepath/[`strokepath`] - Convert stroke to outline path -* link:/docs/commands/references/ustroke/[`ustroke`] - Stroke user path (Level 2) -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap style -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join style -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern +* link:/commands/references/fill/[`fill`] - Fill path interior +* link:/commands/references/strokepath/[`strokepath`] - Convert stroke to outline path +* link:/commands/references/ustroke/[`ustroke`] - Stroke user path (Level 2) +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap style +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join style +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit +* link:/commands/references/setdash/[`setdash`] - Set dash pattern * `setstrokeadjust` - Enable stroke adjustment (Level 2) -* link:/docs/commands/references/newpath/[`newpath`] - Clear current path -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/newpath/[`newpath`] - Clear current path +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/strokepath.adoc b/docs/commands/references/strokepath.adoc index ef8c9f6..d62f062 100644 --- a/docs/commands/references/strokepath.adoc +++ b/docs/commands/references/strokepath.adoc @@ -37,11 +37,11 @@ Converts the stroke of the current path to an outline path. === Description -link:/docs/commands/references/strokepath/[`strokepath`] replaces the current path with one enclosing the shape that would result if the link:/docs/commands/references/stroke/[`stroke`] operator were applied to the current path. The path resulting from link:/docs/commands/references/strokepath/[`strokepath`] is suitable as the implicit operand to link:/docs/commands/references/fill/[`fill`], link:/docs/commands/references/clip/[`clip`], or `pathbbox`. +link:/commands/references/strokepath/[`strokepath`] replaces the current path with one enclosing the shape that would result if the link:/commands/references/stroke/[`stroke`] operator were applied to the current path. The path resulting from link:/commands/references/strokepath/[`strokepath`] is suitable as the implicit operand to link:/commands/references/fill/[`fill`], link:/commands/references/clip/[`clip`], or `pathbbox`. -In general, this path is not suitable for link:/docs/commands/references/stroke/[`stroke`], as it may contain interior segments or disconnected subpaths produced by link:/docs/commands/references/strokepath/[`strokepath`]'s stroke-to-outline conversion process. +In general, this path is not suitable for link:/commands/references/stroke/[`stroke`], as it may contain interior segments or disconnected subpaths produced by link:/commands/references/strokepath/[`strokepath`]'s stroke-to-outline conversion process. -link:/docs/commands/references/strokepath/[`strokepath`] uses the current line width, line cap, line join, miter limit, and dash pattern to determine the outline. Unlike link:/docs/commands/references/stroke/[`stroke`], link:/docs/commands/references/strokepath/[`strokepath`] does not consume the path—it modifies it in place. +link:/commands/references/strokepath/[`strokepath`] uses the current line width, line cap, line join, miter limit, and dash pattern to determine the outline. Unlike link:/commands/references/stroke/[`stroke`], link:/commands/references/strokepath/[`strokepath`] does not consume the path—it modifies it in place. === PostScript Level @@ -183,7 +183,7 @@ stroke % May show interior segments fill % Correct usage ---- -WARNING: *Path Not Consumed* - Unlike link:/docs/commands/references/stroke/[`stroke`], link:/docs/commands/references/strokepath/[`strokepath`] modifies the path in place. +WARNING: *Path Not Consumed* - Unlike link:/commands/references/stroke/[`stroke`], link:/commands/references/strokepath/[`strokepath`] modifies the path in place. [source,postscript] ---- @@ -214,7 +214,7 @@ newpath strokepath % Outline includes all effects ---- -TIP: *Use for Path Inspection* - link:/docs/commands/references/strokepath/[`strokepath`] makes the stroke boundary explicit: +TIP: *Use for Path Inspection* - link:/commands/references/strokepath/[`strokepath`] makes the stroke boundary explicit: [source,postscript] ---- @@ -352,7 +352,7 @@ newpath === Performance Considerations -* More complex than simple link:/docs/commands/references/stroke/[`stroke`] +* More complex than simple link:/commands/references/stroke/[`stroke`] * Dash patterns significantly increase complexity * Round caps/joins create more path segments than butt/miter * Very wide lines create large outlines @@ -403,14 +403,14 @@ fill === See Also -* link:/docs/commands/references/stroke/[`stroke`] - Paint stroke directly -* link:/docs/commands/references/fill/[`fill`] - Fill path interior -* link:/docs/commands/references/clip/[`clip`] - Use path for clipping -* link:/docs/commands/references/ustrokepath/[`ustrokepath`] - Stroke path for user path (Level 2) +* link:/commands/references/stroke/[`stroke`] - Paint stroke directly +* link:/commands/references/fill/[`fill`] - Fill path interior +* link:/commands/references/clip/[`clip`] - Use path for clipping +* link:/commands/references/ustrokepath/[`ustrokepath`] - Stroke path for user path (Level 2) * `pathbbox` - Get path bounding box * `flattenpath` - Convert curves to lines -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap style -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join style -* link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern \ No newline at end of file +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap style +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join style +* link:/commands/references/setmiterlimit/[`setmiterlimit`] - Set miter limit +* link:/commands/references/setdash/[`setdash`] - Set dash pattern \ No newline at end of file diff --git a/docs/commands/references/sub.adoc b/docs/commands/references/sub.adoc index ba73fe4..6a70ecd 100644 --- a/docs/commands/references/sub.adoc +++ b/docs/commands/references/sub.adoc @@ -227,11 +227,11 @@ Both operands must be numeric (integer or real). Other types will cause a `typec == Related Commands -* link:/docs/commands/references/add/[`add`] - Add two numbers -* link:/docs/commands/references/mul/[`mul`] - Multiply two numbers -* link:/docs/commands/references/div/[`div`] - Divide two numbers (real result) -* link:/docs/commands/references/neg/[`neg`] - Negate a number -* link:/docs/commands/references/abs/[`abs`] - Absolute value +* link:/commands/references/add/[`add`] - Add two numbers +* link:/commands/references/mul/[`mul`] - Multiply two numbers +* link:/commands/references/div/[`div`] - Divide two numbers (real result) +* link:/commands/references/neg/[`neg`] - Negate a number +* link:/commands/references/abs/[`abs`] - Absolute value == PostScript Level @@ -291,5 +291,5 @@ The `sub` operator is a primitive operation with O(1) constant time complexity. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators -* link:/docs/levels/[PostScript Language Levels] \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators +* link:/levels/[PostScript Language Levels] \ No newline at end of file diff --git a/docs/commands/references/token.adoc b/docs/commands/references/token.adoc index a69f419..21c8977 100644 --- a/docs/commands/references/token.adoc +++ b/docs/commands/references/token.adoc @@ -67,7 +67,7 @@ string token → post any true (if token found) === Description -link:/docs/commands/references/token/[`token`] reads characters from _file_ or _string_, interpreting them according to PostScript syntax rules until a complete object is scanned. +link:/commands/references/token/[`token`] reads characters from _file_ or _string_, interpreting them according to PostScript syntax rules until a complete object is scanned. **File case:** * Returns the scanned object and `true` if successful @@ -154,7 +154,7 @@ line token { === Common Pitfalls -WARNING: *Consumes Whitespace* - link:/docs/commands/references/token/[`token`] consumes trailing whitespace after names/numbers. +WARNING: *Consumes Whitespace* - link:/commands/references/token/[`token`] consumes trailing whitespace after names/numbers. [source,postscript] ---- @@ -172,7 +172,7 @@ WARNING: *Evaluates Syntax* - Returns actual objects, not string representations WARNING: *Special Character Handling* - Different characters consumed differently after tokens. -TIP: *Binary Token Support* - link:/docs/commands/references/token/[`token`] also handles binary tokens and binary object sequences. +TIP: *Binary Token Support* - link:/commands/references/token/[`token`] also handles binary tokens and binary object sequences. === Error Conditions @@ -210,7 +210,7 @@ TIP: *Binary Token Support* - link:/docs/commands/references/token/[`token`] als === Token Consumption Rules -link:/docs/commands/references/token/[`token`] consumes characters differently based on token type: +link:/commands/references/token/[`token`] consumes characters differently based on token type: [cols="2,3"] |=== @@ -238,7 +238,7 @@ link:/docs/commands/references/token/[`token`] consumes characters differently b === Implementation Notes * Same parsing logic as the PostScript interpreter -* Returns literal objects (use link:/docs/commands/references/cvx/[`cvx`]) if execution needed +* Returns literal objects (use link:/commands/references/cvx/[`cvx`]) if execution needed * File position updated past consumed characters * For strings, _post_ points into original string (shared value) @@ -261,8 +261,8 @@ link:/docs/commands/references/token/[`token`] consumes characters differently b === See Also -* link:/docs/commands/references/search/[`search`] - Find substring -* link:/docs/commands/references/anchorsearch/[`anchorsearch`] - Test for prefix -* link:/docs/commands/references/cvs/[`cvs`] - Convert to string -* link:/docs/commands/references/cvn/[`cvn`] - Convert to name -* link:/docs/commands/references/cvx/[`cvx`] - Make executable \ No newline at end of file +* link:/commands/references/search/[`search`] - Find substring +* link:/commands/references/anchorsearch/[`anchorsearch`] - Test for prefix +* link:/commands/references/cvs/[`cvs`] - Convert to string +* link:/commands/references/cvn/[`cvn`] - Convert to name +* link:/commands/references/cvx/[`cvx`] - Make executable \ No newline at end of file diff --git a/docs/commands/references/transform.adoc b/docs/commands/references/transform.adoc index f7aec17..a5eaecf 100644 --- a/docs/commands/references/transform.adoc +++ b/docs/commands/references/transform.adoc @@ -44,9 +44,9 @@ x y matrix transform → x' y' === Description -With no matrix operand, link:/docs/commands/references/transform/[`transform`] transforms the user space coordinate (x, y) by the current transformation matrix (CTM) to produce the corresponding device space coordinate (x', y'). +With no matrix operand, link:/commands/references/transform/[`transform`] transforms the user space coordinate (x, y) by the current transformation matrix (CTM) to produce the corresponding device space coordinate (x', y'). -If the `matrix` operand is supplied, link:/docs/commands/references/transform/[`transform`] transforms (x, y) by `matrix` rather than by the CTM. +If the `matrix` operand is supplied, link:/commands/references/transform/[`transform`] transforms (x, y) by `matrix` rather than by the CTM. This operator is useful for converting user space coordinates (the ones used in path construction) to device space coordinates (actual pixel positions). @@ -153,7 +153,7 @@ userY 0 ge userY 100 le and === Common Pitfalls -WARNING: *Position-Dependent* - link:/docs/commands/references/transform/[`transform`] includes translation. Use link:/docs/commands/references/dtransform/[`dtransform`] for distances. +WARNING: *Position-Dependent* - link:/commands/references/transform/[`transform`] includes translation. Use link:/commands/references/dtransform/[`dtransform`] for distances. [source,postscript] ---- @@ -175,7 +175,7 @@ WARNING: *CTM Changes* - The result depends on the current CTM at the time of ex 100 100 transform % Result B (different from A) ---- -TIP: *Use for Debugging* - link:/docs/commands/references/transform/[`transform`] helps understand coordinate mappings: +TIP: *Use for Debugging* - link:/commands/references/transform/[`transform`] helps understand coordinate mappings: [source,postscript] ---- @@ -212,7 +212,7 @@ TIP: *Use for Debugging* - link:/docs/commands/references/transform/[`transform` * Transformation is a simple matrix multiplication * Very fast operation * No rounding or approximation (exact computation) -* The inverse operation is link:/docs/commands/references/itransform/[`itransform`] +* The inverse operation is link:/commands/references/itransform/[`itransform`] === Transformation Formula @@ -285,8 +285,8 @@ transform === See Also -* link:/docs/commands/references/itransform/[`itransform`] - Inverse coordinate transformation (device to user) -* link:/docs/commands/references/dtransform/[`dtransform`] - Distance vector transformation -* link:/docs/commands/references/idtransform/[`idtransform`] - Inverse distance transformation -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/concat/[`concat`] - Modify CTM \ No newline at end of file +* link:/commands/references/itransform/[`itransform`] - Inverse coordinate transformation (device to user) +* link:/commands/references/dtransform/[`dtransform`] - Distance vector transformation +* link:/commands/references/idtransform/[`idtransform`] - Inverse distance transformation +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/concat/[`concat`] - Modify CTM \ No newline at end of file diff --git a/docs/commands/references/translate.adoc b/docs/commands/references/translate.adoc index 557b880..639ba1e 100644 --- a/docs/commands/references/translate.adoc +++ b/docs/commands/references/translate.adoc @@ -50,11 +50,11 @@ tx ty matrix translate → matrix === Description -With no matrix operand, link:/docs/commands/references/translate/[`translate`] builds a temporary transformation matrix T and concatenates it with the current transformation matrix (CTM). Precisely, link:/docs/commands/references/translate/[`translate`] replaces the CTM by T × CTM. +With no matrix operand, link:/commands/references/translate/[`translate`] builds a temporary transformation matrix T and concatenates it with the current transformation matrix (CTM). Precisely, link:/commands/references/translate/[`translate`] replaces the CTM by T × CTM. The effect is to move the origin of the user coordinate system by `tx` units in the x direction and `ty` units in the y direction relative to the former user coordinate system. The sizes of the x and y units and the orientation of the axes are unchanged. -If the `matrix` operand is supplied, link:/docs/commands/references/translate/[`translate`] replaces the value of `matrix` by T and pushes the modified matrix back on the operand stack. In this case, link:/docs/commands/references/translate/[`translate`] does not affect the CTM. +If the `matrix` operand is supplied, link:/commands/references/translate/[`translate`] replaces the value of `matrix` by T and pushes the modified matrix back on the operand stack. In this case, link:/commands/references/translate/[`translate`] does not affect the CTM. The translation matrix T has the form: @@ -151,7 +151,7 @@ matrix % Get identity matrix === Common Pitfalls -WARNING: *Coordinate System, Not Content* - link:/docs/commands/references/translate/[`translate`] moves the coordinate system, not the content. Drawing at (0, 0) after translation draws at the new origin location. +WARNING: *Coordinate System, Not Content* - link:/commands/references/translate/[`translate`] moves the coordinate system, not the content. Drawing at (0, 0) after translation draws at the new origin location. [source,postscript] ---- @@ -165,7 +165,7 @@ stroke stroke ---- -WARNING: *Transformations Accumulate* - Multiple translations add together. Use link:/docs/commands/references/gsave/[`gsave`]/link:/docs/commands/references/grestore/[`grestore`] to isolate transformations. +WARNING: *Transformations Accumulate* - Multiple translations add together. Use link:/commands/references/gsave/[`gsave`]/link:/commands/references/grestore/[`grestore`] to isolate transformations. [source,postscript] ---- @@ -180,7 +180,7 @@ grestore % Original coordinate system restored ---- -TIP: *Readable Layout Code* - Use link:/docs/commands/references/translate/[`translate`] to establish drawing origins, making code more readable: +TIP: *Readable Layout Code* - Use link:/commands/references/translate/[`translate`] to establish drawing origins, making code more readable: [source,postscript] ---- @@ -217,7 +217,7 @@ TIP: *Readable Layout Code* - Use link:/docs/commands/references/translate/[`tra === Matrix Mathematics -The translation matrix for link:/docs/commands/references/translate/[`translate`] by (`tx`, `ty`) is: +The translation matrix for link:/commands/references/translate/[`translate`] by (`tx`, `ty`) is: ---- T = [1 0 0 1 tx ty] @@ -252,10 +252,10 @@ This is because each transformation modifies the CTM by left-multiplication. === See Also -* link:/docs/commands/references/scale/[`scale`] - Change unit size -* link:/docs/commands/references/rotate/[`rotate`] - Rotate coordinate axes -* link:/docs/commands/references/concat/[`concat`] - Concatenate arbitrary matrix -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/scale/[`scale`] - Change unit size +* link:/commands/references/rotate/[`rotate`] - Rotate coordinate axes +* link:/commands/references/concat/[`concat`] - Concatenate arbitrary matrix +* link:/commands/references/setmatrix/[`setmatrix`] - Replace CTM directly +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current CTM +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/truncate.adoc b/docs/commands/references/truncate.adoc index 6aee7cc..afc06d5 100644 --- a/docs/commands/references/truncate.adoc +++ b/docs/commands/references/truncate.adoc @@ -84,9 +84,9 @@ num1 truncate num2 == Related Commands -* link:/docs/commands/references/ceiling/[`ceiling`] - Round up -* link:/docs/commands/references/floor/[`floor`] - Round down -* link:/docs/commands/references/round/[`round`] - Round to nearest +* link:/commands/references/ceiling/[`ceiling`] - Round up +* link:/commands/references/floor/[`floor`] - Round down +* link:/commands/references/round/[`round`] - Round to nearest == PostScript Level @@ -102,4 +102,4 @@ The operand is not a number. == See Also -* link:/docs/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file +* link:/commands/references/[Arithmetic and Math] - All arithmetic operators \ No newline at end of file diff --git a/docs/commands/references/type.adoc b/docs/commands/references/type.adoc index 3c96ec6..c47fc0f 100644 --- a/docs/commands/references/type.adoc +++ b/docs/commands/references/type.adoc @@ -37,7 +37,7 @@ any type → name === Description -link:/docs/commands/references/type/[`type`] returns a name object that identifies the type of its operand. The returned name has the **executable** attribute, making it convenient for type-dependent processing via dictionary lookup. +link:/commands/references/type/[`type`] returns a name object that identifies the type of its operand. The returned name has the **executable** attribute, making it convenient for type-dependent processing via dictionary lookup. === PostScript Level @@ -220,8 +220,8 @@ PostScript has no formal inheritance, but types can be categorized: === See Also -* link:/docs/commands/references/cvlit/[`cvlit`] - Convert to literal -* link:/docs/commands/references/cvx/[`cvx`] - Convert to executable -* link:/docs/commands/references/xcheck/[`xcheck`] - Test if executable -* link:/docs/commands/references/rcheck/[`rcheck`] - Test if readable -* link:/docs/commands/references/wcheck/[`wcheck`] - Test if writable \ No newline at end of file +* link:/commands/references/cvlit/[`cvlit`] - Convert to literal +* link:/commands/references/cvx/[`cvx`] - Convert to executable +* link:/commands/references/xcheck/[`xcheck`] - Test if executable +* link:/commands/references/rcheck/[`rcheck`] - Test if readable +* link:/commands/references/wcheck/[`wcheck`] - Test if writable \ No newline at end of file diff --git a/docs/commands/references/ueofill.adoc b/docs/commands/references/ueofill.adoc index b614d68..9eef258 100644 --- a/docs/commands/references/ueofill.adoc +++ b/docs/commands/references/ueofill.adoc @@ -37,9 +37,9 @@ userpath ueofill → - === Description -link:/docs/commands/references/ueofill/[`ueofill`] is similar to link:/docs/commands/references/ufill/[`ufill`], but uses the even-odd rule instead of the non-zero winding number rule to determine which areas are inside the path. The entire operation is effectively enclosed by link:/docs/commands/references/gsave/[`gsave`] and link:/docs/commands/references/grestore/[`grestore`], so link:/docs/commands/references/ueofill/[`ueofill`] has no lasting effect on the graphics state. +link:/commands/references/ueofill/[`ueofill`] is similar to link:/commands/references/ufill/[`ufill`], but uses the even-odd rule instead of the non-zero winding number rule to determine which areas are inside the path. The entire operation is effectively enclosed by link:/commands/references/gsave/[`gsave`] and link:/commands/references/grestore/[`grestore`], so link:/commands/references/ueofill/[`ueofill`] has no lasting effect on the graphics state. -link:/docs/commands/references/ueofill/[`ueofill`] is equivalent to: +link:/commands/references/ueofill/[`ueofill`] is equivalent to: [source,postscript] ---- @@ -182,7 +182,7 @@ grestore samePath ueofill % Inner is a hole ---- -WARNING: *Path Direction Irrelevant* - Unlike link:/docs/commands/references/ufill/[`ufill`], path direction doesn't affect the result with link:/docs/commands/references/ueofill/[`ueofill`]. +WARNING: *Path Direction Irrelevant* - Unlike link:/commands/references/ufill/[`ufill`], path direction doesn't affect the result with link:/commands/references/ueofill/[`ueofill`]. [source,postscript] ---- @@ -194,7 +194,7 @@ WARNING: *Path Direction Irrelevant* - Unlike link:/docs/commands/references/ufi ] ueofill % Always creates hole regardless of arc direction ---- -TIP: *Ideal for Shapes with Holes* - Use link:/docs/commands/references/ueofill/[`ueofill`] when you need predictable holes regardless of path direction: +TIP: *Ideal for Shapes with Holes* - Use link:/commands/references/ueofill/[`ueofill`] when you need predictable holes regardless of path direction: [source,postscript] ---- @@ -249,23 +249,23 @@ windowFrame ueofill === Comparison with Other Fill Operators -.Standard fill (link:/docs/commands/references/fill/[`fill`]) +.Standard fill (link:/commands/references/fill/[`fill`]) * Uses non-zero winding number rule * Path direction matters * No graphics state isolation -.Even-odd fill (link:/docs/commands/references/eofill/[`eofill`]) +.Even-odd fill (link:/commands/references/eofill/[`eofill`]) * Uses even-odd rule * Path direction doesn't matter * No graphics state isolation -.User path fill (link:/docs/commands/references/ufill/[`ufill`]) +.User path fill (link:/commands/references/ufill/[`ufill`]) * Uses non-zero winding number rule * Efficient user path format * Automatic graphics state save/restore * Can be cached -.User path even-odd fill (link:/docs/commands/references/ueofill/[`ueofill`]) +.User path even-odd fill (link:/commands/references/ueofill/[`ueofill`]) * Uses even-odd rule * Efficient user path format * Automatic graphics state save/restore @@ -355,12 +355,12 @@ ringPath ustroke === See Also -* link:/docs/commands/references/eofill/[`eofill`] - Even-odd fill traditional path -* link:/docs/commands/references/ufill/[`ufill`] - Fill user path with non-zero winding rule -* link:/docs/commands/references/ustroke/[`ustroke`] - Stroke user path -* link:/docs/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule +* link:/commands/references/eofill/[`eofill`] - Even-odd fill traditional path +* link:/commands/references/ufill/[`ufill`] - Fill user path with non-zero winding rule +* link:/commands/references/ustroke/[`ustroke`] - Stroke user path +* link:/commands/references/eoclip/[`eoclip`] - Clip using even-odd rule * `setbbox` - Set bounding box * `ucache` - Enable user path caching * `uappend` - Append user path to current path -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/ufill.adoc b/docs/commands/references/ufill.adoc index 280a692..8245dfa 100644 --- a/docs/commands/references/ufill.adoc +++ b/docs/commands/references/ufill.adoc @@ -37,9 +37,9 @@ userpath ufill → - === Description -link:/docs/commands/references/ufill/[`ufill`] interprets a user path definition and fills the resulting path as if by link:/docs/commands/references/fill/[`fill`]. The entire operation is effectively enclosed by link:/docs/commands/references/gsave/[`gsave`] and link:/docs/commands/references/grestore/[`grestore`], so link:/docs/commands/references/ufill/[`ufill`] has no lasting effect on the graphics state. +link:/commands/references/ufill/[`ufill`] interprets a user path definition and fills the resulting path as if by link:/commands/references/fill/[`fill`]. The entire operation is effectively enclosed by link:/commands/references/gsave/[`gsave`] and link:/commands/references/grestore/[`grestore`], so link:/commands/references/ufill/[`ufill`] has no lasting effect on the graphics state. -link:/docs/commands/references/ufill/[`ufill`] is equivalent to: +link:/commands/references/ufill/[`ufill`] is equivalent to: [source,postscript] ---- @@ -188,7 +188,7 @@ WARNING: *Must Include setbbox* - User paths must begin with `setbbox` (optional ] ufill ---- -WARNING: *Graphics State Not Modified* - link:/docs/commands/references/ufill/[`ufill`] automatically saves and restores the graphics state. +WARNING: *Graphics State Not Modified* - link:/commands/references/ufill/[`ufill`] automatically saves and restores the graphics state. [source,postscript] ---- @@ -282,7 +282,7 @@ fill grestore ---- -.User path approach (link:/docs/commands/references/ufill/[`ufill`]) +.User path approach (link:/commands/references/ufill/[`ufill`]) [source,postscript] ---- [ @@ -377,11 +377,11 @@ myPath ustroke === See Also -* link:/docs/commands/references/fill/[`fill`] - Traditional fill operator -* link:/docs/commands/references/ueofill/[`ueofill`] - Even-odd fill user path -* link:/docs/commands/references/ustroke/[`ustroke`] - Stroke user path +* link:/commands/references/fill/[`fill`] - Traditional fill operator +* link:/commands/references/ueofill/[`ueofill`] - Even-odd fill user path +* link:/commands/references/ustroke/[`ustroke`] - Stroke user path * `setbbox` - Set bounding box * `ucache` - Enable user path caching * `uappend` - Append user path to current path -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/undef.adoc b/docs/commands/references/undef.adoc index 66d1d8e..78d1823 100644 --- a/docs/commands/references/undef.adoc +++ b/docs/commands/references/undef.adoc @@ -40,7 +40,7 @@ dict key undef → – === Description -link:/docs/commands/references/undef/[`undef`] removes _key_ and its associated value from dictionary _dict_. The dictionary does not need to be on the dictionary stack. +link:/commands/references/undef/[`undef`] removes _key_ and its associated value from dictionary _dict_. The dictionary does not need to be on the dictionary stack. **No error occurs** if _key_ is not present in _dict_ - the operation is simply ignored. @@ -108,14 +108,14 @@ config /feature known { === Common Pitfalls -WARNING: *Level 2 Only* - link:/docs/commands/references/undef/[`undef`] is not available in Level 1 implementations. +WARNING: *Level 2 Only* - link:/commands/references/undef/[`undef`] is not available in Level 1 implementations. [source,postscript] ---- % Level 1 workaround: none (can't remove entries) ---- -WARNING: *Silent on Missing Keys* - No error if key doesn't exist. Use link:/docs/commands/references/known/[`known`] first if you need to know. +WARNING: *Silent on Missing Keys* - No error if key doesn't exist. Use link:/commands/references/known/[`known`] first if you need to know. [source,postscript] ---- @@ -172,7 +172,7 @@ dict key known { === See Also -* link:/docs/commands/references/def/[`def`] - Define key-value pair -* link:/docs/commands/references/known/[`known`] - Check if key exists -* link:/docs/commands/references/put/[`put`] - Add/modify dictionary entry -* link:/docs/commands/references/where/[`where`] - Find dictionary containing key \ No newline at end of file +* link:/commands/references/def/[`def`] - Define key-value pair +* link:/commands/references/known/[`known`] - Check if key exists +* link:/commands/references/put/[`put`] - Add/modify dictionary entry +* link:/commands/references/where/[`where`] - Find dictionary containing key \ No newline at end of file diff --git a/docs/commands/references/undefinefont.adoc b/docs/commands/references/undefinefont.adoc index 20fc4bc..22a511c 100644 --- a/docs/commands/references/undefinefont.adoc +++ b/docs/commands/references/undefinefont.adoc @@ -33,9 +33,9 @@ key === Description -link:/docs/commands/references/undefinefont/[`undefinefont`] removes `key` and its associated value (a font dictionary) from the font directory, reversing the effect of a previous link:/docs/commands/references/definefont/[`definefont`]. link:/docs/commands/references/undefinefont/[`undefinefont`] is a special case of the `undefineresource` operator applied to the Font category. +link:/commands/references/undefinefont/[`undefinefont`] removes `key` and its associated value (a font dictionary) from the font directory, reversing the effect of a previous link:/commands/references/definefont/[`definefont`]. link:/commands/references/undefinefont/[`undefinefont`] is a special case of the `undefineresource` operator applied to the Font category. -If the specified `key` does not exist in the font directory, link:/docs/commands/references/undefinefont/[`undefinefont`] does nothing—no error occurs. +If the specified `key` does not exist in the font directory, link:/commands/references/undefinefont/[`undefinefont`] does nothing—no error occurs. === Parameters @@ -137,12 +137,12 @@ false setglobal - Font becomes eligible for garbage collection only when no longer accessible **Current Font:** -- If the removed font is currently set via link:/docs/commands/references/setfont/[`setfont`], it remains current +- If the removed font is currently set via link:/commands/references/setfont/[`setfont`], it remains current - The current font in graphics state is unaffected -- Only future link:/docs/commands/references/findfont/[`findfont`] calls are affected +- Only future link:/commands/references/findfont/[`findfont`] calls are affected **Restore Interaction:** -- Effect of link:/docs/commands/references/undefinefont/[`undefinefont`] on local VM subject to `restore` +- Effect of link:/commands/references/undefinefont/[`undefinefont`] on local VM subject to `restore` - Removing local font can be undone by `restore` - Removing global font is permanent (until restored at job end) @@ -220,7 +220,7 @@ FontDirectory { === Relationship to Other Resource Operators -link:/docs/commands/references/undefinefont/[`undefinefont`] is equivalent to: +link:/commands/references/undefinefont/[`undefinefont`] is equivalent to: [source,postscript] ---- @@ -235,8 +235,8 @@ For generic resource manipulation, use the resource operators: === See Also -- link:/docs/commands/references/definefont/[`definefont`] - Register font in font directory -- link:/docs/commands/references/findfont/[`findfont`] - Obtain font dictionary by name +- link:/commands/references/definefont/[`definefont`] - Register font in font directory +- link:/commands/references/findfont/[`findfont`] - Obtain font dictionary by name - `undefineresource` - Remove resource from category - `FontDirectory` - Dictionary of local fonts - `GlobalFontDirectory` - Dictionary of global fonts \ No newline at end of file diff --git a/docs/commands/references/ustroke.adoc b/docs/commands/references/ustroke.adoc index 27aa726..e0f0145 100644 --- a/docs/commands/references/ustroke.adoc +++ b/docs/commands/references/ustroke.adoc @@ -50,16 +50,16 @@ userpath matrix ustroke → - === Description -link:/docs/commands/references/ustroke/[`ustroke`] interprets a user path definition and strokes the resulting path as if by link:/docs/commands/references/stroke/[`stroke`]. The entire operation is effectively enclosed by link:/docs/commands/references/gsave/[`gsave`] and link:/docs/commands/references/grestore/[`grestore`], so link:/docs/commands/references/ustroke/[`ustroke`] has no lasting effect on the graphics state. +link:/commands/references/ustroke/[`ustroke`] interprets a user path definition and strokes the resulting path as if by link:/commands/references/stroke/[`stroke`]. The entire operation is effectively enclosed by link:/commands/references/gsave/[`gsave`] and link:/commands/references/grestore/[`grestore`], so link:/commands/references/ustroke/[`ustroke`] has no lasting effect on the graphics state. -In the first form (with no matrix operand), link:/docs/commands/references/ustroke/[`ustroke`] is equivalent to: +In the first form (with no matrix operand), link:/commands/references/ustroke/[`ustroke`] is equivalent to: [source,postscript] ---- gsave newpath uappend stroke grestore ---- -In the second form, link:/docs/commands/references/ustroke/[`ustroke`] concatenates `matrix` to the CTM after interpreting `userpath`, but before executing link:/docs/commands/references/stroke/[`stroke`]. The matrix applies to the line width and the dash pattern, if any, but not to the path itself. This form is equivalent to: +In the second form, link:/commands/references/ustroke/[`ustroke`] concatenates `matrix` to the CTM after interpreting `userpath`, but before executing link:/commands/references/stroke/[`stroke`]. The matrix applies to the line width and the dash pattern, if any, but not to the path itself. This form is equivalent to: [source,postscript] ---- @@ -193,7 +193,7 @@ ustroke === Common Pitfalls -WARNING: *Graphics State Not Modified* - link:/docs/commands/references/ustroke/[`ustroke`] automatically saves and restores graphics state. +WARNING: *Graphics State Not Modified* - link:/commands/references/ustroke/[`ustroke`] automatically saves and restores graphics state. [source,postscript] ---- @@ -292,13 +292,13 @@ myPath 2 1 uniformStroke % Compensates for scale === Graphics State Interaction -link:/docs/commands/references/ustroke/[`ustroke`] uses these graphics state parameters: +link:/commands/references/ustroke/[`ustroke`] uses these graphics state parameters: -* Line width - from link:/docs/commands/references/setlinewidth/[`setlinewidth`] -* Line cap - from link:/docs/commands/references/setlinecap/[`setlinecap`] -* Line join - from link:/docs/commands/references/setlinejoin/[`setlinejoin`] -* Miter limit - from link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] -* Dash pattern - from link:/docs/commands/references/setdash/[`setdash`] +* Line width - from link:/commands/references/setlinewidth/[`setlinewidth`] +* Line cap - from link:/commands/references/setlinecap/[`setlinecap`] +* Line join - from link:/commands/references/setlinejoin/[`setlinejoin`] +* Miter limit - from link:/commands/references/setmiterlimit/[`setmiterlimit`] +* Dash pattern - from link:/commands/references/setdash/[`setdash`] * Current color * Current clipping path * Current transformation matrix (CTM) @@ -322,7 +322,7 @@ stroke grestore ---- -.User path approach (link:/docs/commands/references/ustroke/[`ustroke`]) +.User path approach (link:/commands/references/ustroke/[`ustroke`]) [source,postscript] ---- 2 setlinewidth @@ -437,16 +437,16 @@ shapePath ustroke === See Also -* link:/docs/commands/references/stroke/[`stroke`] - Traditional stroke operator -* link:/docs/commands/references/ufill/[`ufill`] - Fill user path -* link:/docs/commands/references/ustrokepath/[`ustrokepath`] - Convert user path stroke to outline -* link:/docs/commands/references/strokepath/[`strokepath`] - Convert stroke to outline path +* link:/commands/references/stroke/[`stroke`] - Traditional stroke operator +* link:/commands/references/ufill/[`ufill`] - Fill user path +* link:/commands/references/ustrokepath/[`ustrokepath`] - Convert user path stroke to outline +* link:/commands/references/strokepath/[`strokepath`] - Convert stroke to outline path * `setbbox` - Set bounding box * `ucache` - Enable user path caching * `uappend` - Append user path to current path -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern -* link:/docs/commands/references/gsave/[`gsave`] - Save graphics state -* link:/docs/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join +* link:/commands/references/setdash/[`setdash`] - Set dash pattern +* link:/commands/references/gsave/[`gsave`] - Save graphics state +* link:/commands/references/grestore/[`grestore`] - Restore graphics state \ No newline at end of file diff --git a/docs/commands/references/ustrokepath.adoc b/docs/commands/references/ustrokepath.adoc index ece0a8a..b6098fc 100644 --- a/docs/commands/references/ustrokepath.adoc +++ b/docs/commands/references/ustrokepath.adoc @@ -50,18 +50,18 @@ userpath matrix ustrokepath → - === Description -link:/docs/commands/references/ustrokepath/[`ustrokepath`] replaces the current path with one enclosing the shape that would result if the link:/docs/commands/references/ustroke/[`ustroke`] operator were applied to the same operands. The path resulting from link:/docs/commands/references/ustrokepath/[`ustrokepath`] is suitable as the implicit operand to a subsequent link:/docs/commands/references/fill/[`fill`], link:/docs/commands/references/clip/[`clip`], or `pathbbox`. +link:/commands/references/ustrokepath/[`ustrokepath`] replaces the current path with one enclosing the shape that would result if the link:/commands/references/ustroke/[`ustroke`] operator were applied to the same operands. The path resulting from link:/commands/references/ustrokepath/[`ustrokepath`] is suitable as the implicit operand to a subsequent link:/commands/references/fill/[`fill`], link:/commands/references/clip/[`clip`], or `pathbbox`. -In general, this path is not suitable for link:/docs/commands/references/stroke/[`stroke`], as it may contain interior segments or disconnected subpaths produced by link:/docs/commands/references/ustrokepath/[`ustrokepath`]'s stroke-to-outline conversion process. +In general, this path is not suitable for link:/commands/references/stroke/[`stroke`], as it may contain interior segments or disconnected subpaths produced by link:/commands/references/ustrokepath/[`ustrokepath`]'s stroke-to-outline conversion process. -In the first form, link:/docs/commands/references/ustrokepath/[`ustrokepath`] is equivalent to: +In the first form, link:/commands/references/ustrokepath/[`ustrokepath`] is equivalent to: [source,postscript] ---- newpath uappend strokepath ---- -In the second form, link:/docs/commands/references/ustrokepath/[`ustrokepath`] is equivalent to: +In the second form, link:/commands/references/ustrokepath/[`ustrokepath`] is equivalent to: [source,postscript] ---- @@ -235,7 +235,7 @@ stroke % Unpredictable results fill % Correct usage ---- -WARNING: *Current Path Is Modified* - Unlike link:/docs/commands/references/ustroke/[`ustroke`], the current path is replaced with the outline. +WARNING: *Current Path Is Modified* - Unlike link:/commands/references/ustroke/[`ustroke`], the current path is replaced with the outline. [source,postscript] ---- @@ -262,7 +262,7 @@ WARNING: *Matrix Affects Stroke, Not Path Coordinates* - The optional matrix onl ustrokepath % Only affects line width calculation ---- -TIP: *Use for Path Analysis* - link:/docs/commands/references/ustrokepath/[`ustrokepath`] makes stroke boundaries explicit for analysis: +TIP: *Use for Path Analysis* - link:/commands/references/ustrokepath/[`ustrokepath`] makes stroke boundaries explicit for analysis: [source,postscript] ---- @@ -311,16 +311,16 @@ pathbbox % Returns bbox of stroke outline === Graphics State Parameters -link:/docs/commands/references/ustrokepath/[`ustrokepath`] uses these parameters to create the outline: +link:/commands/references/ustrokepath/[`ustrokepath`] uses these parameters to create the outline: -* Line width - from link:/docs/commands/references/setlinewidth/[`setlinewidth`] -* Line cap - from link:/docs/commands/references/setlinecap/[`setlinecap`] -* Line join - from link:/docs/commands/references/setlinejoin/[`setlinejoin`] -* Miter limit - from link:/docs/commands/references/setmiterlimit/[`setmiterlimit`] -* Dash pattern - from link:/docs/commands/references/setdash/[`setdash`] +* Line width - from link:/commands/references/setlinewidth/[`setlinewidth`] +* Line cap - from link:/commands/references/setlinecap/[`setlinecap`] +* Line join - from link:/commands/references/setlinejoin/[`setlinejoin`] +* Miter limit - from link:/commands/references/setmiterlimit/[`setmiterlimit`] +* Dash pattern - from link:/commands/references/setdash/[`setdash`] * Current transformation matrix (CTM) -The graphics state is not automatically saved/restored (unlike link:/docs/commands/references/ustroke/[`ustroke`]). +The graphics state is not automatically saved/restored (unlike link:/commands/references/ustroke/[`ustroke`]). === Comparison with Other Stroke Operators @@ -494,7 +494,7 @@ fill === Performance Considerations -* More complex than simple link:/docs/commands/references/ustroke/[`ustroke`] +* More complex than simple link:/commands/references/ustroke/[`ustroke`] * User path format provides some efficiency * Dash patterns significantly increase complexity * Round caps/joins create more segments @@ -503,16 +503,16 @@ fill === See Also -* link:/docs/commands/references/ustroke/[`ustroke`] - Stroke user path -* link:/docs/commands/references/strokepath/[`strokepath`] - Convert stroke to outline (traditional path) -* link:/docs/commands/references/ufill/[`ufill`] - Fill user path -* link:/docs/commands/references/fill/[`fill`] - Fill path interior -* link:/docs/commands/references/clip/[`clip`] - Use path for clipping +* link:/commands/references/ustroke/[`ustroke`] - Stroke user path +* link:/commands/references/strokepath/[`strokepath`] - Convert stroke to outline (traditional path) +* link:/commands/references/ufill/[`ufill`] - Fill user path +* link:/commands/references/fill/[`fill`] - Fill path interior +* link:/commands/references/clip/[`clip`] - Use path for clipping * `setbbox` - Set bounding box * `ucache` - Enable user path caching * `uappend` - Append user path to current path * `pathbbox` - Get path bounding box -* link:/docs/commands/references/setlinewidth/[`setlinewidth`] - Set line width -* link:/docs/commands/references/setlinecap/[`setlinecap`] - Set line cap -* link:/docs/commands/references/setlinejoin/[`setlinejoin`] - Set line join -* link:/docs/commands/references/setdash/[`setdash`] - Set dash pattern \ No newline at end of file +* link:/commands/references/setlinewidth/[`setlinewidth`] - Set line width +* link:/commands/references/setlinecap/[`setlinecap`] - Set line cap +* link:/commands/references/setlinejoin/[`setlinejoin`] - Set line join +* link:/commands/references/setdash/[`setdash`] - Set dash pattern \ No newline at end of file diff --git a/docs/commands/references/wcheck.adoc b/docs/commands/references/wcheck.adoc index cbfb4ca..c72deb4 100644 --- a/docs/commands/references/wcheck.adoc +++ b/docs/commands/references/wcheck.adoc @@ -40,7 +40,7 @@ string wcheck → bool === Description -link:/docs/commands/references/wcheck/[`wcheck`] tests whether the operand's access attribute permits its value to be written (modified) by PostScript operators. +link:/commands/references/wcheck/[`wcheck`] tests whether the operand's access attribute permits its value to be written (modified) by PostScript operators. Returns: * `true` if access is **unlimited** @@ -120,7 +120,7 @@ dict wcheck { === Common Pitfalls -WARNING: *Packed Arrays Always Read-Only* - Packed arrays created with link:/docs/commands/references/packedarray/[`packedarray`] always return `false` for link:/docs/commands/references/wcheck/[`wcheck`]. +WARNING: *Packed Arrays Always Read-Only* - Packed arrays created with link:/commands/references/packedarray/[`packedarray`] always return `false` for link:/commands/references/wcheck/[`wcheck`]. [source,postscript] ---- @@ -135,9 +135,9 @@ WARNING: *Readonly is Permanent* - Once an object is made readonly, it cannot be % No way to restore unlimited access ---- -WARNING: *Confusing wcheck with xcheck* - link:/docs/commands/references/wcheck/[`wcheck`] tests write access, link:/docs/commands/references/xcheck/[`xcheck`] tests executable attribute. +WARNING: *Confusing wcheck with xcheck* - link:/commands/references/wcheck/[`wcheck`] tests write access, link:/commands/references/xcheck/[`xcheck`] tests executable attribute. -TIP: *Check Before Modifying* - Use link:/docs/commands/references/wcheck/[`wcheck`] before operations like link:/docs/commands/references/put/[`put`] or link:/docs/commands/references/putinterval/[`putinterval`] on untrusted objects. +TIP: *Check Before Modifying* - Use link:/commands/references/wcheck/[`wcheck`] before operations like link:/commands/references/put/[`put`] or link:/commands/references/putinterval/[`putinterval`] on untrusted objects. === Error Conditions @@ -198,8 +198,8 @@ object wcheck { === See Also -* link:/docs/commands/references/rcheck/[`rcheck`] - Test if readable -* link:/docs/commands/references/xcheck/[`xcheck`] - Test if executable +* link:/commands/references/rcheck/[`rcheck`] - Test if readable +* link:/commands/references/xcheck/[`xcheck`] - Test if executable * Access operators: `readonly`, `executeonly`, `noaccess` -* link:/docs/commands/references/put/[`put`] - Modify array/string/dict -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/put/[`put`] - Modify array/string/dict +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/references/where.adoc b/docs/commands/references/where.adoc index 6f6d794..3de4938 100644 --- a/docs/commands/references/where.adoc +++ b/docs/commands/references/where.adoc @@ -50,7 +50,7 @@ key where → dict true (if found) === Description -link:/docs/commands/references/where/[`where`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. +link:/commands/references/where/[`where`] searches for _key_ in each dictionary on the dictionary stack, starting with the topmost (current) dictionary. * If found: returns the dictionary object and `true` * If not found: returns `false` @@ -141,7 +141,7 @@ end === Common Pitfalls -WARNING: *Returns Dictionary, Not Value* - link:/docs/commands/references/where/[`where`] returns the dictionary itself, not the value. +WARNING: *Returns Dictionary, Not Value* - link:/commands/references/where/[`where`] returns the dictionary itself, not the value. [source,postscript] ---- @@ -197,7 +197,7 @@ TIP: *Idiom for Getting Value* - Common pattern to get value: [cols="2,3,3"] |=== -| Aspect | link:/docs/commands/references/known/[`known`] | link:/docs/commands/references/where/[`where`] +| Aspect | link:/commands/references/known/[`known`] | link:/commands/references/where/[`where`] | Search scope | Specific dictionary @@ -218,8 +218,8 @@ TIP: *Idiom for Getting Value* - Common pattern to get value: === See Also -* link:/docs/commands/references/known/[`known`] - Check specific dictionary -* link:/docs/commands/references/load/[`load`] - Get value from dictionary stack -* link:/docs/commands/references/def/[`def`] - Define in current dictionary -* link:/docs/commands/references/store/[`store`] - Store in dictionary stack -* link:/docs/commands/references/get/[`get`] - Get from specific dictionary \ No newline at end of file +* link:/commands/references/known/[`known`] - Check specific dictionary +* link:/commands/references/load/[`load`] - Get value from dictionary stack +* link:/commands/references/def/[`def`] - Define in current dictionary +* link:/commands/references/store/[`store`] - Store in dictionary stack +* link:/commands/references/get/[`get`] - Get from specific dictionary \ No newline at end of file diff --git a/docs/commands/references/widthshow.adoc b/docs/commands/references/widthshow.adoc index b91b313..ffa5f15 100644 --- a/docs/commands/references/widthshow.adoc +++ b/docs/commands/references/widthshow.adoc @@ -29,7 +29,7 @@ cx cy char string === Description -link:/docs/commands/references/widthshow/[`widthshow`] paints the characters of `string` in a manner similar to link:/docs/commands/references/show/[`show`]. But while doing so, link:/docs/commands/references/widthshow/[`widthshow`] adjusts the width of each occurrence of the character `char` by adding `cx` to its x width and `cy` to its y width, thus modifying the spacing between it and the next character. +link:/commands/references/widthshow/[`widthshow`] paints the characters of `string` in a manner similar to link:/commands/references/show/[`show`]. But while doing so, link:/commands/references/widthshow/[`widthshow`] adjusts the width of each occurrence of the character `char` by adding `cx` to its x width and `cy` to its y width, thus modifying the spacing between it and the next character. The `char` parameter is an integer used as a character code. This operator enables fitting a string of text to a specific width by adjusting the width of all occurrences of some specific character, such as the space character. @@ -257,9 +257,9 @@ else: === Performance Considerations -- Slightly slower than link:/docs/commands/references/show/[`show`] due to conditional width adjustment +- Slightly slower than link:/commands/references/show/[`show`] due to conditional width adjustment - Still benefits from font caching -- More efficient than link:/docs/commands/references/kshow/[`kshow`] for simple spacing needs +- More efficient than link:/commands/references/kshow/[`kshow`] for simple spacing needs - Character matching is done by simple integer comparison (fast) === Comparison with Other Spacing Operators @@ -268,27 +268,27 @@ else: |=== | Operator | Spacing Adjustment -| link:/docs/commands/references/show/[`show`] +| link:/commands/references/show/[`show`] | None (uses character widths as-is) -| link:/docs/commands/references/ashow/[`ashow`] +| link:/commands/references/ashow/[`ashow`] | Uniform adjustment to all characters -| link:/docs/commands/references/widthshow/[`widthshow`] +| link:/commands/references/widthshow/[`widthshow`] | Adjustment to specific character only -| link:/docs/commands/references/awidthshow/[`awidthshow`] +| link:/commands/references/awidthshow/[`awidthshow`] | Both uniform and character-specific -| link:/docs/commands/references/kshow/[`kshow`] +| link:/commands/references/kshow/[`kshow`] | Procedural control between each pair |=== === See Also -- link:/docs/commands/references/show/[`show`] - Basic text painting -- link:/docs/commands/references/ashow/[`ashow`] - Show with uniform character spacing -- link:/docs/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow -- link:/docs/commands/references/kshow/[`kshow`] - Show with kerning procedure -- link:/docs/commands/references/cshow/[`cshow`] - Show with procedure per character -- link:/docs/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file +- link:/commands/references/show/[`show`] - Basic text painting +- link:/commands/references/ashow/[`ashow`] - Show with uniform character spacing +- link:/commands/references/awidthshow/[`awidthshow`] - Combine ashow and widthshow +- link:/commands/references/kshow/[`kshow`] - Show with kerning procedure +- link:/commands/references/cshow/[`cshow`] - Show with procedure per character +- link:/commands/references/stringwidth/[`stringwidth`] - Calculate text width \ No newline at end of file diff --git a/docs/commands/references/xcheck.adoc b/docs/commands/references/xcheck.adoc index 3d26673..c54953d 100644 --- a/docs/commands/references/xcheck.adoc +++ b/docs/commands/references/xcheck.adoc @@ -37,7 +37,7 @@ any xcheck → bool === Description -link:/docs/commands/references/xcheck/[`xcheck`] tests whether the operand has the executable or literal attribute: +link:/commands/references/xcheck/[`xcheck`] tests whether the operand has the executable or literal attribute: * Returns `true` if the object is executable * Returns `false` if the object is literal @@ -112,7 +112,7 @@ abc xcheck % true (executable name) - if abc is defined === Common Pitfalls -WARNING: *Tests Attribute, Not Access* - link:/docs/commands/references/xcheck/[`xcheck`] does not test access permissions like execute-only. +WARNING: *Tests Attribute, Not Access* - link:/commands/references/xcheck/[`xcheck`] does not test access permissions like execute-only. [source,postscript] ---- @@ -122,7 +122,7 @@ proc executeonly xcheck % true WARNING: *Most Objects Are Literal* - Numbers, strings, and array literals are all literal by default. -TIP: *Combine with type* - Use link:/docs/commands/references/type/[`type`] to check object type along with executability. +TIP: *Combine with type* - Use link:/commands/references/type/[`type`] to check object type along with executability. === Error Conditions @@ -190,8 +190,8 @@ TIP: *Combine with type* - Use link:/docs/commands/references/type/[`type`] to c === See Also -* link:/docs/commands/references/cvlit/[`cvlit`] - Convert to literal attribute -* link:/docs/commands/references/cvx/[`cvx`] - Convert to executable attribute -* link:/docs/commands/references/rcheck/[`rcheck`] - Test if readable -* link:/docs/commands/references/wcheck/[`wcheck`] - Test if writable -* link:/docs/commands/references/type/[`type`] - Get object type \ No newline at end of file +* link:/commands/references/cvlit/[`cvlit`] - Convert to literal attribute +* link:/commands/references/cvx/[`cvx`] - Convert to executable attribute +* link:/commands/references/rcheck/[`rcheck`] - Test if readable +* link:/commands/references/wcheck/[`wcheck`] - Test if writable +* link:/commands/references/type/[`type`] - Get object type \ No newline at end of file diff --git a/docs/commands/resource-management/index.adoc b/docs/commands/resource-management/index.adoc index 0c6f180..7cea2af 100644 --- a/docs/commands/resource-management/index.adoc +++ b/docs/commands/resource-management/index.adoc @@ -17,12 +17,12 @@ This category contains PostScript operators for resource management. This category is ready for command documentation to be added. Commands in this category include operators from the PostScript Language Reference Manual. See other completed categories for documentation examples: -* link:/docs/commands/references/[Path Construction] -* link:/docs/commands/references/[Painting] -* link:/docs/commands/references/[Transformations] -* link:/docs/commands/references/[Font & Text] +* link:/commands/references/[Path Construction] +* link:/commands/references/[Painting] +* link:/commands/references/[Transformations] +* link:/commands/references/[Font & Text] == See Also -* link:/docs/commands/[Command Reference Overview] -* link:/docs/syntax/[Language Syntax] +* link:/commands/[Command Reference Overview] +* link:/syntax/[Language Syntax] diff --git a/docs/commands/stack-manipulation/index.adoc b/docs/commands/stack-manipulation/index.adoc index b247d4c..8b4c739 100644 --- a/docs/commands/stack-manipulation/index.adoc +++ b/docs/commands/stack-manipulation/index.adoc @@ -18,37 +18,37 @@ The operand stack is fundamental to PostScript execution. These operators provid |=== |Command |Description -|link:/docs/commands/references/pop/[`pop`] +|link:/commands/references/pop/[`pop`] |Remove the top element from the stack -|link:/docs/commands/references/exch/[`exch`] +|link:/commands/references/exch/[`exch`] |Exchange the top two stack elements -|link:/docs/commands/references/dup/[`dup`] +|link:/commands/references/dup/[`dup`] |Duplicate the top element -|link:/docs/commands/references/copy/[`copy`] +|link:/commands/references/copy/[`copy`] |Copy top n elements or duplicate composite object values -|link:/docs/commands/references/psindex/[`psindex`] +|link:/commands/references/psindex/[`psindex`] |Duplicate the nth element from the top -|link:/docs/commands/references/roll/[`roll`] +|link:/commands/references/roll/[`roll`] |Roll n elements j times -|link:/docs/commands/references/count/[`count`] +|link:/commands/references/count/[`count`] |Count elements on the stack -|link:/docs/commands/references/clear/[`clear`] +|link:/commands/references/clear/[`clear`] |Remove all elements from the stack -|link:/docs/commands/references/mark/[`mark`] +|link:/commands/references/mark/[`mark`] |Push a mark object onto the stack -|link:/docs/commands/references/cleartomark/[`cleartomark`] +|link:/commands/references/cleartomark/[`cleartomark`] |Pop elements down to and including a mark -|link:/docs/commands/references/counttomark/[`counttomark`] +|link:/commands/references/counttomark/[`counttomark`] |Count elements down to a mark |=== @@ -70,6 +70,6 @@ a b c d 3 index % Copy element 3 positions down == See Also -* link:/docs/commands/[Command Reference] - All PostScript commands -* link:/docs/syntax/operators/[Operators Overview] -* link:/docs/usage/basic/stack-operations/[Stack Operations Guide] \ No newline at end of file +* link:/commands/[Command Reference] - All PostScript commands +* link:/syntax/operators/[Operators Overview] +* link:/usage/basic/stack-operations/[Stack Operations Guide] \ No newline at end of file diff --git a/docs/commands/transformations/index.adoc b/docs/commands/transformations/index.adoc index 79020a8..3bb8eda 100644 --- a/docs/commands/transformations/index.adoc +++ b/docs/commands/transformations/index.adoc @@ -14,28 +14,28 @@ The PostScript coordinate transformation system provides powerful tools for mani ==== Basic Transformations -* link:/docs/commands/references/translate/[`translate`] - Move the origin -* link:/docs/commands/references/scale/[`scale`] - Change unit size -* link:/docs/commands/references/rotate/[`rotate`] - Rotate axes -* link:/docs/commands/references/concat/[`concat`] - Concatenate matrix with CTM +* link:/commands/references/translate/[`translate`] - Move the origin +* link:/commands/references/scale/[`scale`] - Change unit size +* link:/commands/references/rotate/[`rotate`] - Rotate axes +* link:/commands/references/concat/[`concat`] - Concatenate matrix with CTM ==== Matrix Operations -* link:/docs/commands/references/matrix/[`matrix`] - Create identity matrix -* link:/docs/commands/references/identmatrix/[`identmatrix`] - Replace matrix with identity -* link:/docs/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix -* link:/docs/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation matrix -* link:/docs/commands/references/setmatrix/[`setmatrix`] - Replace CTM with matrix -* link:/docs/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default -* link:/docs/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices -* link:/docs/commands/references/invertmatrix/[`invertmatrix`] - Invert a matrix +* link:/commands/references/matrix/[`matrix`] - Create identity matrix +* link:/commands/references/identmatrix/[`identmatrix`] - Replace matrix with identity +* link:/commands/references/defaultmatrix/[`defaultmatrix`] - Get device default matrix +* link:/commands/references/currentmatrix/[`currentmatrix`] - Get current transformation matrix +* link:/commands/references/setmatrix/[`setmatrix`] - Replace CTM with matrix +* link:/commands/references/initmatrix/[`initmatrix`] - Reset CTM to default +* link:/commands/references/concatmatrix/[`concatmatrix`] - Multiply two matrices +* link:/commands/references/invertmatrix/[`invertmatrix`] - Invert a matrix ==== Coordinate Transformations -* link:/docs/commands/references/transform/[`transform`] - Transform user→device coordinates -* link:/docs/commands/references/itransform/[`itransform`] - Transform device→user coordinates -* link:/docs/commands/references/dtransform/[`dtransform`] - Transform distance vector -* link:/docs/commands/references/idtransform/[`idtransform`] - Inverse transform distance vector +* link:/commands/references/transform/[`transform`] - Transform user→device coordinates +* link:/commands/references/itransform/[`itransform`] - Transform device→user coordinates +* link:/commands/references/dtransform/[`dtransform`] - Transform distance vector +* link:/commands/references/idtransform/[`idtransform`] - Inverse transform distance vector === Transformation Matrix @@ -64,9 +64,9 @@ The identity matrix is `[1 0 0 1 0 0]`. The CTM maps user space coordinates to device space coordinates. It is part of the graphics state and is affected by: -* link:/docs/commands/references/gsave/[`gsave`] and link:/docs/commands/references/grestore/[`grestore`] +* link:/commands/references/gsave/[`gsave`] and link:/commands/references/grestore/[`grestore`] * Basic transformation commands -* link:/docs/commands/references/setmatrix/[`setmatrix`] +* link:/commands/references/setmatrix/[`setmatrix`] === Common Operations diff --git a/docs/examples/color-gradients.adoc b/docs/examples/color-gradients.adoc index ebf4407..7e188b0 100644 --- a/docs/examples/color-gradients.adoc +++ b/docs/examples/color-gradients.adoc @@ -192,10 +192,10 @@ Understanding RGB, CMYK, HSB, and grayscale color models. showpage ---- <1> Loop to create grayscale spectrum -<2> Use link:../commands/graphics-state/setgray/[`setgray`] for grayscale (0=black, 1=white) -<3> Use link:../commands/graphics-state/setrgbcolor/[`setrgbcolor`] for red, green, blue (0.0-1.0 each) -<4> Use link:../commands/graphics-state/setcmykcolor/[`setcmykcolor`] for cyan, magenta, yellow, black -<5> Use link:../commands/graphics-state/sethsbcolor/[`sethsbcolor`] for hue (0-1 = 0-360°), saturation, brightness +<2> Use link:/commands/references/graphics-state/setgray/[`setgray`] for grayscale (0=black, 1=white) +<3> Use link:/commands/references/graphics-state/setrgbcolor/[`setrgbcolor`] for red, green, blue (0.0-1.0 each) +<4> Use link:/commands/references/graphics-state/setcmykcolor/[`setcmykcolor`] for cyan, magenta, yellow, black +<5> Use link:/commands/references/graphics-state/sethsbcolor/[`sethsbcolor`] for hue (0-1 = 0-360°), saturation, brightness ==== Expected Output @@ -617,8 +617,8 @@ showpage <17> ShadingType 6 = Coons patch mesh (Level 3) <18> Define patch corner coordinates <19> Define colors at each corner -<20> Use link:../commands/painting/clip/[`clip`] to restrict gradient to shape -<21> Use link:../commands/font-text/charpath/[`charpath`] to convert text to path +<20> Use link:/commands/references/painting/clip/[`clip`] to restrict gradient to shape +<21> Use link:/commands/references/font-text/charpath/[`charpath`] to convert text to path ==== Expected Output @@ -1130,13 +1130,13 @@ Transparency demonstrations: === See Also -* link:/docs/examples/drawing-shapes/[Drawing Shapes] - Shapes to fill with gradients -* link:/docs/examples/text-layout/[Text Layout] - Gradient text effects -* link:/docs/examples/image-manipulation/[Image Manipulation] - Color in images -* link:/docs/levels/level-2/[Level 2] - Shading functions -* link:/docs/levels/level-3/[Level 3] - Transparency -* link:/docs/commands/references/setrgbcolor/[setrgbcolor] - RGB colors -* link:/docs/commands/references/setcmykcolor/[setcmykcolor] - CMYK colors -* link:/docs/commands/references/sethsbcolor/[sethsbcolor] - HSB colors -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/drawing-shapes/[Drawing Shapes] - Shapes to fill with gradients +* link:/examples/text-layout/[Text Layout] - Gradient text effects +* link:/examples/image-manipulation/[Image Manipulation] - Color in images +* link:/levels/level-2/[Level 2] - Shading functions +* link:/levels/level-3/[Level 3] - Transparency +* link:/commands/references/setrgbcolor/[setrgbcolor] - RGB colors +* link:/commands/references/setcmykcolor/[setcmykcolor] - CMYK colors +* link:/commands/references/sethsbcolor/[sethsbcolor] - HSB colors +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/examples/drawing-shapes.adoc b/docs/examples/drawing-shapes.adoc index 94bec76..3545d21 100644 --- a/docs/examples/drawing-shapes.adoc +++ b/docs/examples/drawing-shapes.adoc @@ -44,12 +44,12 @@ stroke % Draw the outline <7> showpage ---- <1> Define position and size as variables for easy modification -<2> Use link:../commands/path-construction/newpath/[`newpath`] to start a new path -<3> Use link:../commands/path-construction/moveto/[`moveto`] to position at starting point -<4> Use link:../commands/path-construction/rlineto/[`rlineto`] for relative line drawing -<5> Use link:../commands/path-construction/closepath/[`closepath`] to complete the shape -<6> Use link:../commands/graphics-state/setlinewidth/[`setlinewidth`] to control line thickness -<7> Use link:../commands/painting/stroke/[`stroke`] to draw the outlined path +<2> Use link:/commands/references/path-construction/newpath/[`newpath`] to start a new path +<3> Use link:/commands/references/path-construction/moveto/[`moveto`] to position at starting point +<4> Use link:/commands/references/path-construction/rlineto/[`rlineto`] for relative line drawing +<5> Use link:/commands/references/path-construction/closepath/[`closepath`] to complete the shape +<6> Use link:/commands/references/graphics-state/setlinewidth/[`setlinewidth`] to control line thickness +<7> Use link:/commands/references/painting/stroke/[`stroke`] to draw the outlined path ==== Expected Output @@ -71,8 +71,8 @@ PostScript provides convenience operators for rectangles: showpage ---- -<1> Use link:../commands/painting/rectstroke/[`rectstroke`] to draw rectangle outline -<2> Use link:../commands/painting/rectfill/[`rectfill`] to draw filled rectangle +<1> Use link:/commands/references/painting/rectstroke/[`rectstroke`] to draw rectangle outline +<2> Use link:/commands/references/painting/rectfill/[`rectfill`] to draw filled rectangle === Circle and Ellipse @@ -139,11 +139,11 @@ grestore showpage ---- -<1> Use link:../commands/path-construction/arc/[`arc`] with center, radius, and angle range (degrees) -<2> Use link:../commands/graphics-state/setgray/[`setgray`] to set fill color (0=black, 1=white) -<3> Use link:../commands/painting/fill/[`fill`] to paint the interior -<4> Use link:../commands/transformations/translate/[`translate`] to move coordinate origin -<5> Use link:../commands/transformations/scale/[`scale`] to create ellipse from circle +<1> Use link:/commands/references/path-construction/arc/[`arc`] with center, radius, and angle range (degrees) +<2> Use link:/commands/references/graphics-state/setgray/[`setgray`] to set fill color (0=black, 1=white) +<3> Use link:/commands/references/painting/fill/[`fill`] to paint the interior +<4> Use link:/commands/references/transformations/translate/[`translate`] to move coordinate origin +<5> Use link:/commands/references/transformations/scale/[`scale`] to create ellipse from circle <6> Partial arc from 45° to 225° (180° arc) <7> Line to center point (0,0 after translation) for pie slice @@ -159,7 +159,7 @@ showpage ==== Arc Direction * `arc` draws counter-clockwise from start angle to end angle -* Use link:../commands/path-construction/arcn/[`arcn`] for clockwise arcs +* Use link:/commands/references/path-construction/arcn/[`arcn`] for clockwise arcs * Angles are measured from the positive X-axis === Triangles and Polygons @@ -301,8 +301,8 @@ showpage ---- <1> Use trigonometry: height = base × tan(60°) ≈ base × 0.866 <2> Start at top point (0, 60) from translated origin -<3> Use link:../commands/control-flow/for/[`for`] loop to repeat vertices -<4> Use link:../commands/transformations/rotate/[`rotate`] to position for next vertex +<3> Use link:/commands/references/control-flow/for/[`for`] loop to repeat vertices +<4> Use link:/commands/references/transformations/rotate/[`rotate`] to position for next vertex <5> Starting at (radius, 0) simplifies the math <6> Fill first, then stroke to get outline on top of fill <7> 144° rotation creates star points (alternate vertices) @@ -438,11 +438,11 @@ grestore showpage ---- -<1> Use link:../commands/path-construction/curveto/[`curveto`] with two control points and end point +<1> Use link:/commands/references/path-construction/curveto/[`curveto`] with two control points and end point <2> Chain multiple curves for smooth continuous paths -<3> Use link:../commands/graphics-state/setrgbcolor/[`setrgbcolor`] for red, green, blue colors +<3> Use link:/commands/references/graphics-state/setrgbcolor/[`setrgbcolor`] for red, green, blue colors <4> RGB values: (0, 0.5, 0) for green -<5> Use link:../commands/path-construction/arcn/[`arcn`] for clockwise arcs +<5> Use link:/commands/references/path-construction/arcn/[`arcn`] for clockwise arcs ==== Expected Output @@ -597,8 +597,8 @@ grestore showpage ---- -<1> link:../commands/painting/stroke/[`stroke`] draws only the path outline -<2> link:../commands/painting/fill/[`fill`] paints only the interior +<1> link:/commands/references/painting/stroke/[`stroke`] draws only the path outline +<2> link:/commands/references/painting/fill/[`fill`] paints only the interior <3> Fill first to keep it under the stroke <4> Stroke second to draw outline on top <5> Both `fill` and `stroke` consume the path @@ -608,9 +608,9 @@ showpage <9> `[5 5]` means 5-point dash, 5-point gap <10> `[10 5 2 5]` means 10-point dash, 5-point gap, 2-point dash, 5-point gap <11> Loop through each style pattern -<12> Use link:../commands/graphics-state/setdash/[`setdash`] to apply dash pattern -<13> Use link:../commands/graphics-state/setlinecap/[`setlinecap`]: 0=butt, 1=round, 2=square -<14> Use link:../commands/graphics-state/setlinejoin/[`setlinejoin`]: 0=miter, 1=round, 2=bevel +<12> Use link:/commands/references/graphics-state/setdash/[`setdash`] to apply dash pattern +<13> Use link:/commands/references/graphics-state/setlinecap/[`setlinecap`]: 0=butt, 1=round, 2=square +<14> Use link:/commands/references/graphics-state/setlinejoin/[`setlinejoin`]: 0=miter, 1=round, 2=bevel ==== Expected Output @@ -1000,9 +1000,9 @@ grestore showpage ---- -<1> link:../commands/transformations/translate/[`translate`] moves the origin -<2> link:../commands/transformations/rotate/[`rotate`] rotates subsequent drawings -<3> link:../commands/transformations/scale/[`scale`] changes size (x-scale y-scale) +<1> link:/commands/references/transformations/translate/[`translate`] moves the origin +<2> link:/commands/references/transformations/rotate/[`rotate`] rotates subsequent drawings +<3> link:/commands/references/transformations/scale/[`scale`] changes size (x-scale y-scale) <4> Gradual scaling creates spiral effect ==== Expected Output @@ -1275,12 +1275,12 @@ Shapes filled with various patterns: === See Also -* link:/docs/examples/hello-world/[Hello World] - Basic PostScript structure -* link:/docs/examples/text-layout/[Text Layout] - Combining text with shapes -* link:/docs/examples/color-gradients/[Color Gradients] - Advanced coloring -* link:/docs/commands/references/[Path Construction] - Path building commands -* link:/docs/commands/references/[Painting] - Fill and stroke operations -* link:/docs/commands/references/[Transformations] - Geometric transforms -* link:/docs/levels/level-2/[Level 2] - Pattern fills and advanced features -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/hello-world/[Hello World] - Basic PostScript structure +* link:/examples/text-layout/[Text Layout] - Combining text with shapes +* link:/examples/color-gradients/[Color Gradients] - Advanced coloring +* link:/commands/references/[Path Construction] - Path building commands +* link:/commands/references/[Painting] - Fill and stroke operations +* link:/commands/references/[Transformations] - Geometric transforms +* link:/levels/level-2/[Level 2] - Pattern fills and advanced features +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/examples/hello-world.adoc b/docs/examples/hello-world.adoc index e8d2f97..90e990f 100644 --- a/docs/examples/hello-world.adoc +++ b/docs/examples/hello-world.adoc @@ -29,11 +29,11 @@ setfont % Make it the current font <3> (Hello, World!) show % Display the text <5> showpage % Output the page <6> ---- -<1> Use link:../commands/font-text/findfont/[`findfont`] to locate the Courier font -<2> Use link:../commands/font-text/scalefont/[`scalefont`] to set the size to 12 points -<3> Use link:../commands/font-text/setfont/[`setfont`] to activate the font -<4> Use link:../commands/path-construction/moveto/[`moveto`] to position the cursor (72 points = 1 inch) -<5> Use link:../commands/font-text/show/[`show`] to render the text +<1> Use link:/commands/references/findfont/[`findfont`] to locate the Courier font +<2> Use link:/commands/references/scalefont/[`scalefont`] to set the size to 12 points +<3> Use link:/commands/references/setfont/[`setfont`] to activate the font +<4> Use link:/commands/references/moveto/[`moveto`] to position the cursor (72 points = 1 inch) +<5> Use link:/commands/references/show/[`show`] to render the text <6> Use `showpage` to output the page to the device ==== Expected Output @@ -176,9 +176,9 @@ Demonstrating different text styles, sizes, and alignments. showpage ---- <1> Define a procedure to center text at the current position -<2> Use link:../commands/font-text/stringwidth/[`stringwidth`] to measure text width -<3> Use link:../commands/path-construction/rmoveto/[`rmoveto`] to move back half the width -<4> Use link:../commands/font-text/show/[`show`] to display the centered text +<2> Use link:/commands/references/stringwidth/[`stringwidth`] to measure text width +<3> Use link:/commands/references/rmoveto/[`rmoveto`] to move back half the width +<4> Use link:/commands/references/show/[`show`] to display the centered text <5> Apply centershow to title at horizontal center (4.25 inches = half of 8.5") <6> Left alignment is the default behavior of show <7> Right-align by moving left by the text width before showing @@ -335,20 +335,20 @@ grestore showpage ---- -<1> Use link:../commands/graphics-state/gsave/[`gsave`] to save current graphics state -<2> Use link:../commands/graphics-state/setlinewidth/[`setlinewidth`] to set line thickness -<3> Use link:../commands/path-construction/lineto/[`lineto`] to draw line segments -<4> Use link:../commands/path-construction/closepath/[`closepath`] to complete the shape -<5> Use link:../commands/painting/stroke/[`stroke`] to draw the outlined path -<6> Use link:../commands/graphics-state/grestore/[`grestore`] to restore previous state -<7> Use link:../commands/graphics-state/setgray/[`setgray`] to set gray level (0=black, 1=white) -<8> Use link:../commands/path-construction/rlineto/[`rlineto`] for relative line drawing -<9> Use link:../commands/painting/fill/[`fill`] to fill the enclosed area +<1> Use link:/commands/references/gsave/[`gsave`] to save current graphics state +<2> Use link:/commands/references/setlinewidth/[`setlinewidth`] to set line thickness +<3> Use link:/commands/references/lineto/[`lineto`] to draw line segments +<4> Use link:/commands/references/closepath/[`closepath`] to complete the shape +<5> Use link:/commands/references/stroke/[`stroke`] to draw the outlined path +<6> Use link:/commands/references/grestore/[`grestore`] to restore previous state +<7> Use link:/commands/references/setgray/[`setgray`] to set gray level (0=black, 1=white) +<8> Use link:/commands/references/rlineto/[`rlineto`] for relative line drawing +<9> Use link:/commands/references/fill/[`fill`] to fill the enclosed area <10> Set color back to black (0 gray) for text <11> Define reusable procedure for drawing bullets -<12> Use link:../commands/path-construction/arc/[`arc`] to draw circular shape +<12> Use link:/commands/references/arc/[`arc`] to draw circular shape <13> Call the bullet procedure to draw each bullet point -<14> Use link:../commands/transformations/translate/[`translate`] to change coordinate origin +<14> Use link:/commands/references/translate/[`translate`] to change coordinate origin ==== Expected Output @@ -748,13 +748,13 @@ A complete professional page with: === See Also -* link:/docs/examples/drawing-shapes/[Drawing Shapes] - Creating geometric graphics -* link:/docs/examples/text-layout/[Text Layout] - Advanced typography techniques -* link:/docs/commands/references/show/[show command] - Display text -* link:/docs/commands/references/findfont/[findfont command] - Locate fonts -* link:/docs/commands/references/scalefont/[scalefont command] - Size fonts -* link:/docs/commands/references/gsave/[gsave command] - Save graphics state -* link:/docs/commands/references/stroke/[stroke command] - Draw paths -* link:/docs/commands/references/fill/[fill command] - Fill shapes -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/drawing-shapes/[Drawing Shapes] - Creating geometric graphics +* link:/examples/text-layout/[Text Layout] - Advanced typography techniques +* link:/commands/references/show/[show command] - Display text +* link:/commands/references/findfont/[findfont command] - Locate fonts +* link:/commands/references/scalefont/[scalefont command] - Size fonts +* link:/commands/references/gsave/[gsave command] - Save graphics state +* link:/commands/references/stroke/[stroke command] - Draw paths +* link:/commands/references/fill/[fill command] - Fill shapes +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/examples/image-manipulation.adoc b/docs/examples/image-manipulation.adoc index 53f1338..ba3e5a0 100644 --- a/docs/examples/image-manipulation.adoc +++ b/docs/examples/image-manipulation.adoc @@ -99,8 +99,8 @@ grestore showpage ---- <1> Image data in hexadecimal format (00=black, FF=white) -<2> Use link:../commands/transformations/translate/[`translate`] to position image -<3> Use link:../commands/transformations/scale/[`scale`] to size image in points +<2> Use link:/commands/references/transformations/translate/[`translate`] to position image +<3> Use link:/commands/references/transformations/scale/[`scale`] to size image in points <4> Image dimensions in pixels (width height) <5> Bits per color component (typically 8 for 256 levels) <6> Image transformation matrix [a b c d tx ty] @@ -257,7 +257,7 @@ showpage <1> Larger scale increases image size <2> Different X and Y scales change aspect ratio <3> Rotate coordinate system before scaling -<4> Use link:../commands/transformations/concat/[`concat`] to apply custom matrix +<4> Use link:/commands/references/transformations/concat/[`concat`] to apply custom matrix <5> Negative scale values flip/mirror the image <6> Shear matrix creates pseudo-perspective @@ -495,7 +495,7 @@ grestore showpage ---- -<1> Use link:../commands/painting/clip/[`clip`] to restrict image to shape +<1> Use link:/commands/references/painting/clip/[`clip`] to restrict image to shape <2> Decode specifies how to interpret pixel values <3> Use `imagemask` to render 1-bit images as masks <4> `.setshapealpha` applies soft mask (Level 3) @@ -1280,10 +1280,10 @@ showpage === See Also -* link:/docs/examples/drawing-shapes/[Drawing Shapes] - Clipping paths for images -* link:/docs/examples/color-gradients/[Color Gradients] - Color manipulation -* link:/docs/examples/pdf-generation/[PDF Generation] - Images in PDF -* link:/docs/levels/level-2/[Level 2] - Advanced image features -* link:/docs/levels/level-3/[Level 3] - Transparency and soft masks -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/drawing-shapes/[Drawing Shapes] - Clipping paths for images +* link:/examples/color-gradients/[Color Gradients] - Color manipulation +* link:/examples/pdf-generation/[PDF Generation] - Images in PDF +* link:/levels/level-2/[Level 2] - Advanced image features +* link:/levels/level-3/[Level 3] - Transparency and soft masks +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/examples/index.adoc b/docs/examples/index.adoc index 4a82fbc..505d74a 100644 --- a/docs/examples/index.adoc +++ b/docs/examples/index.adoc @@ -154,6 +154,6 @@ grestore == See Also -* link:/docs/commands/[Command Reference] - Complete operator documentation -* link:/docs/usage/basic/[Basic Usage] - Fundamental concepts -* link:/docs/usage/advanced/[Advanced Usage] - Advanced techniques \ No newline at end of file +* link:/commands/[Command Reference] - Complete operator documentation +* link:/usage/basic/[Basic Usage] - Fundamental concepts +* link:/usage/advanced/[Advanced Usage] - Advanced techniques \ No newline at end of file diff --git a/docs/examples/pdf-generation.adoc b/docs/examples/pdf-generation.adoc index b4e6665..a665703 100644 --- a/docs/examples/pdf-generation.adoc +++ b/docs/examples/pdf-generation.adoc @@ -990,10 +990,10 @@ PDF with comprehensive metadata: === See Also -* link:/docs/examples/hello-world/[Hello World] - Basic PostScript structure -* link:/docs/examples/image-manipulation/[Image Manipulation] - Working with images -* link:/docs/examples/text-layout/[Text Layout] - Document formatting -* link:/docs/levels/level-2/[Level 2] - Advanced features -* link:/docs/levels/level-3/[Level 3] - Latest capabilities -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/hello-world/[Hello World] - Basic PostScript structure +* link:/examples/image-manipulation/[Image Manipulation] - Working with images +* link:/examples/text-layout/[Text Layout] - Document formatting +* link:/levels/level-2/[Level 2] - Advanced features +* link:/levels/level-3/[Level 3] - Latest capabilities +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/examples/text-layout.adoc b/docs/examples/text-layout.adoc index c9e101e..4b7d4d2 100644 --- a/docs/examples/text-layout.adoc +++ b/docs/examples/text-layout.adoc @@ -71,14 +71,14 @@ textwidth 20 string cvs show % Convert number to string <6> showpage ---- -<1> Use link:../commands/font-text/findfont/[`findfont`], link:../commands/font-text/scalefont/[`scalefont`], link:../commands/font-text/setfont/[`setfont`] to prepare font -<2> Use link:../commands/path-construction/moveto/[`moveto`] to position text cursor -<3> Use link:../commands/font-text/show/[`show`] to display the text +<1> Use link:/commands/references/font-text/findfont/[`findfont`], link:/commands/references/font-text/scalefont/[`scalefont`], link:/commands/references/font-text/setfont/[`setfont`] to prepare font +<2> Use link:/commands/references/path-construction/moveto/[`moveto`] to position text cursor +<3> Use link:/commands/references/font-text/show/[`show`] to display the text <4> Use `dup` to duplicate string for width measurement -<5> Use link:../commands/font-text/stringwidth/[`stringwidth`] to measure text dimensions -<6> Use link:../commands/array-string/cvs/[`cvs`] to convert value to string +<5> Use link:/commands/references/font-text/stringwidth/[`stringwidth`] to measure text dimensions +<6> Use link:/commands/references/array-string/cvs/[`cvs`] to convert value to string <7> Define reusable procedure for right alignment -<8> Use link:../commands/path-construction/rmoveto/[`rmoveto`] to move cursor relatively +<8> Use link:/commands/references/path-construction/rmoveto/[`rmoveto`] to move cursor relatively <9> Divide by 2 for centering calculation ==== Expected Output @@ -243,10 +243,10 @@ showpage <3> Subtract line height to move down <4> Define procedure to advance to next line <5> Define procedure to display array of lines -<6> Use link:../commands/array-string/forall/[`forall`] to iterate array +<6> Use link:/commands/references/array-string/forall/[`forall`] to iterate array <7> Justified text adjusts word spacing to fill line width <8> Check if character code is 32 (space character) -<9> Use link:../commands/array-string/getinterval/[`getinterval`] to extract substring +<9> Use link:/commands/references/array-string/getinterval/[`getinterval`] to extract substring <10> Add extra space after each space character ==== Expected Output @@ -617,7 +617,7 @@ showpage ---- <1> Define procedure for text in box with word wrap <2> Position each line with offset -<3> Use link:../commands/array-string/get/[`get`] to retrieve array element +<3> Use link:/commands/references/array-string/get/[`get`] to retrieve array element <4> Define procedure for circular text <5> Calculate rotation angle per character <6> Rotate coordinate system for each character @@ -827,7 +827,7 @@ showpage <6> Move down 2 points for subscript <7> Display large decorative first letter <8> Use `currentpoint` to get position after drop cap -<9> Use link:../commands/graphics-state/setrgbcolor/[`setrgbcolor`] for colored text +<9> Use link:/commands/references/graphics-state/setrgbcolor/[`setrgbcolor`] for colored text <10> Adjust spacing based on font size ==== Expected Output @@ -1056,7 +1056,7 @@ grestore showpage ---- <1> Define outlined (hollow) text procedure -<2> Use link:../commands/font-text/charpath/[`charpath`] to convert text to path +<2> Use link:/commands/references/font-text/charpath/[`charpath`] to convert text to path <3> Fill first, then stroke for dual effect <4> Define shadow text with offset and gray level <5> Shadow offset: (dx, dy), shadow darkness @@ -1067,7 +1067,7 @@ showpage <10> Scale Y-axis to compress text vertically <11> Embossed effect with highlight and shadow <12> Gradient fill requires clipping to text shape -<13> Use link:../commands/painting/clip/[`clip`] to restrict drawing to text outline +<13> Use link:/commands/references/painting/clip/[`clip`] to restrict drawing to text outline ==== Expected Output @@ -1148,12 +1148,12 @@ Various text effects: === See Also -* link:/docs/examples/hello-world/[Hello World] - Basic text display -* link:/docs/examples/drawing-shapes/[Drawing Shapes] - Paths for text effects -* link:/docs/examples/color-gradients/[Color Gradients] - Advanced coloring -* link:/docs/commands/references/show/[show command] - Display text -* link:/docs/commands/references/charpath/[charpath command] - Text to path -* link:/docs/commands/references/stringwidth/[stringwidth command] - Measure text -* link:/docs/commands/references/clip/[clip command] - Clipping paths -* link:/docs/examples/[More Examples] -* link:/docs/commands/[Command Reference] +* link:/examples/hello-world/[Hello World] - Basic text display +* link:/examples/drawing-shapes/[Drawing Shapes] - Paths for text effects +* link:/examples/color-gradients/[Color Gradients] - Advanced coloring +* link:/commands/references/show/[show command] - Display text +* link:/commands/references/charpath/[charpath command] - Text to path +* link:/commands/references/stringwidth/[stringwidth command] - Measure text +* link:/commands/references/clip/[clip command] - Clipping paths +* link:/examples/[More Examples] +* link:/commands/[Command Reference] diff --git a/docs/glossary.adoc b/docs/glossary.adoc index b5fac91..9211cd5 100644 --- a/docs/glossary.adoc +++ b/docs/glossary.adoc @@ -1,64 +1,121 @@ --- layout: default title: Glossary -nav_order: 9 +nav_order: 10 --- == Glossary -Definitions of PostScript-specific terminology. +Common PostScript terminology and concepts. === A -**Array**:: Ordered collection of PostScript objects +**Array**:: An ordered collection of PostScript objects. Arrays can contain any type of object and are created using `[` and `]` brackets or the link:/commands/references/array/[`array`] operator. -**Attribute**:: Property of an object (literal/executable, access permissions) +**ASCII**:: American Standard Code for Information Interchange. PostScript files are typically encoded in ASCII for portability. + +=== B + +**Bézier Curve**:: A smooth curve defined by control points, created with the link:/commands/references/curveto/[`curveto`] operator. + +**BoundingBox**:: The rectangular area that encloses all marks on a page, specified in the document's header comments. === C -**CTM**:: Current Transformation Matrix - transforms user space to device space +**Clipping Path**:: A path that restricts where subsequent painting operations can mark the page. Set with link:/commands/references/clip/[`clip`] or link:/commands/references/eoclip/[`eoclip`]. + +**Current Point**:: The position in user space where the next path construction operator will begin. Set by link:/commands/references/moveto/[`moveto`] and updated by path construction operators. -**Composite Object**:: Object with complex structure (array, string, dictionary) +**CTM (Current Transformation Matrix)**:: The matrix that transforms from user space to device space. Modified by link:/commands/references/translate/[`translate`], link:/commands/references/rotate/[`rotate`], and link:/commands/references/scale/[`scale`]. === D -**Device Space**:: Physical coordinate system of output device +**Device Space**:: The coordinate system of the output device, measured in device pixels. + +**Dictionary**:: A PostScript data structure that associates keys with values. Created with link:/commands/references/dict/[`dict`]. + +**DSC (Document Structuring Conventions)**:: Comments in PostScript files that provide document structure information, starting with `%%`. + +=== E -**Dictionary**:: Key-value data structure for name lookup +**Executable**:: An attribute of PostScript objects indicating they should be executed when encountered. Procedures are executable arrays. -**Dictionary Stack**:: Stack of dictionaries used for name resolution +**Execution Stack**:: The stack that controls the flow of program execution. + +=== F + +**Fill**:: The operation of painting the interior of a path with the current color, using link:/commands/references/fill/[`fill`] or link:/commands/references/eofill/[`eofill`]. + +**Font**:: A collection of character shapes (glyphs) with associated metrics. Accessed with link:/commands/references/findfont/[`findfont`] and activated with link:/commands/references/setfont/[`setfont`]. === G -**Graphics State**:: Collection of parameters affecting graphics operations +**Graphics State**:: The collection of parameters that control how graphics operations affect the page, including current path, color, line width, transformation matrix, etc. + +**Glyph**:: A visual representation of a character in a font. + +=== I + +**Imaging Model**:: PostScript's page description model, consisting of paths, painting, and text operations. + +=== L + +**Literal**:: An attribute of PostScript objects indicating they represent themselves rather than being executed. + +=== M + +**Mark**:: A special object used to delimit arrays and mark positions on the operand stack. Created with link:/commands/references/mark/[`mark`] or `[`. + +=== N + +**Name**:: A PostScript object that serves as an identifier. Names begin with `/` when used literally. === O -**Operand Stack**:: Main data stack for PostScript operations +**Operand Stack**:: The stack where data values are stored and manipulated during PostScript execution. -**Operator**:: Built-in PostScript command +**Operator**:: A built-in PostScript command that performs an operation. === P -**Path**:: Sequence of lines and curves defining a shape +**Packed Array**:: A more memory-efficient, read-only form of array introduced in PostScript Level 2. Created with link:/commands/references/packedarray/[`packedarray`]. + +**Path**:: A sequence of connected and disconnected subpaths that describe shapes. Constructed with operators like link:/commands/references/moveto/[`moveto`] and link:/commands/references/lineto/[`lineto`]. + +**Point**:: A unit of measurement equal to 1/72 of an inch. -**Procedure**:: Executable array containing PostScript code +**Procedure**:: An executable array, typically delimited by `{` and `}`. + +=== R + +**Raster**:: The rectangular array of pixels that forms an image. + +**Resource**:: A named PostScript object such as a font, form, or pattern. === S -**Stack-Based**:: Programming model using LIFO stacks +**Stack**:: A last-in, first-out (LIFO) data structure. PostScript uses multiple stacks including the operand stack, dictionary stack, and execution stack. + +**Stroke**:: The operation of painting along a path with the current line width and color, using link:/commands/references/stroke/[`stroke`]. + +**String**:: A sequence of bytes, typically representing text. Created with parentheses `()` or the link:/commands/references/string/[`string`] operator. + +=== T + +**Token**:: The basic lexical element of PostScript syntax - a name, number, string, or special character sequence. -**Simple Object**:: Object with atomic value (integer, real, boolean) +**Type**:: The classification of a PostScript object (integer, real, boolean, string, name, array, etc.). === U -**User Space**:: Application's coordinate system +**User Space**:: The coordinate system in which PostScript programs operate, independent of the output device. The default has origin at bottom-left with units in points. === V -**VM**:: Virtual Memory - PostScript's memory management system +**VM (Virtual Memory)**:: PostScript's memory management system, supporting both local and global allocation. === See Also -* link:/docs/syntax/[Language Syntax] -* link:/docs/commands/[Command Reference] \ No newline at end of file +* link:/syntax/[Language Syntax] +* link:/commands/[Command Reference] +* link:/levels/[PostScript Levels] \ No newline at end of file diff --git a/docs/index.adoc b/docs/index.adoc index f1fc047..d17d6b3 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -51,89 +51,89 @@ PostScript is a stack-based, interpreted programming language created by Adobe S == Documentation Sections -=== link:/docs/levels/[PostScript Levels] +=== link:/levels/[PostScript Levels] Learn about the evolution of PostScript through its three major versions: -* link:/docs/levels/level-1/[PostScript Level 1] - The original specification -* link:/docs/levels/level-2/[PostScript Level 2] - Color and composite fonts -* link:/docs/levels/level-3/[PostScript Level 3] - Advanced imaging features -* link:/docs/levels/comparison/[Version Comparison] - Feature comparison across levels +* link:/levels/level-1/[PostScript Level 1] - The original specification +* link:/levels/level-2/[PostScript Level 2] - Color and composite fonts +* link:/levels/level-3/[PostScript Level 3] - Advanced imaging features +* link:/levels/comparison/[Version Comparison] - Feature comparison across levels -=== link:/docs/syntax/[Language Syntax] +=== link:/syntax/[Language Syntax] Understanding PostScript's unique syntax and data structures: -* link:/docs/syntax/tokens/[Tokens] - Basic lexical elements -* link:/docs/syntax/objects/[Objects] - Data types and object model -* link:/docs/syntax/operators/[Operators] - Built-in operations -* link:/docs/syntax/procedures/[Procedures] - Executable arrays and user-defined functions -* link:/docs/syntax/arrays/[Arrays] - Ordered collections -* link:/docs/syntax/dictionaries/[Dictionaries] - Key-value associations -* link:/docs/syntax/strings/[Strings] - Text and binary data -* link:/docs/syntax/data-types/[Data Types] - Complete type system +* link:/syntax/tokens/[Tokens] - Basic lexical elements +* link:/syntax/objects/[Objects] - Data types and object model +* link:/syntax/operators/[Operators] - Built-in operations +* link:/syntax/procedures/[Procedures] - Executable arrays and user-defined functions +* link:/syntax/arrays/[Arrays] - Ordered collections +* link:/syntax/dictionaries/[Dictionaries] - Key-value associations +* link:/syntax/strings/[Strings] - Text and binary data +* link:/syntax/data-types/[Data Types] - Complete type system -=== link:/docs/usage/[Usage Guides] +=== link:/usage/[Usage Guides] -==== link:/docs/usage/basic/[Basic Usage] +==== link:/usage/basic/[Basic Usage] Essential concepts for PostScript programming: -* link:/docs/usage/basic/stack-operations/[Stack Operations] - Working with the operand stack -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - User space and device space -* link:/docs/usage/basic/graphics-state/[Graphics State] - Managing rendering parameters -* link:/docs/usage/basic/path-construction/[Path Construction] - Building vector shapes -* link:/docs/usage/basic/painting/[Painting Operations] - Filling and stroking paths +* link:/usage/basic/stack-operations/[Stack Operations] - Working with the operand stack +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - User space and device space +* link:/usage/basic/graphics-state/[Graphics State] - Managing rendering parameters +* link:/usage/basic/path-construction/[Path Construction] - Building vector shapes +* link:/usage/basic/painting/[Painting Operations] - Filling and stroking paths -==== link:/docs/usage/advanced/[Advanced Usage] +==== link:/usage/advanced/[Advanced Usage] Advanced features and techniques: -* link:/docs/usage/advanced/fonts-text/[Fonts and Text] - Typography and text rendering -* link:/docs/usage/advanced/color-spaces/[Color Spaces] - Color models and management -* link:/docs/usage/advanced/patterns/[Patterns] - Tiling patterns and textures -* link:/docs/usage/advanced/forms/[Forms] - Cached graphical objects -* link:/docs/usage/advanced/images/[Images] - Raster image handling -* link:/docs/usage/advanced/device-control/[Device Control] - Output device management -* link:/docs/usage/advanced/file-operations/[File Operations] - File I/O and streams -* link:/docs/usage/advanced/error-handling/[Error Handling] - Exception management -* link:/docs/usage/advanced/resource-management/[Resource Management] - Memory and resources +* link:/usage/advanced/fonts-text/[Fonts and Text] - Typography and text rendering +* link:/usage/advanced/color-spaces/[Color Spaces] - Color models and management +* link:/usage/advanced/patterns/[Patterns] - Tiling patterns and textures +* link:/usage/advanced/forms/[Forms] - Cached graphical objects +* link:/usage/advanced/images/[Images] - Raster image handling +* link:/usage/advanced/device-control/[Device Control] - Output device management +* link:/usage/advanced/file-operations/[File Operations] - File I/O and streams +* link:/usage/advanced/error-handling/[Error Handling] - Exception management +* link:/usage/advanced/resource-management/[Resource Management] - Memory and resources -=== link:/docs/commands/[Command Reference] +=== link:/commands/[Command Reference] Complete reference for all PostScript operators, organized by category: -* link:/docs/commands/references/[Stack Manipulation] - Stack operations -* link:/docs/commands/references/[Arithmetic and Math] - Mathematical operations -* link:/docs/commands/references/[Array and String Operations] - Collection manipulation -* link:/docs/commands/references/[Dictionary Operations] - Key-value store operations -* link:/docs/commands/references/[Graphics State] - Graphics parameters -* link:/docs/commands/references/[Path Construction] - Path building -* link:/docs/commands/references/[Painting] - Rendering operations -* link:/docs/commands/references/[Coordinate Transformations] - CTM operations -* link:/docs/commands/references/[Font and Text] - Typography operators -* link:/docs/commands/references/[Color] - Color operations -* link:/docs/commands/references/[Image] - Image rendering -* link:/docs/commands/references/[Device and Output] - Device control -* link:/docs/commands/references/[File and I/O] - File operations -* link:/docs/commands/references/[Control Flow] - Program flow control -* link:/docs/commands/references/[Resource Management] - VM and resources -* link:/docs/commands/references/[Error Handling] - Error management - -Or browse link:/docs/commands/by-category/[by category] or link:/docs/commands/[alphabetically]. - -=== link:/docs/examples/[Practical Examples] +* link:/commands/references/[Stack Manipulation] - Stack operations +* link:/commands/references/[Arithmetic and Math] - Mathematical operations +* link:/commands/references/[Array and String Operations] - Collection manipulation +* link:/commands/references/[Dictionary Operations] - Key-value store operations +* link:/commands/references/[Graphics State] - Graphics parameters +* link:/commands/references/[Path Construction] - Path building +* link:/commands/references/[Painting] - Rendering operations +* link:/commands/references/[Coordinate Transformations] - CTM operations +* link:/commands/references/[Font and Text] - Typography operators +* link:/commands/references/[Color] - Color operations +* link:/commands/references/[Image] - Image rendering +* link:/commands/references/[Device and Output] - Device control +* link:/commands/references/[File and I/O] - File operations +* link:/commands/references/[Control Flow] - Program flow control +* link:/commands/references/[Resource Management] - VM and resources +* link:/commands/references/[Error Handling] - Error management + +Or browse link:/commands/by-category/[by category] or link:/commands/[alphabetically]. + +=== link:/examples/[Practical Examples] Real-world code examples and use cases: -* link:/docs/examples/hello-world/[Hello World] - Your first PostScript program -* link:/docs/examples/drawing-shapes/[Drawing Shapes] - Creating vector graphics -* link:/docs/examples/text-layout/[Text Layout] - Working with fonts and text -* link:/docs/examples/color-gradients/[Color and Gradients] - Advanced color techniques -* link:/docs/examples/image-manipulation/[Image Manipulation] - Working with raster images -* link:/docs/examples/pdf-generation/[PDF Generation] - Creating PDF documents +* link:/examples/hello-world/[Hello World] - Your first PostScript program +* link:/examples/drawing-shapes/[Drawing Shapes] - Creating vector graphics +* link:/examples/text-layout/[Text Layout] - Working with fonts and text +* link:/examples/color-gradients/[Color and Gradients] - Advanced color techniques +* link:/examples/image-manipulation/[Image Manipulation] - Working with raster images +* link:/examples/pdf-generation/[PDF Generation] - Creating PDF documents -=== link:/docs/glossary/[Glossary] +=== link:/glossary/[Glossary] Definitions of PostScript-specific terminology and concepts. diff --git a/docs/introduction.adoc b/docs/introduction.adoc index 73f3140..1854abe 100644 --- a/docs/introduction.adoc +++ b/docs/introduction.adoc @@ -130,12 +130,12 @@ showpage === Learning Path -1. **Start with basics** - link:/docs/commands/references/[Stack Operations] -2. **Learn arithmetic** - link:/docs/commands/references/[Math Commands] -3. **Understand data** - link:/docs/commands/references/[Arrays and Strings] -4. **Master dictionaries** - link:/docs/commands/references/[Dictionary Operations] -5. **Control flow** - link:/docs/commands/references/[Conditionals and Loops] -6. **Graphics** - link:/docs/commands/references/[Graphics State] and Path Construction +1. **Start with basics** - link:/commands/references/[Stack Operations] +2. **Learn arithmetic** - link:/commands/references/[Math Commands] +3. **Understand data** - link:/commands/references/[Arrays and Strings] +4. **Master dictionaries** - link:/commands/references/[Dictionary Operations] +5. **Control flow** - link:/commands/references/[Conditionals and Loops] +6. **Graphics** - link:/commands/references/[Graphics State] and Path Construction == About This Guide @@ -156,7 +156,7 @@ This reference provides: == See Also -* link:/docs/levels/[PostScript Levels] - Version history and features -* link:/docs/commands/[Command Reference] - Complete operator reference -* link:/docs/syntax/[Language Syntax] - Grammar and structure -* link:/docs/examples/[Examples] - Practical code samples \ No newline at end of file +* link:/levels/[PostScript Levels] - Version history and features +* link:/commands/[Command Reference] - Complete operator reference +* link:/syntax/[Language Syntax] - Grammar and structure +* link:/examples/[Examples] - Practical code samples \ No newline at end of file diff --git a/docs/levels/comparison.adoc b/docs/levels/comparison.adoc index f440a77..fd85e08 100644 --- a/docs/levels/comparison.adoc +++ b/docs/levels/comparison.adoc @@ -73,7 +73,7 @@ Comprehensive comparison of features across PostScript Levels 1, 2, and 3. == See Also -* link:/docs/levels/level-1/[PostScript Level 1] -* link:/docs/levels/level-2/[PostScript Level 2] -* link:/docs/levels/level-3/[PostScript Level 3] -* link:/docs/levels/[PostScript Levels Overview] \ No newline at end of file +* link:/levels/level-1/[PostScript Level 1] +* link:/levels/level-2/[PostScript Level 2] +* link:/levels/level-3/[PostScript Level 3] +* link:/levels/[PostScript Levels Overview] \ No newline at end of file diff --git a/docs/levels/index.adoc b/docs/levels/index.adoc index 7b56735..190ce8a 100644 --- a/docs/levels/index.adoc +++ b/docs/levels/index.adoc @@ -21,22 +21,22 @@ PostScript was developed by Adobe Systems and released in three major levels, ea |=== |Level |Release Year |Key Features -|link:/docs/levels/level-1/[Level 1] +|link:/levels/level-1/[Level 1] |1984 |Original specification with basic imaging model, stack-based execution, vector graphics, and font handling -|link:/docs/levels/level-2/[Level 2] +|link:/levels/level-2/[Level 2] |1990 |Added color extensions, composite fonts, filters, forms, patterns, file system, and performance improvements -|link:/docs/levels/level-3/[Level 3] +|link:/levels/level-3/[Level 3] |1996 |Introduced smooth shading, better color management, improved PDF integration, and additional imaging features |=== == Version Documentation -=== link:/docs/levels/level-1/[PostScript Level 1] +=== link:/levels/level-1/[PostScript Level 1] The original PostScript specification introduced: @@ -47,9 +47,9 @@ The original PostScript specification introduced: * Device independence * Coordinate transformations -link:/docs/levels/level-1/[Read more about Level 1 →] +link:/levels/level-1/[Read more about Level 1 →] -=== link:/docs/levels/level-2/[PostScript Level 2] +=== link:/levels/level-2/[PostScript Level 2] Level 2 extended PostScript with: @@ -63,9 +63,9 @@ Level 2 extended PostScript with: * File system and named resources * Better memory management -link:/docs/levels/level-2/[Read more about Level 2 →] +link:/levels/level-2/[Read more about Level 2 →] -=== link:/docs/levels/level-3/[PostScript Level 3] +=== link:/levels/level-3/[PostScript Level 3] Level 3 added advanced features: @@ -77,11 +77,11 @@ Level 3 added advanced features: * Better device control * Enhanced font support -link:/docs/levels/level-3/[Read more about Level 3 →] +link:/levels/level-3/[Read more about Level 3 →] -== link:/docs/levels/comparison/[Feature Comparison] +== link:/levels/comparison/[Feature Comparison] -For a detailed comparison of features across all three levels, see the link:/docs/levels/comparison/[version comparison table]. +For a detailed comparison of features across all three levels, see the link:/levels/comparison/[version comparison table]. == Compatibility @@ -136,6 +136,6 @@ Declare the PostScript level in your document header: == See Also -* link:/docs/commands/[Command Reference] - Lists which commands are available in each level -* link:/docs/syntax/[Language Syntax] - Core syntax applicable to all levels +* link:/commands/[Command Reference] - Lists which commands are available in each level +* link:/syntax/[Language Syntax] - Core syntax applicable to all levels * https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf[PostScript Language Reference Manual] - Official specification \ No newline at end of file diff --git a/docs/levels/level-1.adoc b/docs/levels/level-1.adoc index 94bf9df..404ef54 100644 --- a/docs/levels/level-1.adoc +++ b/docs/levels/level-1.adoc @@ -63,7 +63,7 @@ Level 1 implementations provide approximately 250 operators covering: == See Also -* link:/docs/levels/level-2/[PostScript Level 2] - Enhanced version -* link:/docs/levels/level-3/[PostScript Level 3] - Latest specification -* link:/docs/levels/comparison/[Version Comparison] - Feature comparison -* link:/docs/levels/[PostScript Levels Overview] \ No newline at end of file +* link:/levels/level-2/[PostScript Level 2] - Enhanced version +* link:/levels/level-3/[PostScript Level 3] - Latest specification +* link:/levels/comparison/[Version Comparison] - Feature comparison +* link:/levels/[PostScript Levels Overview] \ No newline at end of file diff --git a/docs/levels/level-2.adoc b/docs/levels/level-2.adoc index 752944c..8268e00 100644 --- a/docs/levels/level-2.adoc +++ b/docs/levels/level-2.adoc @@ -17,7 +17,7 @@ PostScript Level 2 added significant capabilities while maintaining backward com === Color Support -* **RGB Color**: link:../commands/graphics-state/setrgbcolor/[`setrgbcolor`], `currentrgbcolor` +* **RGB Color**: link:/commands/references/setrgbcolor/[`setrgbcolor`], `currentrgbcolor` * **CMYK Color**: `setcmykcolor`, `currentcmykcolor` * **HSB Color**: `sethsbcolor`, `currenthsbcolor` * **Color Spaces**: `setcolorspace`, `setcolor` @@ -75,7 +75,7 @@ Level 2 maintains full backward compatibility: == See Also -* link:/docs/levels/level-1/[PostScript Level 1] - Original specification -* link:/docs/levels/level-3/[PostScript Level 3] - Latest features -* link:/docs/levels/comparison/[Version Comparison] - Detailed feature comparison -* link:/docs/levels/[PostScript Levels Overview] \ No newline at end of file +* link:/levels/level-1/[PostScript Level 1] - Original specification +* link:/levels/level-3/[PostScript Level 3] - Latest features +* link:/levels/comparison/[Version Comparison] - Detailed feature comparison +* link:/levels/[PostScript Levels Overview] \ No newline at end of file diff --git a/docs/levels/level-3.adoc b/docs/levels/level-3.adoc index 32e64e4..b6a4aa6 100644 --- a/docs/levels/level-3.adoc +++ b/docs/levels/level-3.adoc @@ -7,53 +7,152 @@ nav_order: 3 == PostScript Level 3 -The latest major PostScript specification, released in 1996, adding advanced imaging features and better PDF integration. +Advanced features and optimizations released in 1997, adding better color management, improved imaging, and enhanced performance. == Overview -PostScript Level 3 (also called PostScript 3) builds on Level 2 with enhanced imaging capabilities, better performance, and improved integration with PDF. +PostScript Level 3 builds on Level 2 with enhanced color management, smoother shading, improved font handling, and better performance. It maintains full backward compatibility with Levels 1 and 2. == Key Enhancements -=== Advanced Imaging +=== Color Management -* **Smooth Shading**: Gradient fills without banding -* **DeviceN Color Spaces**: Support for spot colors and high-fidelity color -* **Improved Halftoning**: Better quality screening -* **In-RIP Trapping**: Automatic trapping for prepress +* **ICC-Based Color**: Industry-standard color profiles +* **Device-Independent Color**: Accurate color across devices +* **CIE-Based Color Spaces**: Lab, XYZ color specifications +* **Rendering Intents**: Perceptual, colorimetric, saturation +* **Color Conversion**: Automatic color space conversion -=== PDF Integration +=== Advanced Graphics -* Better compatibility with PDF features -* Improved transparency handling -* Enhanced color management -* Streamlined PDF generation +* **Smooth Shading**: Gradient fills with smooth transitions +* **Shading Patterns**: Type 2 and Type 3 patterns +* **Improved Transparency**: Better blending modes +* **Anti-aliasing**: Smoother rendering of shapes and text +* **Clipping**: Enhanced clipping operations -=== Performance +=== Font Improvements -* Faster execution -* Better memory management -* Optimized font handling -* Improved caching +* **CID-Keyed Fonts**: Better Asian language support +* **Font Subsetting**: Embed only used characters +* **Font Downloading**: Improved incremental downloading +* **OpenType Support**: Enhanced font format compatibility + +=== Performance Enhancements + +* **In-RIP Separations**: Device-side color separation +* **Page Independence**: Parallel page processing +* **Improved Caching**: Better resource utilization +* **Binary Object Sequences**: Faster data transmission +* **Optimized Operators**: Performance-tuned operations === New Features -* Additional color spaces -* Better Unicode support -* Enhanced device control -* Improved error handling +* **Masked Images**: Alpha channel support +* **Image Interpolation**: Smoother image scaling +* **In-line Images**: Embedded image data +* **DeviceN Color**: Multi-channel spot colors +* **Trapping**: Automatic color trapping + +== New Operators + +Level 3 added numerous operators, including: + +* `shfill` - Smooth shading fills +* `setsmoothness` - Control rendering quality +* `setblackgeneration`, `setundercolorremoval` - Color control +* `sethalftone` improvements - Better screening +* Image masking operators +* DeviceN color operators +* Trapping operators +* And many more... + +== Device Features + +=== Page Device Enhancements + +* **Duplex Printing**: Two-sided output control +* **Collation**: Automatic page ordering +* **Media Selection**: Paper size and type +* **Output Management**: Advanced job control +* **Device-Specific Features**: Manufacturer extensions + +=== Imaging Features + +* **Resolution Independence**: Scale without quality loss +* **Spot Color Support**: Multiple ink channels +* **Overprint Control**: Precise ink layering +* **Halftone Screens**: Improved screening algorithms == Backward Compatibility -Level 3 maintains full compatibility with Level 1 and Level 2: +Level 3 maintains complete compatibility: -* All Level 1 operators work unchanged -* All Level 2 operators work unchanged +* All Level 1 and 2 operators work unchanged * Existing programs run without modification +* New features gracefully degrade on older interpreters +* Optional feature detection available + +== Common Use Cases + +=== High-Quality Color Printing + +[source,postscript] +---- +% ICC-based color workflow +[/ICCBased currentdict /IccProfile get] setcolorspace +0.5 0.3 0.8 setcolor +---- + +=== Smooth Gradients + +[source,postscript] +---- +% Smooth shading from blue to red +<< /ShadingType 2 + /ColorSpace /DeviceRGB + /Coords [0 0 100 0] + /Function << /FunctionType 2 + /Domain [0 1] + /C0 [0 0 1] % Blue + /C1 [1 0 0] % Red + /N 1 >> +>> shfill +---- + +=== Image Masking + +[source,postscript] +---- +% Use one image to mask another +/MaskedImage << + /ImageType 3 + /InterLeave 1 + /DataSource imagedata + /MaskDict maskdict +>> def +---- + +== Performance Tips + +TIP: *Use Smooth Shading* - Replace gradient fills with `shfill` for better performance and quality. + +TIP: *Enable In-RIP Separations* - Let the RIP handle color separation for faster processing. + +TIP: *Use Binary Encoding* - Binary object sequences are faster than ASCII. + +== Best Practices + +* Use ICC color profiles for consistent color output +* Leverage smooth shading for gradients +* Take advantage of font subsetting for smaller files +* Use image interpolation for better scaling quality +* Enable anti-aliasing for professional output == See Also -* link:/docs/levels/level-1/[PostScript Level 1] - Original specification -* link:/docs/levels/level-2/[PostScript Level 2] - Color and fonts -* link:/docs/levels/comparison/[Version Comparison] - Feature comparison -* link:/docs/levels/[PostScript Levels Overview] \ No newline at end of file +* link:/levels/level-1/[PostScript Level 1] - Original specification +* link:/levels/level-2/[PostScript Level 2] - Color and composite fonts +* link:/levels/comparison/[Version Comparison] - Detailed feature comparison +* link:/levels/[PostScript Levels Overview] +* link:/commands/[Command Reference] \ No newline at end of file diff --git a/docs/syntax/arrays.adoc b/docs/syntax/arrays.adoc index acfb28e..513a657 100644 --- a/docs/syntax/arrays.adoc +++ b/docs/syntax/arrays.adoc @@ -891,15 +891,15 @@ idx 0 ge idx arr length lt and { === See Also -* link:/docs/syntax/procedures/[Procedures] - Executable arrays -* link:/docs/syntax/objects/[Objects] - Composite object model -* link:/docs/syntax/strings/[Strings] - Similar indexed structure -* link:/docs/syntax/data-types/[Data Types] - Array type details -* link:/docs/commands/references/array/[array] - Create arrays -* link:/docs/commands/references/aload/[aload] - Unpack arrays -* link:/docs/commands/references/astore/[astore] - Pack arrays -* link:/docs/commands/references/get/[get] - Access elements -* link:/docs/commands/references/put/[put] - Modify elements -* link:/docs/commands/references/forall/[forall] - Iterate arrays -* link:/docs/usage/basic/arrays/[Arrays Usage Guide] -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/procedures/[Procedures] - Executable arrays +* link:/syntax/objects/[Objects] - Composite object model +* link:/syntax/strings/[Strings] - Similar indexed structure +* link:/syntax/data-types/[Data Types] - Array type details +* link:/commands/references/array/[array] - Create arrays +* link:/commands/references/aload/[aload] - Unpack arrays +* link:/commands/references/astore/[astore] - Pack arrays +* link:/commands/references/get/[get] - Access elements +* link:/commands/references/put/[put] - Modify elements +* link:/commands/references/forall/[forall] - Iterate arrays +* link:/usage/basic/arrays/[Arrays Usage Guide] +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/data-types.adoc b/docs/syntax/data-types.adoc index 2573093..1c0de79 100644 --- a/docs/syntax/data-types.adoc +++ b/docs/syntax/data-types.adoc @@ -1209,18 +1209,18 @@ obj cvx % To executable === See Also -* link:/docs/syntax/objects/[Objects] - Object model and attributes -* link:/docs/syntax/tokens/[Tokens] - Type literal syntax -* link:/docs/syntax/operators/[Operators] - Type-specific operations -* link:/docs/syntax/strings/[Strings] - String type details -* link:/docs/syntax/arrays/[Arrays] - Array type details -* link:/docs/syntax/dictionaries/[Dictionaries] - Dictionary type details -* link:/docs/syntax/procedures/[Procedures] - Array type as procedures -* link:/docs/commands/references/type/[type] - Get object type -* link:/docs/commands/references/cvi/[cvi] - Convert to integer -* link:/docs/commands/references/cvr/[cvr] - Convert to real -* link:/docs/commands/references/cvs/[cvs] - Convert to string -* link:/docs/commands/references/cvn/[cvn] - Convert to name -* link:/docs/commands/references/cvlit/[cvlit] - Make literal -* link:/docs/commands/references/cvx/[cvx] - Make executable -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/objects/[Objects] - Object model and attributes +* link:/syntax/tokens/[Tokens] - Type literal syntax +* link:/syntax/operators/[Operators] - Type-specific operations +* link:/syntax/strings/[Strings] - String type details +* link:/syntax/arrays/[Arrays] - Array type details +* link:/syntax/dictionaries/[Dictionaries] - Dictionary type details +* link:/syntax/procedures/[Procedures] - Array type as procedures +* link:/commands/references/type/[type] - Get object type +* link:/commands/references/cvi/[cvi] - Convert to integer +* link:/commands/references/cvr/[cvr] - Convert to real +* link:/commands/references/cvs/[cvs] - Convert to string +* link:/commands/references/cvn/[cvn] - Convert to name +* link:/commands/references/cvlit/[cvlit] - Make literal +* link:/commands/references/cvx/[cvx] - Make executable +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/dictionaries.adoc b/docs/syntax/dictionaries.adoc index cb2796f..c1656da 100644 --- a/docs/syntax/dictionaries.adoc +++ b/docs/syntax/dictionaries.adoc @@ -1015,15 +1015,15 @@ Instance /sharedMethod Lookup exec === See Also -* link:/docs/syntax/objects/[Objects] - Dictionary object model -* link:/docs/syntax/arrays/[Arrays] - Similar composite structure -* link:/docs/syntax/procedures/[Procedures] - Local variables with dictionaries -* link:/docs/syntax/operators/[Operators] - Dictionary operators -* link:/docs/syntax/tokens/[Tokens] - Name syntax for keys -* link:/docs/commands/references/dict/[dict] - Create dictionaries -* link:/docs/commands/references/begin/[begin] - Push onto dict stack -* link:/docs/commands/references/end/[end] - Pop from dict stack -* link:/docs/commands/references/def/[def] - Define entries -* link:/docs/commands/references/load/[load] - Look up values -* link:/docs/commands/references/where/[where] - Find definitions -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/objects/[Objects] - Dictionary object model +* link:/syntax/arrays/[Arrays] - Similar composite structure +* link:/syntax/procedures/[Procedures] - Local variables with dictionaries +* link:/syntax/operators/[Operators] - Dictionary operators +* link:/syntax/tokens/[Tokens] - Name syntax for keys +* link:/commands/references/dict/[dict] - Create dictionaries +* link:/commands/references/begin/[begin] - Push onto dict stack +* link:/commands/references/end/[end] - Pop from dict stack +* link:/commands/references/def/[def] - Define entries +* link:/commands/references/load/[load] - Look up values +* link:/commands/references/where/[where] - Find definitions +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/index.adoc b/docs/syntax/index.adoc index 93bfcdf..69241bc 100644 --- a/docs/syntax/index.adoc +++ b/docs/syntax/index.adoc @@ -269,7 +269,7 @@ exec % Execute: pushes 9 == See Also -* link:/docs/commands/[Command Reference] - All operators -* link:/docs/levels/[PostScript Levels] - Version features -* link:/docs/usage/basic/[Basic Usage] - Getting started -* link:/docs/examples/[Examples] - Code samples \ No newline at end of file +* link:/commands/[Command Reference] - All operators +* link:/levels/[PostScript Levels] - Version features +* link:/usage/basic/[Basic Usage] - Getting started +* link:/examples/[Examples] - Code samples \ No newline at end of file diff --git a/docs/syntax/objects.adoc b/docs/syntax/objects.adoc index 291c670..df24176 100644 --- a/docs/syntax/objects.adoc +++ b/docs/syntax/objects.adoc @@ -2,748 +2,347 @@ layout: default title: Objects parent: Language Syntax -nav_order: 4 +nav_order: 2 --- == Objects -Everything in PostScript is an object. Objects are the fundamental data entities that the PostScript interpreter manipulates. Understanding the object model is essential for effective PostScript programming. +Understanding PostScript objects and their attributes. === Overview -PostScript objects have three fundamental attributes: +In PostScript, everything is an **object**. Objects are the fundamental data entities that the PostScript interpreter manipulates. Each object has a **type** and may have **attributes** that control how it behaves. -* **Type**: What kind of object it is (integer, string, array, etc.) -* **Value**: The actual data the object represents -* **Attributes**: Properties that control how the object behaves (literal vs executable, access permissions) +=== Object Types -=== Object Structure - -Every PostScript object consists of these components: - -==== Type - -The type determines the object's structure and the operations that can be performed on it. PostScript defines several built-in types. - -==== Value - -The value is the actual data stored in the object. For simple objects (integers, reals, booleans), the value is stored directly. For composite objects (strings, arrays, dictionaries), the value is stored indirectly through a pointer. - -==== Attributes - -Objects have binary attributes that control their behavior: - -* **Literal vs Executable**: Determines whether the object is executed or treated as data -* **Access Permissions**: Controls read/write/execute access to the object - -=== Object Categories - -PostScript objects are classified into two main categories based on their structure. +PostScript defines several fundamental object types: ==== Simple Objects -Simple objects store their values directly. They are: - -[cols="1,3"] -|=== -| Type | Description - -| Integer -| Whole numbers (-2^31 to 2^31-1 typically) - -| Real -| Floating-point numbers - -| Boolean -| True or false values - -| Mark -| Special stack marker object - -| Null -| Empty object with no value +**Integer**:: Whole numbers in the range -2³¹ to 2³¹-1 ++ +[source,postscript] +---- +42 -17 0 2147483647 +---- -| Operator -| Built-in primitive operations +**Real**:: Floating-point numbers with approximately 7 significant digits ++ +[source,postscript] +---- +3.14 -0.5 6.02e23 1.0E-10 +---- -| Name -| Identifiers (stored internally as integers) +**Boolean**:: Logical true or false values ++ +[source,postscript] +---- +true false +---- -| Save -| VM snapshot for save/restore operations -|=== +**Name**:: Identifiers used to reference other objects ++ +[source,postscript] +---- +/Times-Roman /x /myproc +---- -.Simple object examples +**Null**:: A special object representing no value ++ [source,postscript] ---- -42 % Integer object -3.14 % Real object -true % Boolean object -false % Boolean object -null % Null object -mark % Mark object (also written as [) +null ---- ==== Composite Objects -Composite objects store their values indirectly through pointers. They are: - -[cols="1,3"] -|=== -| Type | Description - -| String -| Sequence of 8-bit characters or bytes - -| Array -| Ordered collection of objects - -| Dictionary -| Associative array (key-value pairs) - -| File -| Input/output stream - -| Font -| Font dictionary (special dictionary type) - -| Gstate -| Graphics state (Level 2+) - -| Packed Array -| Space-efficient array (Level 2+) -|=== - -.Composite object examples +**String**:: Sequence of bytes, typically representing text ++ [source,postscript] ---- -(Hello) % String object -[1 2 3] % Array object -<< /a 1 /b 2 >> % Dictionary object (Level 2+) +(Hello, World!) +<48656C6C6F> % Hexadecimal string ---- -=== Literal vs Executable - -One of the most important object attributes is whether an object is literal or executable. - -==== Literal Objects - -Literal objects are treated as data and are not executed by the interpreter. They are simply pushed onto the operand stack. - -.Creating literal objects +**Array**:: Ordered collection of objects ++ [source,postscript] ---- -/name % Literal name (slash prefix) -42 % Literal integer -3.14 % Literal real -(string) % Literal string -true % Literal boolean -[1 2 3] % Literal array (created by [ ... ]) -{ /x 5 def } % Executable array (procedure) +[1 2 3] +[/name 42 (text)] ---- -==== Executable Objects - -Executable objects cause the interpreter to perform some action when encountered during execution. - -.Executable object types +**Dictionary**:: Associative array mapping keys to values ++ [source,postscript] ---- -name % Executable name (looked up and executed) -{ code } % Executable array (procedure) -add % Operator (always executable) +<< /FontName /Times-Roman /FontSize 12 >> ---- -==== Attribute Conversion - -Objects can be converted between literal and executable forms. - -.Converting between literal and executable +**Procedure**:: Executable array (code block) ++ [source,postscript] ---- -% Make object executable -/myname cvx % Returns executable name myname - -% Make object literal -add cvlit % Returns literal operator /add - -% Check if executable -{ } xcheck % Returns true (procedures are executable) -/name xcheck % Returns false (literal names are not) +{ dup mul } % Square a number ---- -=== Access Permissions - -Composite objects have access permission attributes that control operations on them. - -==== Permission Types +==== Special Objects -[cols="1,3"] -|=== -| Permission | Description - -| Read-only -| Object can be read but not modified - -| Write -| Object can be read and modified - -| Execute-only -| Object can be executed but not read (arrays/strings only) - -| No access -| Object cannot be accessed (internal system objects) -|=== - -==== Checking Permissions - -.Permission checking operators +**Mark**:: Stack delimiter used in array construction ++ [source,postscript] ---- -(string) rcheck % Check if readable (returns true) -(string) wcheck % Check if writable (returns true) -{ code } xcheck % Check if executable (returns true) - -% Arrays can be execute-only -/procarray [1 2 3] cvx def -procarray executeonly % Make execute-only -procarray rcheck % Returns false -procarray xcheck % Returns true +mark % or equivalently [ ---- -==== Permission Restrictions - -.Setting restricted access +**Operator**:: Built-in PostScript command ++ [source,postscript] ---- -% Make array read-only -[1 2 3] readonly -dup 0 99 put % Causes invalidaccess error - -% Make string execute-only -(code) executeonly -dup length % Causes invalidaccess error +add sub moveto show ---- -=== Object Comparison - -Objects can be compared for equality and identity. - -==== Value Equality (eq) - -The `eq` operator compares objects for value equality. For simple objects, it compares values. For composite objects, it compares references. - -.Equality comparison +**File**:: Input/output stream ++ [source,postscript] ---- -% Simple objects - compare values -42 42 eq % Returns true -3.14 3.14 eq % Returns true -true true eq % Returns true - -% Composite objects - compare references -(abc) (abc) eq % Returns false (different objects) -[1 2] [1 2] eq % Returns false (different arrays) - -% Same object -/s (abc) def -s s eq % Returns true (same reference) +currentfile +(myfile.ps) (r) file ---- -==== Type Equality (type) - -The `type` operator returns the type of an object. - -.Type checking +**Save**:: VM snapshot for state restoration ++ [source,postscript] ---- -42 type % Returns /integertype -3.14 type % Returns /realtype -(abc) type % Returns /stringtype -[1 2] type % Returns /arraytype -{ } type % Returns /arraytype (procedures are arrays) -/name type % Returns /nametype -true type % Returns /booleantype +save % Returns save object ---- -=== Object Lifecycle - -Understanding how objects are created, used, and destroyed is important for memory management. - -==== Object Creation - -Objects are created in various ways: - -.Object creation methods +**Font**:: Character shape collection ++ [source,postscript] ---- -% Literals create objects directly -42 % Creates integer -(string) % Creates string - -% Operators create objects -3 string % Creates 3-byte string -5 array % Creates 5-element array -10 dict % Creates dictionary with capacity 10 - -% Procedures create objects -{ 1 2 add } % Creates executable array +/Times-Roman findfont % Returns font dictionary ---- -==== Object Storage - -Objects are stored in memory areas called VM (Virtual Memory). +=== Object Attributes -[cols="1,3"] -|=== -| Memory Type | Description +Each object has attributes that control its behavior: -| Local VM -| Temporary storage, discarded after job +==== Literal vs. Executable -| Global VM -| Persistent storage, survives jobs (Level 2+) - -| System VM -| Read-only storage for built-in objects -|=== - -.VM allocation +**Literal**:: The object represents itself ++ [source,postscript] ---- -% Check current VM mode -currentglobal % Returns true if global, false if local - -% Set VM allocation mode (Level 2+) -true setglobal % Allocate in global VM -false setglobal % Allocate in local VM - -% Objects allocated in current VM -10 array % Created in current VM mode +/name % Literal name +(text) % Literal string +[1 2 3] % Literal array ---- -==== Object Lifetime - -Object lifetime depends on references and garbage collection. - -.Object reference example +**Executable**:: The object is executed when encountered ++ [source,postscript] ---- -% Create object and store reference -/myarray [1 2 3] def - -% Object stays alive while referenced -myarray 0 get % Access object (OK) - -% Remove reference -/myarray null def - -% Object becomes eligible for garbage collection -% (automatically reclaimed by interpreter) +name % Executable name (looks up and executes) +{ add } % Executable array (procedure) ---- -==== Garbage Collection - -The PostScript interpreter automatically reclaims memory from unreferenced objects. +Convert between literal and executable: -.Garbage collection behavior [source,postscript] ---- -% Force garbage collection (Level 2+) -vmreclaim % Reclaim VM - -% Check VM usage -vmstatus % Returns VM statistics -pop pop % Discard level and maximum - % Leaves used bytes on stack +/name cvx % Make name executable +{ code } cvlit % Make procedure literal ---- -=== Object Type Hierarchy +==== Access Attributes -PostScript's type system forms a hierarchy based on object characteristics. +**No Access**:: Cannot be accessed +**Read-Only**:: Can be read but not modified +**Execute-Only**:: Can only be executed (for arrays) +**Unlimited**:: Can be read, written, and executed -==== Type Classification +Check and modify access: -[source,text] +[source,postscript] ---- -All Objects -├── Simple Objects -│ ├── Numeric -│ │ ├── Integer -│ │ └── Real -│ ├── Boolean -│ ├── Name -│ ├── Operator -│ ├── Mark -│ ├── Null -│ └── Save -└── Composite Objects - ├── Collections - │ ├── String - │ ├── Array - │ ├── Packed Array (Level 2+) - │ └── Dictionary - ├── I/O - │ └── File - └── Graphics - ├── Font - └── Gstate (Level 2+) +dict rcheck % Check if readable +dict wcheck % Check if writable +dict xcheck % Check if executable +dict readonly % Make read-only +dict executeonly % Make execute-only (arrays) ---- -==== Type Conversion +=== Type Checking -Objects can be converted between compatible types. +Get an object's type: -.Type conversion operators [source,postscript] ---- -% Numeric conversions -3.14 cvi % Real to integer: 3 -42 cvr % Integer to real: 42.0 +42 type % Returns: /integertype +3.14 type % Returns: /realtype +(text) type % Returns: /stringtype +[1 2 3] type % Returns: /arraytype +{ add } type % Returns: /arraytype (procedures are arrays) +/name type % Returns: /nametype +true type % Returns: /booleantype +null type % Returns: /nulltype +---- -% String conversions -42 10 string cvs % Integer to string: (42) -/name 10 string cvs % Name to string: (name) +=== Type Conversion -% Name conversions -(myname) cvn % String to name: /myname +Convert between types: -% Literal/executable conversions -/name cvx % Make executable: name -name cvlit % Make literal: /name +[source,postscript] ---- +% String to number +(42) cvi % String to integer: 42 +(3.14) cvr % String to real: 3.14 -=== Object Attributes in Detail +% Number to string +42 20 string cvs % Integer to string: (42) -==== Composite Object Structure +% String to name +(myname) cvn % String to name: /myname -Composite objects have additional internal structure: +% Name to string +/myname 20 string cvs % Name to string: (myname) -.String object structure -[source,text] ----- -String Object: -┌─────────────┬────────────┬─────────────┬──────────────┐ -│ Type: string│ Attributes │ Length: n │ Value: ptr │ -└─────────────┴────────────┴─────────────┴──────────────┘ - │ - ▼ - ┌─────────────┐ - │ char[0] │ - │ char[1] │ - │ ... │ - │ char[n-1] │ - └─────────────┘ ----- +% Integer to real +42 cvr % Integer to real: 42.0 -.Array object structure -[source,text] ----- -Array Object: -┌─────────────┬────────────┬─────────────┬──────────────┐ -│ Type: array │ Attributes │ Length: n │ Value: ptr │ -└─────────────┴────────────┴─────────────┴──────────────┘ - │ - ▼ - ┌─────────────┐ - │ Object[0] │ - │ Object[1] │ - │ ... │ - │ Object[n-1] │ - └─────────────┘ +% Real to integer +3.14 cvi % Real to integer: 3 (truncated) ---- -==== Shared Subobjects +=== Object Equality -Composite objects can share subobjects: +PostScript has two notions of equality: -.Shared reference example +**Value Equality** (link:/commands/references/eq/[`eq`]):: Objects have the same value ++ [source,postscript] ---- -% Create shared string -/shared (shared data) def - -% Two arrays reference same string -[shared] /arr1 exch def -[shared] /arr2 exch def - -% Modifying through one affects both -arr1 0 get 0 88 put % Change first char to 'X' -arr2 0 get % Returns (Xhared data) +3 3 eq % true +(abc) (abc) eq % false (different string objects) ---- -=== Object Manipulation Patterns - -==== Copying Objects - -.Shallow vs deep copying +**Identity Equality** (link:/commands/references/eq/[`eq`] for simple types):: Objects are the same object ++ [source,postscript] ---- -% Shallow copy - copies references -/orig [1 [2 3] 4] def -orig dup length array copy /shallow exch def +/arr [1 2 3] def +arr arr eq % true (same array) +arr [1 2 3] eq % false (different arrays, same values) +---- -% Modifying shared subobject affects both -orig 1 get 0 99 put % Modify nested array -shallow 1 get 0 get % Returns 99 (shared) +For composite objects, link:/commands/references/eq/[`eq`] tests object identity, not value equality. -% Deep copy requires explicit recursion -% (no built-in deep copy in PostScript) ----- +=== Object Sharing -==== Type-Safe Operations +Composite objects can be shared: -.Checking types before operations [source,postscript] ---- -% Type-safe procedure -/SafeAdd { - % Verify both operands are numbers - exch dup type /integertype eq - 1 index type /integertype eq or - 1 index type /realtype eq - 2 index type /realtype eq or and - { add } - { pop pop (Type Error) print } - ifelse -} def - -42 10 SafeAdd % Works: 52 -42 (x) SafeAdd % Prints: Type Error +/arr1 [1 2 3] def +/arr2 arr1 def % arr2 and arr1 refer to same array +arr1 0 99 put % Modifies both arr1 and arr2 +arr1 == % [99 2 3] +arr2 == % [99 2 3] (same object) ---- -=== Special Object Behaviors - -==== Mark Object +Copy to create independent objects: -The mark object is special - it's used as a stack delimiter. - -.Mark usage [source,postscript] ---- -% Mark delimits array construction -mark 1 2 3 ] % Creates [1 2 3] -[ 1 2 3 ] % Equivalent ([ is mark) - -% Count to mark -mark 10 20 30 counttomark % Returns 3 - -% Clear to mark -mark 1 2 3 cleartomark % Removes all including mark +/arr1 [1 2 3] def +/arr2 arr1 length array def +arr1 arr2 copy pop % Create independent copy +arr1 0 99 put % Only modifies arr1 +arr1 == % [99 2 3] +arr2 == % [1 2 3] (different object) ---- -==== Null Object - -The null object represents "no value" - useful for initialization. +=== Object Memory Management -.Null object usage +**Local VM**:: Objects allocated here are temporary ++ [source,postscript] ---- -% Initialize variable to null -/myvar null def - -% Check for null -myvar null eq % Returns true - -% Null has no type operations -null type % Returns /nulltype +save + /local [1 2 3] def % Local allocation +restore % local is discarded ---- -==== Operator Objects - -Operators are special executable objects bound to built-in primitives. - -.Operator characteristics +**Global VM**:: Objects persist across save/restore ++ [source,postscript] ---- -% Operators are always executable -/add load type % Returns /operatortype -/add load xcheck % Returns true - -% Can't make operator literal -/add load cvlit type % Still returns /operatortype ----- - -=== Object Table - -Complete comparison of object characteristics: - -[cols="1,1,1,1,1,1"] -|=== -| Type | Simple/Composite | Mutable | Literal Form | Executable Form | Default Access - -| Integer -| Simple -| No -| `42` -| N/A -| N/A - -| Real -| Simple -| No -| `3.14` -| N/A -| N/A - -| Boolean -| Simple -| No -| `true`/`false` -| N/A -| N/A - -| Name -| Simple -| No -| `/name` -| `name` -| N/A - -| Operator -| Simple -| No -| N/A -| `add` -| N/A - -| Mark -| Simple -| No -| `mark` -| N/A -| N/A - -| Null -| Simple -| No -| `null` -| N/A -| N/A - -| String -| Composite -| Yes -| `(text)` -| `(text) cvx` -| Read/Write - -| Array -| Composite -| Yes -| `[1 2 3]` -| `{ 1 2 3 }` -| Read/Write - -| Dictionary -| Composite -| Yes -| `<< /a 1 >>` -| N/A -| Read/Write - -| File -| Composite -| Yes -| N/A -| N/A -| Varies - -| Font -| Composite -| Yes -| N/A -| N/A -| Read-only -|=== - -=== Best Practices - -==== Type Safety - -* Always check object types before operations -* Use type-safe wrapper procedures for critical code -* Validate composite object lengths before access - -==== Access Control - -* Use `readonly` to protect data structures -* Use `executeonly` for proprietary code protection -* Check permissions with `rcheck`, `wcheck`, `xcheck` - -==== Memory Management - -* Avoid creating unnecessary temporary objects -* Reuse objects where possible (especially strings and arrays) -* Be aware of object sharing in composite structures -* Let garbage collector reclaim unreferenced objects - -==== Object Lifecycle - -* Don't rely on object destruction timing -* Use save/restore for temporary allocations -* Clear large data structures when no longer needed +true setglobal +/global [1 2 3] def % Global allocation +false setglobal +---- -=== Common Pitfalls +=== Common Patterns -==== Reference vs Value +==== Type Testing -.Objects are passed by reference [source,postscript] ---- -% WRONG - assumes value copy -/modify { 0 99 put } def -[1 2 3] dup modify % Modifies original! +/isarray { % obj => bool + type /arraytype eq +} def -% RIGHT - explicit copy if needed -/modify { dup length array copy 0 99 put } def -[1 2 3] dup modify % Original unchanged +/isstring { % obj => bool + type /stringtype eq +} def ---- -==== Type Confusion +==== Safe Type Conversion -.Name vs string vs operator [source,postscript] ---- -% These are DIFFERENT types: -/add % Name object (literal) -add % Operator object (executable) -(add) % String object - -% Type checking: -/add type % Returns /nametype -add type % Returns /operatortype -(add) type % Returns /stringtype +/safeint { % obj => int or obj + dup type /stringtype eq { + cvi + } if +} def ---- -==== Access Violations +==== Object Copying -.Modifying read-only objects [source,postscript] ---- -% Create read-only array -[1 2 3] readonly /arr exch def +/copyobject { % obj => obj_copy + dup type dup + /arraytype eq { + pop dup length array copy + } { + /stringtype eq { + dup length string copy + } { + % Simple types are values, no copy needed + } ifelse + } ifelse +} def +---- + +=== Best Practices -% WRONG - causes error: -arr 0 99 put % invalidaccess error +TIP: *Check Types* - Use link:/commands/references/type/[`type`] and comparison to validate object types before operations. -% RIGHT - check first: -arr wcheck { - arr 0 99 put -} { - (Array is read-only) print -} ifelse ----- +TIP: *Be Aware of Sharing* - Remember that assignment creates references, not copies, for composite objects. + +TIP: *Use Appropriate Access* - Set proper access attributes to prevent unintended modifications. + +WARNING: *Type Errors* - Operating on wrong types causes [`typecheck`] errors. Always validate types for robustness. === See Also -* link:/docs/syntax/data-types/[Data Types] - Complete type system -* link:/docs/syntax/tokens/[Tokens] - Lexical elements -* link:/docs/syntax/arrays/[Arrays] - Array objects -* link:/docs/syntax/dictionaries/[Dictionaries] - Dictionary objects -* link:/docs/syntax/strings/[Strings] - String objects -* link:/docs/syntax/operators/[Operators] - Object manipulation operators -* link:/docs/commands/references/type/[type] - Get object type -* link:/docs/commands/references/cvlit/[cvlit] - Make literal -* link:/docs/commands/references/cvx/[cvx] - Make executable -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/data-types/[Data Types] +* link:/syntax/arrays/[Arrays] +* link:/syntax/strings/[Strings] +* link:/syntax/dictionaries/[Dictionaries] +* link:/commands/references/type/[type command] +* link:/commands/references/cvx/[cvx command] +* link:/commands/references/cvlit/[cvlit command] diff --git a/docs/syntax/operators.adoc b/docs/syntax/operators.adoc index d0e23f7..1241e73 100644 --- a/docs/syntax/operators.adoc +++ b/docs/syntax/operators.adoc @@ -988,13 +988,13 @@ value dup 0 lt { === See Also -* link:/docs/syntax/procedures/[Procedures] - User-defined executable arrays -* link:/docs/syntax/objects/[Objects] - Object execution model -* link:/docs/syntax/tokens/[Tokens] - Operator name syntax -* link:/docs/syntax/data-types/[Data Types] - Operand types -* link:/docs/commands/references/[Control Flow Commands] -* link:/docs/commands/references/[Stack Manipulation Commands] -* link:/docs/commands/references/[Arithmetic Commands] -* link:/docs/commands/references/[Array and String Commands] -* link:/docs/commands/references/[Dictionary Commands] -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/procedures/[Procedures] - User-defined executable arrays +* link:/syntax/objects/[Objects] - Object execution model +* link:/syntax/tokens/[Tokens] - Operator name syntax +* link:/syntax/data-types/[Data Types] - Operand types +* link:/commands/references/[Control Flow Commands] +* link:/commands/references/[Stack Manipulation Commands] +* link:/commands/references/[Arithmetic Commands] +* link:/commands/references/[Array and String Commands] +* link:/commands/references/[Dictionary Commands] +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/procedures.adoc b/docs/syntax/procedures.adoc index 38e8c97..052da88 100644 --- a/docs/syntax/procedures.adoc +++ b/docs/syntax/procedures.adoc @@ -911,12 +911,12 @@ Arrays of procedures enable dispatch tables and strategy patterns. === See Also -* link:/docs/syntax/arrays/[Arrays] - Array structure and operations -* link:/docs/syntax/operators/[Operators] - Built-in operations -* link:/docs/syntax/dictionaries/[Dictionaries] - Local variable implementation -* link:/docs/syntax/objects/[Objects] - Executable vs literal objects -* link:/docs/commands/references/[Control Flow Commands] -* link:/docs/commands/references/def/[def] - Define procedures -* link:/docs/commands/references/exec/[exec] - Execute procedures -* link:/docs/usage/basic/procedures/[Procedures Usage Guide] -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/arrays/[Arrays] - Array structure and operations +* link:/syntax/operators/[Operators] - Built-in operations +* link:/syntax/dictionaries/[Dictionaries] - Local variable implementation +* link:/syntax/objects/[Objects] - Executable vs literal objects +* link:/commands/references/[Control Flow Commands] +* link:/commands/references/def/[def] - Define procedures +* link:/commands/references/exec/[exec] - Execute procedures +* link:/usage/basic/procedures/[Procedures Usage Guide] +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/strings.adoc b/docs/syntax/strings.adoc index 757dd5e..514b107 100644 --- a/docs/syntax/strings.adoc +++ b/docs/syntax/strings.adoc @@ -929,14 +929,14 @@ Interpolate % Returns (Hello, World!) === See Also -* link:/docs/syntax/tokens/[Tokens] - String token syntax -* link:/docs/syntax/arrays/[Arrays] - Similar indexed structure -* link:/docs/syntax/objects/[Objects] - String object model -* link:/docs/syntax/data-types/[Data Types] - String type details -* link:/docs/commands/references/string/[string] - Create strings -* link:/docs/commands/references/get/[get] - Access bytes -* link:/docs/commands/references/put/[put] - Modify bytes -* link:/docs/commands/references/search/[search] - Find substrings -* link:/docs/commands/references/anchorsearch/[anchorsearch] - Prefix search -* link:/docs/commands/references/cvs/[cvs] - Convert to string -* link:/docs/syntax/[Language Syntax Overview] +* link:/syntax/tokens/[Tokens] - String token syntax +* link:/syntax/arrays/[Arrays] - Similar indexed structure +* link:/syntax/objects/[Objects] - String object model +* link:/syntax/data-types/[Data Types] - String type details +* link:/commands/references/string/[string] - Create strings +* link:/commands/references/get/[get] - Access bytes +* link:/commands/references/put/[put] - Modify bytes +* link:/commands/references/search/[search] - Find substrings +* link:/commands/references/anchorsearch/[anchorsearch] - Prefix search +* link:/commands/references/cvs/[cvs] - Convert to string +* link:/syntax/[Language Syntax Overview] diff --git a/docs/syntax/tokens.adoc b/docs/syntax/tokens.adoc index 9a61deb..dff727c 100644 --- a/docs/syntax/tokens.adoc +++ b/docs/syntax/tokens.adoc @@ -7,602 +7,304 @@ nav_order: 3 == Tokens -Tokens are the basic lexical elements of the PostScript language. The PostScript scanner recognizes five types of tokens: numbers, names, strings, keywords (operators), and comments. +Understanding PostScript's lexical structure and token types. === Overview -PostScript programs consist of sequences of tokens separated by whitespace. The scanner reads characters from the input stream and groups them into tokens according to the syntax rules described in this section. +A **token** is the basic lexical unit of PostScript syntax. The PostScript scanner recognizes several types of tokens, each with specific syntax rules. -Whitespace characters (space, tab, newline, carriage return, form feed, and null) delimit tokens but are otherwise ignored except within comments and strings. +=== Token Types -=== Numbers +==== Numbers -PostScript supports two numeric types: integers and real numbers. +**Integer Numbers**: -==== Integer Numbers - -Integers are whole numbers without a decimal point or exponent. - -.Basic integer syntax [source,postscript] ---- 42 % Decimal integer -17 % Negative integer 0 % Zero -+123 % Explicit positive sign (optional) ++100 % Positive sign optional ---- -==== Real Numbers - -Real numbers contain a decimal point, an exponent, or both. +**Real (Floating-Point) Numbers**: -.Real number syntax [source,postscript] ---- -3.14 % Simple real number --2.5 % Negative real -0.5 % Fractional value -1.0 % Integer value as real +3.14 % Real with decimal point +-0.5 % Negative real +.25 % Leading decimal point optional 6.02e23 % Scientific notation --1.6E-19 % Negative exponent -.5 % Leading decimal point -5. % Trailing decimal point +1.0E-10 % Exponent can be E or e ---- -==== Radix Notation +**Radix Numbers** (Base 2-36): -Numbers can be specified in bases other than 10 using radix notation. - -.Radix notation syntax [source,postscript] ---- -8#177 % Octal (base 8): 127 decimal -16#FF % Hexadecimal (base 16): 255 decimal -2#1010 % Binary (base 2): 10 decimal -36#ZZ % Base 36: 1295 decimal +8#177 % Octal: 127 decimal +16#FF % Hexadecimal: 255 decimal +2#1010 % Binary: 10 decimal ---- -The radix (base) must be between 2 and 36. Digits beyond 9 use letters A-Z (case insensitive). - -==== Number Syntax Rules - -[cols="1,3"] -|=== -| Rule | Description - -| Sign -| Optional `+` or `-` prefix +==== Names -| Radix prefix -| Optional `base#` for non-decimal numbers (base 2-36) +Names are identifiers that can be used literally or as executable objects. -| Integer part -| One or more digits +**Literal Names** (preceded by `/`): -| Decimal point -| Optional `.` for real numbers - -| Fractional part -| Zero or more digits after decimal point - -| Exponent -| Optional `E` or `e` followed by optional sign and digits -|=== - -=== Names - -Names are identifiers used to refer to PostScript objects in dictionaries. There are two forms: literal names and executable names. - -==== Literal Names - -Literal names begin with a forward slash and are treated as data rather than commands. - -.Literal name syntax [source,postscript] ---- -/MyName % Simple literal name -/x % Single character name -/Total-Value % Name with hyphen -/Page_1 % Name with underscore -/!special % Name with special character +/Times-Roman % Font name +/x % Variable name +/myproc % Procedure name ---- -==== Executable Names - -Executable names do not begin with a forward slash. When encountered, the interpreter looks them up in the dictionary stack and executes the associated value. +**Executable Names** (no `/` prefix): -.Executable name syntax [source,postscript] ---- -moveto % Built-in operator name -MyProcedure % User-defined name -x % Variable name -add % Arithmetic operator +add % Operator +moveto % Command +myvar % User-defined name ---- -==== Name Character Set +**Immediately Evaluated Names** (preceded by `//`): -Names can contain any characters except: - -* Whitespace (space, tab, newline, etc.) -* Delimiters: `( ) < > [ ] { } / %` - -Special characters that are allowed: - -* Letters: `A-Z`, `a-z` -* Digits: `0-9` -* Punctuation: `! " # $ & ' * + , - . : ; = ? @ \ ^ _ ` | ~` - -.Valid name examples [source,postscript] ---- -/Name-With-Hyphens -/name_with_underscores -/MixedCase123 -/$special -/@symbol -/version2.0 +//add % Bind to current definition +//gsave % Level 2+ ---- -==== Name Length - -Name length is implementation-dependent but typically: - -* Level 1: Up to 128 characters -* Level 2+: Up to 65,535 characters - -=== Strings - -Strings represent sequences of characters and can be specified using ASCII or hexadecimal notation. - -==== ASCII Strings +==== Strings -ASCII strings are enclosed in parentheses `(` and `)`. +**Regular Strings** (parentheses): -.ASCII string syntax [source,postscript] ---- -(Hello, World!) % Simple string -(Line 1\nLine 2) % String with newline -(Tab\there) % String with tab -(Backslash\\) % Escaped backslash -(Parens \( and \)) % Escaped parentheses -() % Empty string +(Hello, World!) % Simple string +(String with (nested) parens) % Balanced parens +(Line 1\nLine 2) % Escape sequences +(Tab\there) % Tab character ---- -==== Escape Sequences +**Hexadecimal Strings** (angle brackets): -ASCII strings support the following escape sequences: - -[cols="1,2,3"] -|=== -| Sequence | Name | Description - -| `\n` -| Newline -| Line feed (ASCII 10) - -| `\r` -| Return -| Carriage return (ASCII 13) - -| `\t` -| Tab -| Horizontal tab (ASCII 9) - -| `\b` -| Backspace -| Backspace (ASCII 8) - -| `\f` -| Form feed -| Form feed (ASCII 12) - -| `\\` -| Backslash -| Literal backslash - -| `\(` -| Left paren -| Literal left parenthesis - -| `\)` -| Right paren -| Literal right parenthesis - -| `\ddd` -| Octal -| Character with octal code (1-3 digits) - -| `\` -| Line continuation -| Ignored (continues string on next line) -|=== - -.Escape sequence examples [source,postscript] ---- -(First\nSecond) % Two lines -(Value:\t42) % Tab-separated -(\101\102\103) % ABC in octal -(Long string \ -continued here) % Line continuation +<48656C6C6F> % "Hello" in hex +<4142> % "AB" ---- -==== Hexadecimal Strings +==== Arrays -Hexadecimal strings are enclosed in angle brackets `<` and `>`. +**Literal Arrays**: -.Hexadecimal string syntax [source,postscript] ---- -<48656C6C6F> % "Hello" in hex -<4142> % "AB" -<> % Empty string -<416> % Odd digits: padded with 0 -> "A`" -<41 42 43> % Whitespace ignored +[1 2 3] % Integer array +[/name 42 (text)] % Mixed types +[] % Empty array ---- -Each pair of hex digits represents one byte. Whitespace is ignored. If the string contains an odd number of hex digits, the last digit is followed by an implicit 0. - -==== String Nesting - -ASCII strings can contain balanced parentheses without escaping: +**Procedures** (executable arrays): -.Nested parentheses [source,postscript] ---- -(Outer (nested) string) % Balanced parens OK -(Multiple (nested (deep)) levels) % Multiple nesting -(Unbalanced \) needs escape) % Unbalanced needs escape +{ add } % Simple procedure +{ dup mul } % Multiple operations +{ % Multi-line procedure + gsave + 0.5 setgray + fill + grestore +} ---- -=== Comments - -Comments are text that the scanner ignores. PostScript supports a single comment syntax. +==== Dictionaries -==== Comment Syntax +**Dictionary Literals**: -Comments begin with `%` and extend to the end of the line. - -.Comment examples [source,postscript] ---- -% This is a full-line comment - -42 % In-line comment after code +<< /key1 value1 /key2 value2 >> % Dictionary syntax (Level 2+) +---- -/name % Comments can appear anywhere - (value) % on multiple lines +**Dictionary Construction** (Level 1): -%% Special comment convention (often for metadata) +[source,postscript] +---- +5 dict begin + /key1 value1 def + /key2 value2 def +end ---- -==== Structured Comments +==== Special Tokens -By convention, comments beginning with `%%` are used for document structuring: +**Marks**: -.Document structuring comments [source,postscript] ---- -%!PS-Adobe-3.0 % File type identifier -%%Title: My Document % Document title -%%Creator: MyApp 1.0 % Creating application -%%Pages: 5 % Number of pages -%%EndComments % End of header comments +mark % Push mark on stack +[ % Equivalent to mark ---- -These structured comments follow the Document Structuring Conventions (DSC) and are used by document managers and print spoolers. +**Booleans**: -=== Special Characters +[source,postscript] +---- +true % Boolean true +false % Boolean false +---- -Certain characters have special meaning in PostScript syntax. +**Null**: -==== Delimiters +[source,postscript] +---- +null % Null object +---- -These characters delimit tokens and have syntactic meaning: +=== Escape Sequences in Strings -[cols="1,2,3"] +[cols="1,3"] |=== -| Character | Name | Usage +| Sequence | Meaning -| `(` -| Left parenthesis -| Begin ASCII string - -| `)` -| Right parenthesis -| End ASCII string +| `\n` +| Newline (line feed) -| `<` -| Less than -| Begin hex string or dictionary +| `\r` +| Carriage return -| `>` -| Greater than -| End hex string or dictionary +| `\t` +| Horizontal tab -| `[` -| Left bracket -| Begin array literal +| `\b` +| Backspace -| `]` -| Right bracket -| End array literal +| `\f` +| Form feed -| `{` -| Left brace -| Begin procedure +| `\\` +| Backslash -| `}` -| Right brace -| End procedure +| `\(` +| Left parenthesis -| `/` -| Slash -| Introduce literal name +| `\)` +| Right parenthesis -| `%` -| Percent -| Begin comment +| `\ddd` +| Octal character code (1-3 digits) |=== -==== Composite Delimiters +=== Comments -Some delimiters are recognized as pairs: +**Single-Line Comments**: -.Composite delimiter examples [source,postscript] ---- -<< % Begin dictionary (Level 2+) ->> % End dictionary (Level 2+) +% This is a comment +42 % Comment after code ---- -=== Whitespace - -Whitespace separates tokens but is otherwise ignored (except in strings and comments). - -==== Whitespace Characters +**Document Structure Comments** (DSC): -[cols="1,2,2"] -|=== -| Character | Name | ASCII Code - -| Space -| Space -| 32 - -| Tab -| Horizontal tab -| 9 - -| Newline -| Line feed -| 10 - -| Return -| Carriage return -| 13 - -| Form feed -| Form feed -| 12 - -| Null -| Null -| 0 -|=== - -.Whitespace examples [source,postscript] ---- -% These are equivalent: -1 2 add -1 2 add -1 -2 -add +%%Title: My Document +%%Creator: PostScript Guide +%%Pages: 10 ---- -=== Token Scanning Rules - -The PostScript scanner follows these rules when recognizing tokens: +=== Whitespace -. **Whitespace**: Skip all leading whitespace characters -. **Comments**: If `%` is encountered, skip to end of line -. **Strings**: If `(` or `<` is encountered, scan until matching `)` or `>` -. **Names**: If `/` is encountered, scan a literal name -. **Numbers**: If sign or digit is encountered, try to scan a number -. **Keywords/Names**: Otherwise, scan an executable name or keyword +**Whitespace Characters**: -==== Scanning Algorithm +* Space (ASCII 32) +* Tab (ASCII 9) +* Newline (ASCII 10) +* Carriage return (ASCII 13) +* Form feed (ASCII 12) +* Null (ASCII 0) -[source,pseudocode] ----- -1. Skip whitespace -2. If EOF, return end-of-file -3. If '%', skip comment, goto 1 -4. If '(', scan ASCII string -5. If '<', scan hex string or dictionary marker -6. If '[', return array begin marker -7. If ']', return array end marker -8. If '{', return procedure begin marker -9. If '}', return procedure end marker -10. If '/', scan literal name -11. If digit or '+' or '-' or '.', try to scan number -12. Otherwise, scan executable name ----- +Whitespace separates tokens but is otherwise ignored. -=== Immediate Execution +=== Token Delimiters -Some tokens cause immediate action during scanning: +**Delimiter Characters**: -.Immediately executed operators -[source,postscript] +[source] ---- -{ % Push mark and enter procedure mode -} % Exit procedure mode and create array -[ % Push mark for array -] % Create array from mark to top -<< % Push mark for dictionary (Level 2+) ->> % Create dictionary (Level 2+) +( ) < > [ ] { } / % ---- -These tokens are special because they affect the scanner's behavior rather than being treated as ordinary data. - -=== Token Length Limits +These characters terminate tokens and have special meaning. -PostScript implementations impose limits on token length: +=== Name Syntax Rules -[cols="2,1,1"] -|=== -| Token Type | Level 1 | Level 2+ +**Valid Characters in Names**: -| Names -| 128 chars -| 65,535 chars +* Any printable ASCII character except delimiters +* Special characters: `!` `"` `#` `$` `&` `'` `*` `,` `.` `:` `;` `=` `?` `@` `^` `_` `` ` `` `|` `~` -| Strings -| 65,535 bytes -| 65,535 bytes +**Invalid in Names**: -| Numbers -| No limit -| No limit +* Whitespace +* Delimiter characters: `( ) < > [ ] { } / %` -| Keywords -| 128 chars -| 128 chars -|=== +=== Token Parsing -=== Examples +The link:/commands/references/token/[`token`] operator can be used to parse tokens from strings or files: -==== Complete Token Examples - -.Mixed token types [source,postscript] ---- -% Tokens on one line -/x 42 def % Literal name, integer, executable name - -% Real number and string -3.14 (pi) def % Real, string, operator - -% Array with mixed types -[1 2.5 /three (4)] % Integer, real, name, string - -% Hex string -<48656C6C6F> show % Hex string, operator - -% Radix numbers -16#FF 8#377 eq % Hex and octal, both 255 +(42 /name) token % Returns: 42 ( /name) true +( ) token % Returns: false (no tokens) ---- -==== Token Recognition +=== Common Patterns + +==== Parsing Input -.How the scanner parses a line [source,postscript] ---- -100 200 moveto % Three tokens: - % 1. Integer: 100 - % 2. Integer: 200 - % 3. Name: moveto - -/Times-Roman findfont % Three tokens: - % 1. Literal name: /Times-Roman - % 2. Name: findfont - -(Hello) show % Two tokens: - % 1. String: (Hello) - % 2. Name: show +currentfile token { + % Process token on stack +} if ---- -=== Best Practices - -==== Naming Conventions - -* Use descriptive names for user-defined procedures -* Follow convention: `/PascalCase` for procedures, `/lowercase` for variables -* Prefix private names with underscore: `/_internal` -* Use hyphens for compound names: `/My-Long-Name` - -==== Number Usage - -* Use integers for exact values (coordinates, counts) -* Use reals for fractional values (scaling, colors) -* Avoid unnecessary precision: `0.5` not `0.50000000` -* Use radix notation for bit flags: `2#11110000` - -==== String Guidelines - -* Use ASCII strings for text: `(Hello)` -* Use hex strings for binary data: `` -* Escape special characters properly -* Keep strings reasonably short for readability - -==== Comment Style - -* Comment complex procedures -* Use `%%` for document structure -* Place comments above code blocks, not inline (except brief notes) -* Document stack effects in procedure comments +==== String to Number -=== Common Pitfalls - -==== Number Ambiguities - -.Potential confusion [source,postscript] ---- -% These are DIFFERENT: -1.0 % Real number -1 .0 % Integer 1 followed by real 0.0 - -% These are the SAME: -+42 % Explicit positive -42 % Implicit positive - -% Radix confusion -10#10 % Base 10: value is 10 -16#10 % Base 16: value is 16 +(3.14) cvr % Convert string to real: 3.14 +(42) cvi % Convert string to integer: 42 ---- -==== Name vs String +==== Building Names Dynamically -.Important distinction [source,postscript] ---- -/name % Literal name (used as key) -name % Executable name (looked up) -(name) % String (different type entirely) +(myname) cvn % Convert string to name: /myname ---- -==== String Escaping +=== Best Practices -.Common mistakes -[source,postscript] ----- -% WRONG: -(Don't) % Unmatched quote in string +TIP: *Use Meaningful Names* - Choose descriptive names for procedures and variables. -% RIGHT: -(Don\'t) % Escape not needed for apostrophe -(Can't) % Apostrophe OK (not a delimiter) +TIP: *Comment Complex Code* - Use comments to explain non-obvious logic. -% WRONG: -(Path: C:\temp) % Backslash starts escape +TIP: *Consistent Formatting* - Use consistent indentation and spacing for readability. -% RIGHT: -(Path: C:\\temp) % Escaped backslash ----- +WARNING: *Name Length Limits* - While PostScript supports long names, keep them reasonable for maintainability. === See Also -* link:/docs/syntax/objects/[Objects] - PostScript object model -* link:/docs/syntax/data-types/[Data Types] - Complete type system -* link:/docs/syntax/strings/[Strings] - Detailed string documentation -* link:/docs/syntax/operators/[Operators] - Operator execution -* link:/docs/commands/references/cvs/[cvs] - Convert to string -* link:/docs/commands/references/token/[token] - Token scanning -* link:/docs/syntax/[Language Syntax Overview] -* link:/docs/commands/[Command Reference] +* link:/syntax/strings/[Strings] +* link:/syntax/arrays/[Arrays] +* link:/syntax/dictionaries/[Dictionaries] +* link:/syntax/data-types/[Data Types] +* link:/commands/references/token/[token command] diff --git a/docs/usage/advanced/color-spaces.adoc b/docs/usage/advanced/color-spaces.adoc index f8ab874..9f6dc58 100644 --- a/docs/usage/advanced/color-spaces.adoc +++ b/docs/usage/advanced/color-spaces.adoc @@ -971,10 +971,10 @@ grestore === See Also -* link:/docs/usage/basic/graphics-state/[Graphics State] - Color state management -* link:/docs/usage/advanced/patterns/[Patterns] - Color patterns -* link:/docs/commands/references/setrgbcolor/[setrgbcolor] - Set RGB color -* link:/docs/commands/references/setcmykcolor/[setcmykcolor] - Set CMYK color -* link:/docs/commands/references/setgray/[setgray] - Set gray color -* link:/docs/commands/references/sethsbcolor/[sethsbcolor] - Set HSB color -* link:/docs/commands/references/currentrgbcolor/[currentrgbcolor] - Get current RGB +* link:/usage/basic/graphics-state/[Graphics State] - Color state management +* link:/usage/advanced/patterns/[Patterns] - Color patterns +* link:/commands/references/setrgbcolor/[setrgbcolor] - Set RGB color +* link:/commands/references/setcmykcolor/[setcmykcolor] - Set CMYK color +* link:/commands/references/setgray/[setgray] - Set gray color +* link:/commands/references/sethsbcolor/[sethsbcolor] - Set HSB color +* link:/commands/references/currentrgbcolor/[currentrgbcolor] - Get current RGB diff --git a/docs/usage/advanced/device-control.adoc b/docs/usage/advanced/device-control.adoc index 920c0af..97954a1 100644 --- a/docs/usage/advanced/device-control.adoc +++ b/docs/usage/advanced/device-control.adoc @@ -857,9 +857,9 @@ matrix currentmatrix dtransform moveto % Wrong! === See Also -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - Device vs user space -* link:/docs/usage/basic/graphics-state/[Graphics State] - State management -* link:/docs/usage/advanced/file-operations/[File Operations] - Output control -* link:/docs/usage/advanced/resource-management/[Resource Management] - Device resources -* link:/docs/usage/advanced/error-handling/[Error Handling] - Device errors -* link:/docs/commands/references/[Device Output Commands] - Output operators +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - Device vs user space +* link:/usage/basic/graphics-state/[Graphics State] - State management +* link:/usage/advanced/file-operations/[File Operations] - Output control +* link:/usage/advanced/resource-management/[Resource Management] - Device resources +* link:/usage/advanced/error-handling/[Error Handling] - Device errors +* link:/commands/references/[Device Output Commands] - Output operators diff --git a/docs/usage/advanced/error-handling.adoc b/docs/usage/advanced/error-handling.adoc index 573b7d6..eec2db4 100644 --- a/docs/usage/advanced/error-handling.adoc +++ b/docs/usage/advanced/error-handling.adoc @@ -1003,8 +1003,8 @@ ErrorHandlingTests { === See Also -* link:/docs/usage/debugging/[Debugging] - Debugging techniques -* link:/docs/usage/advanced/file-operations/[File Operations] - File error handling -* link:/docs/usage/advanced/resource-management/[Resource Management] - Resource errors -* link:/docs/commands/references/[Error Handling Commands] - Error operators -* link:/docs/commands/references/stopped/[stopped] - Error catching +* link:/usage/debugging/[Debugging] - Debugging techniques +* link:/usage/advanced/file-operations/[File Operations] - File error handling +* link:/usage/advanced/resource-management/[Resource Management] - Resource errors +* link:/commands/references/[Error Handling Commands] - Error operators +* link:/commands/references/stopped/[stopped] - Error catching diff --git a/docs/usage/advanced/file-operations.adoc b/docs/usage/advanced/file-operations.adoc index 61e0eb3..36ba8f6 100644 --- a/docs/usage/advanced/file-operations.adoc +++ b/docs/usage/advanced/file-operations.adoc @@ -1175,7 +1175,7 @@ file string readline { === See Also -* link:/docs/usage/advanced/error-handling/[Error Handling] - File operation errors -* link:/docs/usage/advanced/resource-management/[Resource Management] - Managing file resources -* link:/docs/usage/basic/procedures/[Procedures] - File processing procedures -* link:/docs/commands/[Command Reference] - File operators +* link:/usage/advanced/error-handling/[Error Handling] - File operation errors +* link:/usage/advanced/resource-management/[Resource Management] - Managing file resources +* link:/usage/basic/procedures/[Procedures] - File processing procedures +* link:/commands/[Command Reference] - File operators diff --git a/docs/usage/advanced/fonts-text.adoc b/docs/usage/advanced/fonts-text.adoc index 365a22a..f78bceb 100644 --- a/docs/usage/advanced/fonts-text.adoc +++ b/docs/usage/advanced/fonts-text.adoc @@ -1153,12 +1153,12 @@ grestore === See Also -* link:/docs/commands/references/[Font & Text Commands] - Complete command reference -* link:/docs/commands/references/show/[show] - Display text -* link:/docs/commands/references/findfont/[findfont] - Find font -* link:/docs/commands/references/scalefont/[scalefont] - Scale font -* link:/docs/commands/references/setfont/[setfont] - Set current font -* link:/docs/commands/references/stringwidth/[stringwidth] - Measure text -* link:/docs/commands/references/charpath/[charpath] - Text to path -* link:/docs/usage/advanced/color-spaces/[Color Spaces] - Text colors -* link:/docs/usage/basic/graphics-state/[Graphics State] - Text rendering state +* link:/commands/references/[Font & Text Commands] - Complete command reference +* link:/commands/references/show/[show] - Display text +* link:/commands/references/findfont/[findfont] - Find font +* link:/commands/references/scalefont/[scalefont] - Scale font +* link:/commands/references/setfont/[setfont] - Set current font +* link:/commands/references/stringwidth/[stringwidth] - Measure text +* link:/commands/references/charpath/[charpath] - Text to path +* link:/usage/advanced/color-spaces/[Color Spaces] - Text colors +* link:/usage/basic/graphics-state/[Graphics State] - Text rendering state diff --git a/docs/usage/advanced/forms.adoc b/docs/usage/advanced/forms.adoc index 282f474..41e08d6 100644 --- a/docs/usage/advanced/forms.adoc +++ b/docs/usage/advanced/forms.adoc @@ -1166,9 +1166,9 @@ grid exec === See Also -* link:/docs/usage/basic/procedures/[Procedures] - Procedure basics -* link:/docs/usage/advanced/patterns/[Patterns] - Repeating patterns -* link:/docs/usage/advanced/resource-management/[Resource Management] - Optimizing resources -* link:/docs/usage/basic/graphics-state/[Graphics State] - State management -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - Form positioning -* link:/docs/commands/references/exec/[exec] - Execute forms +* link:/usage/basic/procedures/[Procedures] - Procedure basics +* link:/usage/advanced/patterns/[Patterns] - Repeating patterns +* link:/usage/advanced/resource-management/[Resource Management] - Optimizing resources +* link:/usage/basic/graphics-state/[Graphics State] - State management +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - Form positioning +* link:/commands/references/exec/[exec] - Execute forms diff --git a/docs/usage/advanced/images.adoc b/docs/usage/advanced/images.adoc index 21c24a4..7b53f08 100644 --- a/docs/usage/advanced/images.adoc +++ b/docs/usage/advanced/images.adoc @@ -977,9 +977,9 @@ colorimage === See Also -* link:/docs/usage/advanced/color-spaces/[Color Spaces] - Image color models -* link:/docs/usage/advanced/patterns/[Patterns] - Image-based patterns -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - Image transformations -* link:/docs/usage/basic/painting/[Painting] - Image rendering -* link:/docs/usage/advanced/file-operations/[File Operations] - Loading image data -* link:/docs/usage/advanced/resource-management/[Resource Management] - Image memory management +* link:/usage/advanced/color-spaces/[Color Spaces] - Image color models +* link:/usage/advanced/patterns/[Patterns] - Image-based patterns +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - Image transformations +* link:/usage/basic/painting/[Painting] - Image rendering +* link:/usage/advanced/file-operations/[File Operations] - Loading image data +* link:/usage/advanced/resource-management/[Resource Management] - Image memory management diff --git a/docs/usage/advanced/index.adoc b/docs/usage/advanced/index.adoc index 6c00b70..a790d13 100644 --- a/docs/usage/advanced/index.adoc +++ b/docs/usage/advanced/index.adoc @@ -184,6 +184,6 @@ end == See Also -* link:/docs/usage/basic/[Basic Usage] - Start here first -* link:/docs/commands/[Command Reference] - All operators -* link:/docs/examples/[Examples] - Practical code \ No newline at end of file +* link:/usage/basic/[Basic Usage] - Start here first +* link:/commands/[Command Reference] - All operators +* link:/examples/[Examples] - Practical code \ No newline at end of file diff --git a/docs/usage/advanced/patterns.adoc b/docs/usage/advanced/patterns.adoc index 5f64949..a8419c1 100644 --- a/docs/usage/advanced/patterns.adoc +++ b/docs/usage/advanced/patterns.adoc @@ -1181,10 +1181,10 @@ grestore === See Also -* link:/docs/usage/advanced/color-spaces/[Color Spaces] - Pattern colors -* link:/docs/usage/basic/painting/[Painting] - Filling with patterns -* link:/docs/usage/basic/graphics-state/[Graphics State] - Pattern state -* link:/docs/usage/advanced/forms/[Forms] - Cached patterns -* link:/docs/usage/advanced/images/[Images] - Bitmap patterns -* link:/docs/commands/references/fill/[fill] - Fill with pattern -* link:/docs/commands/references/clip/[clip] - Pattern clipping +* link:/usage/advanced/color-spaces/[Color Spaces] - Pattern colors +* link:/usage/basic/painting/[Painting] - Filling with patterns +* link:/usage/basic/graphics-state/[Graphics State] - Pattern state +* link:/usage/advanced/forms/[Forms] - Cached patterns +* link:/usage/advanced/images/[Images] - Bitmap patterns +* link:/commands/references/fill/[fill] - Fill with pattern +* link:/commands/references/clip/[clip] - Pattern clipping diff --git a/docs/usage/advanced/resource-management.adoc b/docs/usage/advanced/resource-management.adoc index bae22fd..43a41a2 100644 --- a/docs/usage/advanced/resource-management.adoc +++ b/docs/usage/advanced/resource-management.adoc @@ -1016,8 +1016,8 @@ restore === See Also -* link:/docs/usage/advanced/error-handling/[Error Handling] - Resource errors -* link:/docs/usage/advanced/file-operations/[File Operations] - File resource management -* link:/docs/usage/basic/procedures/[Procedures] - Procedure optimization -* link:/docs/usage/debugging/[Debugging] - Resource debugging -* link:/docs/usage/advanced/device-control/[Device Control] - Device resources +* link:/usage/advanced/error-handling/[Error Handling] - Resource errors +* link:/usage/advanced/file-operations/[File Operations] - File resource management +* link:/usage/basic/procedures/[Procedures] - Procedure optimization +* link:/usage/debugging/[Debugging] - Resource debugging +* link:/usage/advanced/device-control/[Device Control] - Device resources diff --git a/docs/usage/basic/arrays.adoc b/docs/usage/basic/arrays.adoc index a90a1c6..2a5e8bc 100644 --- a/docs/usage/basic/arrays.adoc +++ b/docs/usage/basic/arrays.adoc @@ -974,12 +974,12 @@ idx arr length lt { === See Also -* link:/docs/syntax/arrays/[Array Syntax] - Array syntax details -* link:/docs/usage/basic/procedures/[Procedures] - Using arrays in procedures -* link:/docs/usage/basic/composite-objects/[Composite Objects] - Complex data structures -* link:/docs/commands/references/array/[array] - Create array -* link:/docs/commands/references/aload/[aload] - Unpack array -* link:/docs/commands/references/astore/[astore] - Pack array -* link:/docs/commands/references/get/[get] - Get element -* link:/docs/commands/references/put/[put] - Set element -* link:/docs/commands/references/forall/[forall] - Iterate array +* link:/syntax/arrays/[Array Syntax] - Array syntax details +* link:/usage/basic/procedures/[Procedures] - Using arrays in procedures +* link:/usage/basic/composite-objects/[Composite Objects] - Complex data structures +* link:/commands/references/array/[array] - Create array +* link:/commands/references/aload/[aload] - Unpack array +* link:/commands/references/astore/[astore] - Pack array +* link:/commands/references/get/[get] - Get element +* link:/commands/references/put/[put] - Set element +* link:/commands/references/forall/[forall] - Iterate array diff --git a/docs/usage/basic/composite-objects.adoc b/docs/usage/basic/composite-objects.adoc index 89787f4..143f263 100644 --- a/docs/usage/basic/composite-objects.adoc +++ b/docs/usage/basic/composite-objects.adoc @@ -1048,9 +1048,9 @@ cache /key1 get % Fast O(1) lookup === See Also -* link:/docs/usage/basic/arrays/[Arrays] - Array operations -* link:/docs/usage/basic/procedures/[Procedures] - Executable arrays -* link:/docs/syntax/dictionaries/[Dictionaries] - Dictionary syntax -* link:/docs/syntax/arrays/[Array Syntax] - Array syntax -* link:/docs/commands/references/[Dictionary Commands] - Dictionary operations -* link:/docs/commands/references/[Array Commands] - Array operations +* link:/usage/basic/arrays/[Arrays] - Array operations +* link:/usage/basic/procedures/[Procedures] - Executable arrays +* link:/syntax/dictionaries/[Dictionaries] - Dictionary syntax +* link:/syntax/arrays/[Array Syntax] - Array syntax +* link:/commands/references/[Dictionary Commands] - Dictionary operations +* link:/commands/references/[Array Commands] - Array operations diff --git a/docs/usage/basic/coordinate-systems.adoc b/docs/usage/basic/coordinate-systems.adoc index 65c2a4e..aa35e84 100644 --- a/docs/usage/basic/coordinate-systems.adoc +++ b/docs/usage/basic/coordinate-systems.adoc @@ -807,9 +807,9 @@ moveto % But moveto expects user coordinates! === See Also -* link:/docs/usage/basic/graphics-state/[Graphics State] - Saving and restoring state -* link:/docs/commands/references/[Transformation Commands] - Complete transformation reference -* link:/docs/commands/references/translate/[translate] - Translation details -* link:/docs/commands/references/scale/[scale] - Scaling details -* link:/docs/commands/references/rotate/[rotate] - Rotation details -* link:/docs/usage/basic/path-construction/[Path Construction] - Building paths in user space +* link:/usage/basic/graphics-state/[Graphics State] - Saving and restoring state +* link:/commands/references/[Transformation Commands] - Complete transformation reference +* link:/commands/references/translate/[translate] - Translation details +* link:/commands/references/scale/[scale] - Scaling details +* link:/commands/references/rotate/[rotate] - Rotation details +* link:/usage/basic/path-construction/[Path Construction] - Building paths in user space diff --git a/docs/usage/basic/graphics-state.adoc b/docs/usage/basic/graphics-state.adoc index b0e89b3..c53665b 100644 --- a/docs/usage/basic/graphics-state.adoc +++ b/docs/usage/basic/graphics-state.adoc @@ -964,10 +964,10 @@ drawSomething % Rotated 90° total! === See Also -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - Transformation matrix details -* link:/docs/usage/basic/painting/[Painting] - Using graphics state for rendering -* link:/docs/commands/references/[Graphics State Commands] - Complete command reference -* link:/docs/commands/references/gsave/[gsave] - Save graphics state -* link:/docs/commands/references/grestore/[grestore] - Restore graphics state -* link:/docs/commands/references/setlinewidth/[setlinewidth] - Set line width -* link:/docs/commands/references/setrgbcolor/[setrgbcolor] - Set RGB color +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - Transformation matrix details +* link:/usage/basic/painting/[Painting] - Using graphics state for rendering +* link:/commands/references/[Graphics State Commands] - Complete command reference +* link:/commands/references/gsave/[gsave] - Save graphics state +* link:/commands/references/grestore/[grestore] - Restore graphics state +* link:/commands/references/setlinewidth/[setlinewidth] - Set line width +* link:/commands/references/setrgbcolor/[setrgbcolor] - Set RGB color diff --git a/docs/usage/basic/index.adoc b/docs/usage/basic/index.adoc index c73c272..9ce4362 100644 --- a/docs/usage/basic/index.adoc +++ b/docs/usage/basic/index.adoc @@ -30,7 +30,7 @@ exch % Stack: 10 20 30 30 pop % Stack: 10 20 30 ---- -See link:/docs/commands/references/[Stack Manipulation Commands] for complete reference. +See link:/commands/references/[Stack Manipulation Commands] for complete reference. === Coordinate Systems @@ -63,7 +63,7 @@ gsave % Save state grestore % Restore state ---- -See link:/docs/commands/references/[Graphics State Commands]. +See link:/commands/references/[Graphics State Commands]. === Path Construction @@ -138,6 +138,6 @@ newpath == See Also -* link:/docs/commands/[Command Reference] - All operators -* link:/docs/usage/advanced/[Advanced Usage] - Advanced techniques -* link:/docs/examples/[Examples] - Code samples \ No newline at end of file +* link:/commands/[Command Reference] - All operators +* link:/usage/advanced/[Advanced Usage] - Advanced techniques +* link:/examples/[Examples] - Code samples \ No newline at end of file diff --git a/docs/usage/basic/painting.adoc b/docs/usage/basic/painting.adoc index 110636c..419c2b8 100644 --- a/docs/usage/basic/painting.adoc +++ b/docs/usage/basic/painting.adoc @@ -1010,10 +1010,10 @@ stroke === See Also -* link:/docs/usage/basic/path-construction/[Path Construction] - Building paths -* link:/docs/usage/basic/graphics-state/[Graphics State] - Controlling appearance -* link:/docs/commands/references/[Painting Commands] - Complete command reference -* link:/docs/commands/references/fill/[fill] - Fill path -* link:/docs/commands/references/stroke/[stroke] - Stroke path -* link:/docs/commands/references/clip/[clip] - Set clipping path -* link:/docs/usage/advanced/patterns/[Patterns] - Advanced pattern fills +* link:/usage/basic/path-construction/[Path Construction] - Building paths +* link:/usage/basic/graphics-state/[Graphics State] - Controlling appearance +* link:/commands/references/[Painting Commands] - Complete command reference +* link:/commands/references/fill/[fill] - Fill path +* link:/commands/references/stroke/[stroke] - Stroke path +* link:/commands/references/clip/[clip] - Set clipping path +* link:/usage/advanced/patterns/[Patterns] - Advanced pattern fills diff --git a/docs/usage/basic/path-construction.adoc b/docs/usage/basic/path-construction.adoc index 9c1021d..d9b4409 100644 --- a/docs/usage/basic/path-construction.adoc +++ b/docs/usage/basic/path-construction.adoc @@ -983,10 +983,10 @@ newpath === See Also -* link:/docs/usage/basic/painting/[Painting] - Rendering paths -* link:/docs/usage/basic/coordinate-systems/[Coordinate Systems] - User space coordinates -* link:/docs/commands/references/[Path Construction Commands] - Complete command reference -* link:/docs/commands/references/moveto/[moveto] - Move to point -* link:/docs/commands/references/lineto/[lineto] - Draw line -* link:/docs/commands/references/arc/[arc] - Draw arc -* link:/docs/commands/references/curveto/[curveto] - Draw curve +* link:/usage/basic/painting/[Painting] - Rendering paths +* link:/usage/basic/coordinate-systems/[Coordinate Systems] - User space coordinates +* link:/commands/references/[Path Construction Commands] - Complete command reference +* link:/commands/references/moveto/[moveto] - Move to point +* link:/commands/references/lineto/[lineto] - Draw line +* link:/commands/references/arc/[arc] - Draw arc +* link:/commands/references/curveto/[curveto] - Draw curve diff --git a/docs/usage/basic/procedures.adoc b/docs/usage/basic/procedures.adoc index ce2a217..fbd09a2 100644 --- a/docs/usage/basic/procedures.adoc +++ b/docs/usage/basic/procedures.adoc @@ -1115,10 +1115,10 @@ x 5 add === See Also -* link:/docs/syntax/procedures/[Procedure Syntax] - Syntax details -* link:/docs/usage/basic/arrays/[Arrays] - Array operations -* link:/docs/usage/basic/composite-objects/[Composite Objects] - Complex data structures -* link:/docs/commands/references/[Control Flow Commands] - Control structures -* link:/docs/commands/references/exec/[exec] - Execute procedure -* link:/docs/commands/references/def/[def] - Define procedure -* link:/docs/usage/debugging/[Debugging] - Debugging procedures +* link:/syntax/procedures/[Procedure Syntax] - Syntax details +* link:/usage/basic/arrays/[Arrays] - Array operations +* link:/usage/basic/composite-objects/[Composite Objects] - Complex data structures +* link:/commands/references/[Control Flow Commands] - Control structures +* link:/commands/references/exec/[exec] - Execute procedure +* link:/commands/references/def/[def] - Define procedure +* link:/usage/debugging/[Debugging] - Debugging procedures diff --git a/docs/usage/basic/stack-operations.adoc b/docs/usage/basic/stack-operations.adoc index 16ae32b..336d571 100644 --- a/docs/usage/basic/stack-operations.adoc +++ b/docs/usage/basic/stack-operations.adoc @@ -565,8 +565,8 @@ rgb2bgr % Now: 0.0 0.5 1.0 (BGR) === See Also -* link:/docs/usage/basic/procedures/[Procedures] - Creating reusable code blocks -* link:/docs/usage/basic/arrays/[Arrays] - Working with array objects -* link:/docs/commands/[Command Reference] - Complete operator reference -* link:/docs/syntax/operators/[Operators] - Operator syntax details -* link:/docs/usage/debugging/[Debugging] - Debugging techniques +* link:/usage/basic/procedures/[Procedures] - Creating reusable code blocks +* link:/usage/basic/arrays/[Arrays] - Working with array objects +* link:/commands/[Command Reference] - Complete operator reference +* link:/syntax/operators/[Operators] - Operator syntax details +* link:/usage/debugging/[Debugging] - Debugging techniques diff --git a/docs/usage/debugging.adoc b/docs/usage/debugging.adoc index 1c6d3c1..0c8faa5 100644 --- a/docs/usage/debugging.adoc +++ b/docs/usage/debugging.adoc @@ -903,8 +903,8 @@ someValue debugType === See Also -* link:/docs/usage/error-handling/[Error Handling] - Error management -* link:/docs/usage/advanced/error-handling/[Advanced Error Handling] - Complex error scenarios -* link:/docs/usage/advanced/resource-management/[Resource Management] - Memory debugging -* link:/docs/usage/basic/stack-operations/[Stack Operations] - Stack manipulation -* link:/docs/usage/basic/procedures/[Procedures] - Procedure debugging +* link:/usage/error-handling/[Error Handling] - Error management +* link:/usage/advanced/error-handling/[Advanced Error Handling] - Complex error scenarios +* link:/usage/advanced/resource-management/[Resource Management] - Memory debugging +* link:/usage/basic/stack-operations/[Stack Operations] - Stack manipulation +* link:/usage/basic/procedures/[Procedures] - Procedure debugging diff --git a/docs/usage/error-handling.adoc b/docs/usage/error-handling.adoc index 42a8294..074555d 100644 --- a/docs/usage/error-handling.adoc +++ b/docs/usage/error-handling.adoc @@ -567,14 +567,14 @@ $error /newerror get % Is new error? For more detailed error handling: -* **Debugging** - See link:/docs/usage/debugging/[Debugging Guide] for debugging techniques -* **Advanced Error Handling** - See link:/docs/usage/advanced/error-handling/[Advanced Error Handling] for complex scenarios -* **Resource Management** - See link:/docs/usage/advanced/resource-management/[Resource Management] for resource-related errors +* **Debugging** - See link:/usage/debugging/[Debugging Guide] for debugging techniques +* **Advanced Error Handling** - See link:/usage/advanced/error-handling/[Advanced Error Handling] for complex scenarios +* **Resource Management** - See link:/usage/advanced/resource-management/[Resource Management] for resource-related errors === See Also -* link:/docs/usage/debugging/[Debugging] - Debugging techniques -* link:/docs/usage/advanced/error-handling/[Advanced Error Handling] - Detailed error handling -* link:/docs/usage/advanced/file-operations/[File Operations] - File error handling -* link:/docs/usage/basic/stack-operations/[Stack Operations] - Stack error prevention -* link:/docs/commands/references/stopped/[stopped command] - Error catching operator +* link:/usage/debugging/[Debugging] - Debugging techniques +* link:/usage/advanced/error-handling/[Advanced Error Handling] - Detailed error handling +* link:/usage/advanced/file-operations/[File Operations] - File error handling +* link:/usage/basic/stack-operations/[Stack Operations] - Stack error prevention +* link:/commands/references/stopped/[stopped command] - Error catching operator diff --git a/docs/usage/index.adoc b/docs/usage/index.adoc index d1199b6..cbb3f73 100644 --- a/docs/usage/index.adoc +++ b/docs/usage/index.adoc @@ -10,7 +10,7 @@ Practical guides and tutorials for PostScript programming, from basic concepts t == Sections -=== link:/docs/usage/basic/[Basic Usage] +=== link:/usage/basic/[Basic Usage] Essential concepts every PostScript programmer should know: @@ -20,7 +20,7 @@ Essential concepts every PostScript programmer should know: * Path construction fundamentals * Basic painting operations -=== link:/docs/usage/advanced/[Advanced Usage] +=== link:/usage/advanced/[Advanced Usage] Advanced features and professional techniques: @@ -36,12 +36,12 @@ Advanced features and professional techniques: == Learning Path -**Start Here** → link:/docs/usage/basic/[Basic Usage] +**Start Here** → link:/usage/basic/[Basic Usage] Master the fundamentals before moving to advanced topics. == See Also -* link:/docs/commands/[Command Reference] - Detailed operator documentation -* link:/docs/examples/[Examples] - Working code samples -* link:/docs/syntax/[Syntax] - Language grammar \ No newline at end of file +* link:/commands/[Command Reference] - Detailed operator documentation +* link:/examples/[Examples] - Working code samples +* link:/syntax/[Syntax] - Language grammar \ No newline at end of file diff --git a/index.adoc b/index.adoc deleted file mode 100644 index fae5848..0000000 --- a/index.adoc +++ /dev/null @@ -1,212 +0,0 @@ ---- -layout: default -title: Home -nav_order: 1 ---- -= Home -:description: Comprehensive reference documentation for the PostScript programming language -:keywords: postscript, programming, language, reference, documentation -:page-layout: home -:toc: left -:toclevels: 2 -:sectanchors: - -[.lead] -A comprehensive, searchable reference guide for the PostScript programming language, covering operators, syntax, language levels, and practical usage patterns. - -== Welcome - -PostScript is a page description language developed by Adobe Systems. It is a dynamically typed, concatenative programming language and was the first device-independent page description language. This reference guide provides detailed documentation for PostScript operators, syntax rules, and practical programming techniques. - -== What is PostScript? - -PostScript is a stack-based, interpreted programming language created by Adobe Systems in 1984. It was designed to describe the layout and graphics of a page in a device-independent way, making it the foundation for desktop publishing and electronic document distribution. - -=== Key Features - -* **Device Independence**: PostScript programs produce the same output on any PostScript-compatible device -* **Stack-Based Architecture**: Operations work with a last-in-first-out stack model -* **Turing Complete**: Full programming language with control structures, procedures, and data types -* **Vector Graphics**: Native support for scalable vector graphics and typography -* **Imaging Model**: Sophisticated graphics model supporting paths, fills, strokes, and clipping - -=== History - -[cols="1,4"] -|=== -|Year |Milestone - -|1984 -|PostScript Level 1 released by Adobe Systems - -|1990 -|PostScript Level 2 introduced color extensions and improved performance - -|1996 -|PostScript 3 (Level 3) added advanced features including smooth shading and better PDF integration - -|1993-Present -|PDF (Portable Document Format) emerges as a derivative of PostScript for document exchange -|=== - -== Documentation Sections - -=== xref:docs/levels/index.adoc[PostScript Levels] - -Learn about the evolution of PostScript through its three major versions: - -* xref:docs/levels/level-1.adoc[PostScript Level 1] - The original specification -* xref:docs/levels/level-2.adoc[PostScript Level 2] - Color and composite fonts -* xref:docs/levels/level-3.adoc[PostScript Level 3] - Advanced imaging features -* xref:docs/levels/comparison.adoc[Version Comparison] - Feature comparison across levels - -=== xref:docs/syntax/index.adoc[Language Syntax] - -Understanding PostScript's unique syntax and data structures: - -* xref:docs/syntax/tokens.adoc[Tokens] - Basic lexical elements -* xref:docs/syntax/objects.adoc[Objects] - Data types and object model -* xref:docs/syntax/operators.adoc[Operators] - Built-in operations -* xref:docs/syntax/procedures.adoc[Procedures] - Executable arrays and user-defined functions -* xref:docs/syntax/arrays.adoc[Arrays] - Ordered collections -* xref:docs/syntax/dictionaries.adoc[Dictionaries] - Key-value associations -* xref:docs/syntax/strings.adoc[Strings] - Text and binary data -* xref:docs/syntax/data-types.adoc[Data Types] - Complete type system - -=== xref:docs/usage/index.adoc[Usage Guides] - -==== xref:docs/usage/basic/index.adoc[Basic Usage] - -Essential concepts for PostScript programming: - -* xref:docs/usage/basic/stack-operations.adoc[Stack Operations] - Working with the operand stack -* xref:docs/usage/basic/coordinate-systems.adoc[Coordinate Systems] - User space and device space -* xref:docs/usage/basic/graphics-state.adoc[Graphics State] - Managing rendering parameters -* xref:docs/usage/basic/path-construction.adoc[Path Construction] - Building vector shapes -* xref:docs/usage/basic/painting.adoc[Painting Operations] - Filling and stroking paths - -==== xref:docs/usage/advanced/index.adoc[Advanced Usage] - -Advanced features and techniques: - -* xref:docs/usage/advanced/fonts-text.adoc[Fonts and Text] - Typography and text rendering -* xref:docs/usage/advanced/color-spaces.adoc[Color Spaces] - Color models and management -* xref:docs/usage/advanced/patterns.adoc[Patterns] - Tiling patterns and textures -* xref:docs/usage/advanced/forms.adoc[Forms] - Cached graphical objects -* xref:docs/usage/advanced/images.adoc[Images] - Raster image handling -* xref:docs/usage/advanced/device-control.adoc[Device Control] - Output device management -* xref:docs/usage/advanced/file-operations.adoc[File Operations] - File I/O and streams -* xref:docs/usage/advanced/error-handling.adoc[Error Handling] - Exception management -* xref:docs/usage/advanced/resource-management.adoc[Resource Management] - Memory and resources - -=== xref:docs/commands/index.adoc[Command Reference] - -Complete reference for all PostScript operators, organized by category: - -* xref:docs/commands/stack-manipulation/index.adoc[Stack Manipulation] - Stack operations -* xref:docs/commands/arithmetic-math/index.adoc[Arithmetic and Math] - Mathematical operations -* xref:docs/commands/array-string/index.adoc[Array and String Operations] - Collection manipulation -* xref:docs/commands/dictionary/index.adoc[Dictionary Operations] - Key-value store operations -* xref:docs/commands/graphics-state/index.adoc[Graphics State] - Graphics parameters -* xref:docs/commands/path-construction/index.adoc[Path Construction] - Path building -* xref:docs/commands/painting/index.adoc[Painting] - Rendering operations -* xref:docs/commands/transformations/index.adoc[Coordinate Transformations] - CTM operations -* xref:docs/commands/font-text/index.adoc[Font and Text] - Typography operators -* xref:docs/commands/color/index.adoc[Color] - Color operations -* xref:docs/commands/image/index.adoc[Image] - Image rendering -* xref:docs/commands/device-output/index.adoc[Device and Output] - Device control -* xref:docs/commands/file-io/index.adoc[File and I/O] - File operations -* xref:docs/commands/control-flow/index.adoc[Control Flow] - Program flow control -* xref:docs/commands/resource-management/index.adoc[Resource Management] - VM and resources -* xref:docs/commands/error-handling/index.adoc[Error Handling] - Error management - -Or browse xref:docs/commands/by-category.adoc[by category] or xref:docs/commands/index.adoc[alphabetically]. - -=== xref:docs/examples/index.adoc[Practical Examples] - -Real-world code examples and use cases: - -* xref:docs/examples/hello-world.adoc[Hello World] - Your first PostScript program -* xref:docs/examples/drawing-shapes.adoc[Drawing Shapes] - Creating vector graphics -* xref:docs/examples/text-layout.adoc[Text Layout] - Working with fonts and text -* xref:docs/examples/color-gradients.adoc[Color and Gradients] - Advanced color techniques -* xref:docs/examples/image-manipulation.adoc[Image Manipulation] - Working with raster images -* xref:docs/examples/pdf-generation.adoc[PDF Generation] - Creating PDF documents - -=== xref:docs/glossary.adoc[Glossary] - -Definitions of PostScript-specific terminology and concepts. - -== Quick Start - -=== Hello World - -Here's a simple PostScript program that displays "Hello, World!": - -[source,postscript] ----- -%!PS-Adobe-3.0 -%%Title: Hello World -%%Creator: PostScript Language Reference Guide -%%Pages: 1 -%%EndComments - -/Helvetica findfont % Find the Helvetica font -12 scalefont % Scale to 12 points -setfont % Set as current font - -72 720 moveto % Position at 1 inch from left, 10 inches from bottom -(Hello, World!) show % Display the text - -showpage % Output the page -%%EOF ----- - -=== Basic Drawing Example - -Creating a simple rectangle: - -[source,postscript] ----- -%!PS-Adobe-3.0 - -newpath % Start a new path -100 100 moveto % Move to starting point -200 0 rlineto % Draw line 200 points right -0 150 rlineto % Draw line 150 points up --200 0 rlineto % Draw line 200 points left -closepath % Close the path - -0.5 setgray % Set gray level to 50% -fill % Fill the rectangle - -showpage % Output the page -%%EOF ----- - -== Additional Resources - -=== Official Documentation - -* https://www.adobe.com/products/postscript/pdfs/PLRM.pdf[PostScript Language Reference Manual (PLRM)] - The official specification -* https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf[PostScript Language Tutorial and Cookbook] - -=== External Resources - -* https://en.wikipedia.org/wiki/PostScript[PostScript on Wikipedia] -* https://www.ghostscript.com/[Ghostscript] - Open source PostScript interpreter -* https://www.adobe.com/products/postscript.html[Adobe PostScript Information] - -== Contributing - -This documentation is open source and welcomes contributions. See our https://github.com/claricle/postscript-guide[GitHub repository] for: - -* Reporting errors or omissions -* Suggesting improvements -* Adding examples -* Correcting documentation - ---- - -[.text-center] -_This reference guide is maintained by the Claricle community._ \ No newline at end of file