Page description language from Adobe

Slides:



Advertisements
Similar presentations
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.
Advertisements

Python Programming, 2/e1 CS177: Programming in Multimedia Objects Recitation Topic: Graphics Library.
Introduction to InDesign Understanding the Basics DTB203 Interior Visualisation
HTML 5 Previous version: HTML4.01, 1999 Still work in progress, most browsers support some of it.
PZ14A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ14A - Text processing Programming Language Design and.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
V Obtained from a summer workshop in Guildford County July, 2014
Text in multimedia Why would course designers like text? The most inexpensive media to develop Least overhead in storage/transmission But text creation.
Working with Graphics. Objectives Understand bitmap and vector graphics Place a graphic into a frame Work with the content indicator Transform frame contents.
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,
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
Appendixes 4. An Introduction to PostScript ® CVG Lab.
Chapter 15 Graphics and Java 2D™ Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction.
Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction 28.2Graphics Contexts and Graphics Objects 28.3Color Control 28.4Font Control 28.5Drawing.
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Overview What is PostScript? Types Language Concepts Control Operators Examples.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 2 Graphics Programming with C++ and the Dark GDK Library Starting.
Chapter 4 Working with Frames. Align and distribute objects on a page Stack and layer objects Work with graphics frames Work with text frames Chapter.
Tkinter Canvas.
PZ07A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ07A - Expressions Programming Language Design and Implementation.
Aim: What is Adobe Illustrator?. Adobe Illustrator is a vector based drawing program.
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
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
IS 1014 Introduction to Computer Graphics -- Paul Munro A Postscript Tutorial Book available at: cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF.
© 2011 Delmar, Cengage Learning Chapter 4 Working with Frames.
Pslib Manual. 2 PSlib Pslib is a library for making “postscript (ps)” file. Postscript is a language for supporting the high-quality printer. Postscript.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 19 – Dynamic HTML: Structured Graphics ActiveX Control Outline 19.1Introduction 19.2Shape.
Ⅰ. PS Driver ML-4050N Series PostScript, Driver ML-4050N Series PostScript, Driver.
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.
ADOBE INDESIGN CS3 Chapter 4 WORKING WITH FRAMES.
Adobe Illustrator CS5 - Illustrated Unit B: Performing Essential Operations.
Computer Engineering and Networks, College of Engineering, Majmaah University Text in multimedia Mohammed Saleem Bhat CEN-318 Multimedia.
Desktop Publishing Lesson 4 — Working with Objects.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
AN ILLUSTRATION DRAWING AND COMPOSING Adobe Illustrator CS Design Professional.
A review of the overview
12 Graphics and Java 2D™.
Drawing Geometric Objects
What is a Function Expression?
Introduction to Illustrator
Vector vs. Bitmap.
Introduction to Humanities Computing
Learn Animations in Fireworks
Inserting and Working with Images
Flash Interface, Commands and Functions
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Pertemuan 05 Drawing with Shape
9. Drawing Let's Learn Python and Pygame
Fundamentals of Programming I Introduction to Graphics
Fill and Stroke Stroke is the outline of a shape, text or image.
Basic Graphics Drawing Shapes 1.
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
ISC440: Web Programming II Ch14: HTML5 Canvas
Digital Media Dr. Jim Rowan ITEC 2110.
1.
Chapter 2 Graphics Programming with C++ and the Dark GDK Library
Balancing Chemical Equations
Vectors and Paths, also File Export
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Text processing Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section 12.1.
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Balancing Chemical Equations
Expressions Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

Page description language from Adobe Postscript Page description language from Adobe

