language reference third edition - · pdf filelanguage reference third edition. ... c.1...

912
Addison-Wesley Publishing Company Reading, Massachusetts • Menlo Park, California • New York • Don Mills, Ontario Harlow, England • Amsterdam • Bonn • Sydney • Singapore • Tokyo Madrid • San Juan • Paris • Seoul • Milan • Mexico City • Taipei Adobe Systems Incorporated PostScript ® LANGUAGE REFERENCE third edition

Upload: vonga

Post on 29-Mar-2018

244 views

Category:

Documents


2 download

TRANSCRIPT

  • Addison-Wesley Publishing Company

    Reading, Massachusetts Menlo Park, California New York Don Mills, OntarioHarlow, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Paris Seoul Milan Mexico City Taipei

    Adobe Systems Incorporated

    PostScriptLANGUAGE REFERENCE

    third edition

  • Library of Congress Cataloging-in-Publication Data

    PostScript language reference manual / Adobe Systems Incorporated. 3rd ed. p. cm.Includes bibliographical references and index.ISBN 0-201-37922-81. PostScript (Computer program language) I. Adobe Systems.QA76.73.P67 P67 1999005.13'3dc21 98-55489

    CIP

    19851999 Adobe Systems Incorporated. All rights reserved.

    NOTICE: All information contained herein is the property of Adobe Systems Incorporated.

    No part of this publication (whether in hardcopy or electronic form) may be reproducedor transmitted, in any form or by any means, electronic, mechanical, photocopying,recording, or otherwise, without the prior written consent of the publisher.

    PostScript is a registered trademark of Adobe Systems Incorporated. All instances of thename PostScript in the text are references to the PostScript language as defined by AdobeSystems Incorporated unless otherwise stated. The name PostScript also is used as a prod-uct trademark for Adobe Systems implementation of the PostScript language interpreter.

    Except as otherwise stated, any mention of a PostScript printer, PostScript software, orsimilar item refers to a product that contains PostScript technology created or licensed byAdobe Systems Incorporated, not to one that purports to be merely compatible.

    Adobe, Adobe Illustrator, Adobe Type Manager, Chameleon, Display PostScript, Frame-Maker, Minion, Myriad, Photoshop, PostScript, PostScript 3, and the PostScript logo aretrademarks of Adobe Systems Incorporated. LocalTalk, QuickDraw, and TrueType aretrademarks and Mac OS is a registered trademark of Apple Computer, Inc. Helvetica andTimes are registered trademarks of Linotype-Hell AG and/or its subsidiaries. Times NewRoman is a trademark of The Monotype Corporation registered in the U.S. Patent andTrademark Office and may be registered in certain other jurisdictions. Unicode is a regis-tered trademark of Unicode, Inc. PANTONE is a registered trademark and Hexachrome isa trademark of Pantone, Inc. Windows is a registered trademark of Microsoft Corporation.All other trademarks are the property of their respective owners.

    This publication and the information herein are furnished AS IS, are subject to changewithout notice, and should not be construed as a commitment by Adobe Systems Incorpo-rated. Adobe Systems Incorporated assumes no responsibility or liability for any errors orinaccuracies, makes no warranty of any kind (express, implied, or statutory) with respectto this publication, and expressly disclaims any and all warranties of merchantability, fit-ness for particular purposes, and noninfringement of third-party rights.

    ISBN 0-201-37922-81 2 3 4 5 6 7 8 9 CRS 03 02 01 00 99First printing February 1999

  • iii

    Contents

    Preface

    xiii

    Chapter 1: Introduction

    1

    1.1 About This Book 31.2 Evolution of the PostScript Language 51.3 LanguageLevel 3 Overview 61.4 Related Publications 71.5 Copyrights and Trademarks 9

    Chapter 2: Basic Ideas

    11

    2.1 Raster Output Devices 112.2 Scan Conversion 122.3 Page Description Languages 132.4 Using the PostScript Language 15

    Chapter 3: Language

    23

    3.1 Interpreter 243.2 Syntax 253.3 Data Types and Objects 343.4 Stacks 453.5 Execution 463.6 Overview of Basic Operators 513.7 Memory Management 563.8 File Input and Output 733.9 Named Resources 873.10 Functions 1063.11 Errors 1143.12 Early Name Binding 1173.13 Filtered Files Details 1233.14 Binary Encoding Details 156

    Chapter 4: Graphics

    175

    4.1 Imaging Model 1764.2 Graphics State 1784.3 Coordinate Systems and Transformations 182

  • Contents

    iv

    4.4 Path Construction 1894.5 Painting 1934.6 User Paths 1974.7 Forms 2064.8 Color Spaces 2104.9 Patterns 2484.10 Images 288

    Chapter 5: Fonts

    313

    5.1 Organization and Use of Fonts 3135.2 Font Dictionaries 3215.3 Character Encoding 3285.4 Glyph Metric Information 3315.5 Font Cache 3335.6 Unique ID Generation 3355.7 Type 3 Fonts 3375.8 Additional Base Font Types 3435.9 Font Derivation and Modification 3485.10 Composite Fonts 3575.11 CID-Keyed Fonts 364

    Chapter 6: Device Control

    391

    6.1 Using Page Devices 3936.2 Page Device Parameters 3986.3 In-RIP Trapping 4396.4 Output Device Dictionary 455

    Chapter 7: Rendering

    457

    7.1 CIE-Based Color to Device Color 4597.2 Conversions among Device Color Spaces 4737.3 Transfer Functions 4787.4 Halftones 4807.5 Scan Conversion Details 501

    Chapter 8: Operators

    505

    8.1 Operator Summary 5088.2 Operator Details 524

    Appendix A: LanguageLevel Feature Summary

    725

    A.1 LanguageLevel 3 Features 725A.2 LanguageLevel 2 Features 731A.3 Incompatibilities 735

  • Contents

    v

    Appendix B: Implementation Limits

    737

    B.1 Typical Limits 738B.2 Virtual Memory Use 742

    Appendix C: Interpreter Parameters

    745

    C.1 Properties of User and System Parameters 746C.2 Defined User and System Parameters 749C.3 Details of User and System Parameters 753C.4 Device Parameters 760

    Appendix D: Compatibility Strategies

    761

    D.1 The LanguageLevel Approach 761D.2 When to Provide Compatibility 763D.3 Compatibility Techniques 765D.4 Installing Emulations 769

    Appendix E: Character Sets and Encoding Vectors

    773

    E.1 Times Family 775E.2 Helvetica Family 776E.3 Courier Family 777E.4 Symbol 778E.5 Standard Latin Character Set 779E.6 StandardEncoding Encoding Vector 784E.7 ISOLatin1Encoding Encoding Vector 785E.8 CE Encoding Vector 786E.9 Expert Character Set 787E.10 Expert Encoding Vector 790E.11 ExpertSubset Encoding Vector 791E.12 Symbol Character Set 792E.13 Symbol Encoding Vector 794

    Appendix F: System Name Encodings

    795

    Appendix G: Operator Usage Guidelines

    801

    Bibliography

    811

    INDEX

    817

  • vii

    Figures

    2.1

    How the PostScript interpreter and an application interact 16

    3.1

    Mapping with the

    Decode

    array 112

    3.2

    Homogeneous number array 161

    3.3

    Binary object sequence 164

    4.1

    The two squares produced by Example 4.1 186

    4.2

    Effects of coordinate transformations 188

    4.3

    Nonzero winding number rule 195

    4.4

    Even-odd rule 196

    4.5

    Color specification 212

    4.6

    Color rendering 213

    4.7

    Component transformations in the

    CIEBasedABC

    color space 222

    4.8

    Component transformations in the

    CIEBasedA

    color space 229

    4.9

    CIEBasedDEFG

    pre-extension to the

    CIEBasedABC

    color space 232

    4.10

    Output from Example 4.21 256

    4.11

    Output from Example 4.23 259

    4.12

    Starting a new triangle in a free-form Gouraud-shaded triangle mesh 272

    4.13

    Connecting triangles in a free-form Gouraud-shaded triangle mesh 272

    4.14

    Varying the value of the edge flag to create different shapes 273

    4.15

    Lattice-form triangular meshes 275

    4.16

    Coordinate mapping from a unit square to a four-sided Coons patch 277

    4.17

    Painted area and boundary of a Coons patch 279

    4.18

    Color values and edge flags in Coons patch meshes 281

    4.19

    Edge connections in a Coons patch mesh 282

    4.20

    Control points in a tensor-product mesh 284

    4.21

    Typical sampled image 288

    4.22

    Image data organization and processing 293

    4.23

    Source image coordinate system 294

    4.24

    Mapping the source image 295

  • Contents

    viii

    5.1

    Results of Example 5.2 317

    5.2

    Glyphs painted in 50% gray 318

    5.3

    Glyph outlines treated as a path 319

    5.4

    Graphics clipped by a glyph path 320

    5.5

    Encoding scheme for Type 1 fonts 329

    5.6

    Glyph metrics 331

    5.7

    Relationship between two sets of metrics 333

    5.8

    Output from Example 5.6 341

    5.9

    Composite font mapping example 359

    5.10

    CID-keyed font basics 367

    5.11

    Type 0 CIDFont character processing 372

    6.1

    Trapping example 440

    6.2

    Sliding trap 452

    7.1

    Various halftoning effects 486

    7.2

    Halftone cell with a nonzero angle 493

    7.3

    Angled halftone cell divided into two squares 493

    7.4

    Halftone cell and two squares tiled across device space 494

    7.5

    Tiling of device space in a type 16 halftone dictionary 497

    7.6

    Rasterization without stroke adjustment 504

    8.1

    arc

    operator 530

    8.2

    arc

    operator example 531

    8.3

    arcn

    operator example 532

    8.4

    arct

    operator 533

    8.5

    arct

    operator example 533

    8.6

    curveto

    operator 565

    8.7

    imagemask

    example 609

    8.8

    setflat

    operator 669

    8.9

    Line cap parameter shapes 673

    8.10

    Line join parameter shapes 674

    8.11

    Miter length 676

  • ix

    Tables

    2.1

    Control characters for the interactive executive 21

    3.1

    White-space characters 27

    3.2

    Types of objects 34

    3.3

    Standard local dictionaries 65

    3.4

    Standard global dictionaries 66

    3.5

    Access strings 79

    3.6

    Standard filters 85

    3.7

    Regular resources