Overview What is PostScript? Types Language Concepts Control Operators Examples.

Slides:



Advertisements
Similar presentations
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Advertisements

CHAPTER 20 CREATING SVG GRAPHICS. LEARNING OBJECTIVES How to embed a graphic stored within a.SVG file in an HTML page How to use the and tag pair to specify.
RAPTOR Syntax and Semantics By Lt Col Schorsch
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Lecture 12 – ADTs and Stacks.  Modularity  Divide the program into smaller parts  Advantages  Keeps the complexity managable  Isolates errors (parts.
CS412/413 Introduction to Compilers Radu Rugina Lecture 16: Efficient Translation to Low IR 25 Feb 02.
PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ14A - Text processing Programming Language Design and.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
2. Stack-based Programming Prof. O. Nierstrasz scg.unibe.ch.
R ESEARCH G ENOME B IOINFORMATICS L AB R ESEARCH at G ENOME B IOINFORMATICS L AB Josep F. Abril Ferrando and Genís Parra Farré Genome BioInformatics Research.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 3 Programming and Software.
3. Stack-based Programming. © O. Nierstrasz PS — Stack-based Programming 3.2 Roadmap Overview  PostScript objects, types and stacks  Arithmetic operators.
Introduction to JavaScript for Python Programmers
SWHIG Seminar Ian Kim 1/18/12.  General overview of printing technology ◦ Background information:  Vector vs. raster graphics  How inkjet printers.
Development of PostScript Procedures for Transformations of Digital Typography Ph. D. Sc. Klaudio Pap, Ph. D. Sc. Vilko Žiljak Faculty of Graphic Arts,
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
Lecture 2 Character Codes and Low-Structure Text Document Formats.
High-Level Programming Languages: C++
CIS Computer Programming Logic
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
CHAPTER 2 ISA Instructions (logical + procedure call)
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Appendixes 4. An Introduction to PostScript ® CVG Lab.
DATA STRUCTURE & ALGORITHMS CHAPTER 3: STACKS. 2 Objectives In this chapter, you will: Learn about stacks Examine various stack operations Discover stack.
Computer Architecture and the Fetch-Execute Cycle
Chapter 8 Intermediate Code Zhang Jing, Wang HaiLing College of Computer Science & Technology Harbin Engineering University.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Compiler Chapter# 5 Intermediate code generation.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 5 Server Side Scripting Perl.
And other languages….  Array literals/initialization a = [1,2,3] a2 = [-10..0, 0..10] a3 = [[1,2],[3,4]] a4 = [w*h, w, h] a5 = [] empty = Array.new zeros.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
I Power Higher Computing Software Development High Level Language Constructs.
Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1.
1 Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
IS 1014 Introduction to Computer Graphics -- Paul Munro A Postscript Tutorial Book available at: cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF.
Stacks An Abstract Data Type. Restricted Access Unlike arrays, stacks only allow the top most item to be accessed at any time The interface of a stack.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
Chapter 8 P 1 Arrays and Grids Single-dimension arrays Definition An array is a sequence of elements all referred to with a common name. Other terms: table,
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
1 Introduction to PostScript Sep. 21 Dae-Eun Hyun 3D MAP Lab.
Controlling Computers with Programs When you create a computer program you are creating a set of instructions that tell the computer exactly and completely.
Atholton High School Columbia, Maryland Nifty Assignments: Mighty Cabbage Patch Micro.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Chapter 9 Introduction to Arrays Fundamentals of Java.
Click to edit Master text styles Stacks Data Structure.
ITEC2110, Digital Media Chapter 2 Fundamentals of Digital Imaging 1 GGC -- ITEC Digital Media.
7 - Programming 7J, K, L, M, N, O – Handling Data.
Prefix notation in action
Data Representation.
Revised based on textbook author’s notes.
Introduction to Humanities Computing
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Program to search an element of array using linear search.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Stack application: postponing data usage
Expressions and Control Flow in JavaScript
Page description language from Adobe
` Structured Programming & Flowchart
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Trees, part 2 Lecture 13 CS2110 – Spring 2019
Stack.
Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
CMPT 120 Lecture 13 – Unit 2 – Cryptography and Encryption –
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

Overview What is PostScript? Types Language Concepts Control Operators Examples

What is PostScript page description language : PostScript is a programming language optimized for printing graphics and text It was introduced by Adobe in 1985 The main purpose of PostScript was to provide a convenient language in which to describe images in a device independent manner. This device independence means that the image is described without reference to any specific device features (e.g. printer resolution)

Types  String :  “This is a string” would be written as (This is a string).  Express a string as hexadecimal codes in angle brackets. “ABC” would be expressed as.  Boolean  Real  Array

Types Arrays: One Dimensional Object of different types in an array /arrayName [ 12 (Twelve) True] def /arrayName [ add] def /arrayName 10 array Store and Fetch array elements: put, get /anArray 10 array def anArray 8 (language) put anArray 8 get

Language Concepts Variable: /varName value def Path: A path is a collection of (possibly disjoint) line segments and curves arranged on the page. newpath moveto linto stroke showpage Dictionary: is a table that associates pairs of objects System Dictionary : operator, action User Dictionary : /var1Name Value def

Language Concepts Procedures: /inch {72 mul} def Stack: Graphic Stack Operand Stack (c lear, dup, pop, roll, pstack ) Dictionary Stack Operator: Every command in PostScript is an operator: add, mul, findfont, moveto...

Programming in PostScript Postfix Notation in PostScript : One must first place the operands on stack and then call the operator add 8 –7 * mul sub 7 3 mul 8 exch sub

Control Operators Conditional: Comparisons: Logical Operator: And, or, not, xor bool { op } if bool {op1} {op2} ifelse

Control Operator Loops: Repeat: Iteration { loop_body_expression} repeat For: Loop_counter_init_value increment_value {op} for { op }loop : end with “exit” AnArray {op} forall

/Times-Italic findfont 30 scalefont setfont /printZip { 0 0 moveto (Zip) show} def translate % start incr. end {setgray printZip -1.5 translate } for 1 setgray printZip showpage

/starside { 72 0 lineto %add line to path currentpoint translate %move origin -144 rotate } def %rotate coord. sys. /star %stack: x y { moveto currentpoint translate 4 {starside} repeat closepath gsave.5 setgray fill grestore stroke } def star

Refrences