Copyright 2000, Georgia Tech Story History Basics Paths Drawing simple geometric shapes Working with Coordinate Systems Drawing ellipses Ghostscript and GSview 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech History Before Postscript (pre 1984) Dot matrix printers with poor quality output High quality printers with proprietary languages John Warnock at Xerox Parc created Interpress Couldn’t convince management to sell it Left Xerox and created Adobe with his old boss Abode created Postscript (1984) First used with Apple LaserWriter and Aldus PageMaker Desktop publishing took off See http://users.belgacom.net/prepresspanic/postscript/history/history.htm for more of the history. Dot matrix printers are like a computer screen in that the printer has a resolution of dots (pixels) per inch. John Warnock and Chuck Geschke were the founders of Adobe. For years the Apple LaserWriters had faster processors than the Macs they were connected to. 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech What is Postscript? A language for printing text and graphics. Advantages Device independent Manufactures license the interpreter Specifications are freely available Levels 1 (1985), 2 (1994), and 3 (1998) 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Basics Interpreted, stack-based language like FORTH 3 4 add Put 3 on the stack Put 4 on the stack add takes the top two items off the stack and adds them and puts the result on the stack This is also called postfix notation. 11/19/2018 Copyright 2000, Georgia Tech

Postscript files are Text Postscript is written in ASCII characters Use % for comment % draw a vertical line newpath 216 288 moveto 216 432 lineto stroke showpage Using GSView to View x is 3 inches from left y is 6 inches from bottom x is 3 inches from left y is 4 inches from bottom 11/19/2018 Copyright 2000, Georgia Tech

Default Coordinate System Origin is lower left corner of page X increases to left Y increases going up Units are 1/72 inches So 72 units in an inch Origin 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Like Drawing by Hand Start with the current page being empty Draw things on the page Things drawn on top of other things will obscure them When you are done send the page to the printer 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Postscript uses Paths What is a path? Set of connected and disconnected points, lines, and curves that describe shapes and their positions 11/19/2018 Copyright 2000, Georgia Tech

What can you do with a Path? A path can be Stroked (like using a pen to draw it) Filled (like using a paint can to fill it) Used as a clipping boundary (like using a stencil) 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Defining a Path Use newpath to start a path newpath Use moveto to move the pen to a point on the page (but nothing draws yet) 216 288 moveto Use lineto to create a line from the previous point to the current point 216 432 lineto 11/19/2018 Copyright 2000, Georgia Tech

Disconnected Path Example This will draw two unconnected lines newpath 72 72 moveto 144 72 rlineto 144 360 moveto 0 -72 rlineto stroke showpage Using GSView to View 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Relative Positioning Using rlineto uses the x and y as relative to the current position Positive values X right Y up Negative values X left Y down Can use rmoveto as well To move relative to the current position -x +y +x+y -x -y +x-y 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Drawing a Rectangle newpath 270 360 moveto 0 72 rlineto 144 0 rlineto 0 -72 rlineto -144 0 rlineto stroke showpage second third first The moveto moves the pen to 3.75 inches from left and 5 inches from the bottom of the page. The 0 72 rlineto draws a 1 inch line up from that position in y. The 144 0 draws the top of the rectangle going 2 inches to the right. The 0 -72 draws the right side of the rectangle by going down 1 inch in y. The -144 0 draws the bottom of the rectangle by going left in x 2 inches. fourth start 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Drawing a Polygon newpath 270 360 moveto 200 340 lineto 230 320 lineto 310 320 lineto 330 340 lineto closepath stroke showpage 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Closing the Polygon Use closepath to go from last point to the last moveto point does a mitered join lineto lineto lineto moveto closepath lineto lineto 11/19/2018 Copyright 2000, Georgia Tech

Working with Coordinates The default user coordinates are at the bottom left of the current page But the user coordinates can be Translated – moves the origin x y translate Scaled – change the size of the units x y scale Rotated – rotates the axes counterclockwise angle rotate 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Graphics State What is in the graphics state? Current path, gray value, line width, user coordinate system Save the state to return to it later gsave Restore a saved state grestore 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Using Graphics State newpath 270 360 moveto 0 72 rlineto 144 0 rlineto 0 -72 rlineto -144 0 rlineto gsave .5 setgray fill grestore stroke showpage Save current graphics state The fill command clears the current path. So, we save the current path with gsave and restore it to outline the border of the rectangle. Clears current path Restore the saved graphics state including path 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Drawing Arcs The arc operator draws arcs (and circles) Center is at centerX and centerY Radius of radius Arc drawing starts at beginAngle from x axis and counter clockwise to endAngle centerX centerY radius beginAngle endAngle arc Example: 300 365 100 0 90 arc The example starts at 0 degrees from the x axis, so on the x axis and goes counterclockwise to 90 degrees. The center is at 300 in x and 365 in y with a radius of 100 units. You can also draw arcs clockwise using arcn. 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Drawing a Circle Use arc with a begin angle of 0 and an end angle of 360 Example 300 365 72 0 360 arc 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech How to Draw Ellipses? Use the arc operator But, first scale the user coordinate system Example newpath 1 .75 scale 300 365 72 0 360 arc stroke showpage 1 .75 scale 1 .5 scale .5 1 scale To draw a ellipse you draw a circle but first scale the user coordinate system to match the ratio of the width to the height. 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Defining Variables Use the def operator to define variables /ppi 72 def % define the points per inch var 10 ppi mul % multiply 10 * 72 /ppi ppi 1 add def %add 1 to current value The /ppi means put the literal on the stack and don’t look up the value of it in the dictionary 11/19/2018 Copyright 2000, Georgia Tech

Postscript Dictionaries Map keys to values System dictionary Maps predefined operators to actions User dictionary Maps names to user defined variables and procedures Looks in user dictionary first then system You can actually create more dictionaries. 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Procedures A procedure is a set of operations grouped together with a name It is stored in the user dictionary with the name as the key and the operations as the value Example /inch {72 mul} def 5 inch (results in 5 * 72) 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Creating a Procedure Create a box procedure /box { 72 0 rlineto 0 72 rlineto -72 0 rlineto closepath} def 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Using a Procedure newpath 252 324 moveto box 270 360 moveto box 360 480 moveto box stroke showpage 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Printing Text Find the font in the font dictionary Returns a one-point size font Scale the font to the desired size Size is specified by the minimum vertical separation needed between lines of text 12 point font needs 12 points between lines of text A point is 1/72 of an inch Set the scaled font to the current font Show the text 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Fonts and Typefaces What is a font? A collection of characters with a unified design. An implementation of a typeface. Typeface The design used in a font Typeface families A set of typefaces designed to work together Examples: Times-Roman, Helvetica, Courier 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Example with Fonts % show ‘Hello World’ in times roman /Times-Roman findfont 24 scalefont setfont 72 200 moveto (Hello World) show showpage 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Postscript Operators Add 3 4 add → 7 Subtract 8 4 sub → 4 Multiply 6 8 mul → 48 Divide 13 8 div → 1.625 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Stack Operators clear Removes all items from the stack 6 7 8 clear → nothing on stack dup Duplicates the top item on the stack 6 7 8 dup → 6 7 8 8 pop Remove the top item from the stack 6 7 8 pop → 6 7 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Painting Operators fill Fill the current path with the current color setgray Set the current color .5 setgray (1 is white and 0 is black) setlinewidth Set the current line width (x/72 units) 4 setlinewidth % 4/72 units wide 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech Ghostscript What is it? Ghostscript is an interpreter for the PostScript page description language Has 3 licenses Aladdin Free Public License (AFPL) allows free use but not commercial distribution Where to get it? http://www.ghostscript.com/ http://www.cs.wisc.edu/~ghost/ There is also a GNU license version of Ghostscript. Ghostscript was originally created by L. Peter Deutsch, President of Aladdin Enterprises. 11/19/2018 Copyright 2000, Georgia Tech

Copyright 2000, Georgia Tech GSview What is it? A PostScript previewer based on Ghostscript by Ghostgum Software Pty Ltd A graphical user interface for Ghostscript Where to get it? http://www.cs.wisc.edu/~ghost/gsview/ You must have Ghostscript installed to use GSview. 11/19/2018 Copyright 2000, Georgia Tech