: ̼(linuxlee@hitel.net)
|
Linux Focus
ּҿ ֽϴ.
1. Ұ Ʈ ũƮ ó ̴. ֿ Ʈ ũƮ Ʈ ġ ƴ϶ Ʈ ũƮ ְ ̷ο ߰ 鿡 ϴ ̴. Ʈ ũƮ ̶ Ѵ. Ʈ ũƮ ̵ 22, Evans & Sutherland ǻ ȸ翡 ٹϴ John Gaffney. ʿ " ý" Ҹٰ Ŀ Adobe 翡 Ͽ Ʈ ũƮ ̸ ġ μ ϰ Ǿ. Adobe 1982 Chuck Geschke John Wamock Ͽ Ǿ. Geshke J. Wamock ΰ κ þ, Doug Brotz, Billi Paxton, Ed Taft þҴ. Ϲ ڿ , ϳ ֿ ۼ μ ް ִ. Ʈ ũƮ ſ Կ ұϰ Ϲݻ Ʈ ũƮ ٴ ܼϸ ս ̽ ϴ Ϲ μ۾ ٸ ۾ ؼ δ Ʈ ũƮ ̿ϰ ִ. ̷ Ʈ ũƮ , ä, ̹ μ, и, ùķ̼ǰ ִϸ̼ ܺ Ÿ ſ 츮 ģ ̾ ִ. Ʈ ũƮ αֿ Ѵٸ ϸ ƴ ̴. Ʈ ũƮ ɾ Ϳ ؼ ȴ. ߿ Aladdin Enterprise "ghostscript" ͳ ǰ ִ. ̿ Ҿ "ghostview" ̽ ǰ ִ. GNU Ʈ ghostscript ִ. ̷ α ÷ 밡ϸ ֿ ǿ ̵ ⺻ ԵǾ ִ. ⼭ ghostscript õ , ؼ ٷ ̴. 翡 Ǵ ٸ Ʈ ũƮ Ϳ ϴ. ϴ xterm ghostscript . ghostscript Űó Ʒ ۵ , ghostscript ɾ Ʈ ̴. Initializing...done. Ghostscript 2.6.2
(4/19/95) Copyright (C) 1990-1995 Aladdin Enterprises, Menlo
Park, CA. All rights reserved. Ghostscript comes with NO WARRANTY:
see the file COPYING for details. ̿ ÿ ghostscript ɾ Ʈ ϳ 찡 ̴. ghostscript ⸦ Ѵٸ ܼ GS> Ʈ quit Էϰų Ctrl-D ġ ȴ. Ghostscript ɾ Ͽ о鿩 ų ִ. sample.ps ̸ ٰ غ. Ͽ Ǿ ghostscript ɾ ϵǾ ִ. Ͽ ִ ü ٷ Ʈ ũƮ α Ǵ ̴. 츮 Ʒ Ʈ Էϰ Ǹ ȿ ִ ghostscript ɾ ǰ ȴ. gs sample.ps ghostscript 쿡 sample.ps ִ α 뿡 ǥõǰ ȴ. ( α ǥ 쿡 . Ʈ ũƮ ̳ ٸ ִ. ̷ ɵ κп ڼ ٷ ̴.) ȴٸ ghostscript 쿡 ù ǥõ showpage Ʈ ghostscript ɾ ο Ű Է ٸ ְ ̴. Ʈ ũƮ Reverse Polish Notation(RPN - HP ) Ѵ. ٽ ؼ ɾ ĶͰ ɾ տ ̰ ȴٴ ̴. ɾ Ķʹ ĭ еȴ. Ʈ ũƮ ڷ ó ɾ ؼ ̿ϸ Ʈ ũƮ ǿ, , õ 4 ִ. ǿ Ϸ Ʈ ũƮ ü ִ. ⼭ Ʈ ũƮ ü ǿڿ Ʈ ũƮ ̾߱ϴ ̴. Ʒ . 20 30 add 10 sub 40 ȴ. 20 30 add κп 50 sub ڴ 50 10 40 ϰ ȴ. mul() div() ϸ ȴ. '=' ǿ ÿ ϳ ü ǥ Ͽ ؽƮ · ϰ ȴ. ̶ ڿ ο Ѵ. '= =' 쿡 '='ڿ ϳ ٸ ؽƮ ° ƴ syntax Ѵ. pop ɾ ǿ ִ Ҹ ҰѴ. ÿ ؼ κп ڼ ̴. (ǿ ȿ)
2. Ʈ ũƮ Ʈ ũƮ ؼ 켱 Ÿ غƾ Ѵ. ġ Ʈ ũƮ 1ġ 1/70ʽ ũ ȼ ǥѴ. Ʒ κ ǥ (0,0) ȴ. ʱ ũⰡ 612, 792 ߾ ִ. ũ ũ . ũ⸦ Ʒ ٲ ִ. note for 540 and 720 or ɾ gs> Ʈ ԷµǾ Ѵ. 'a4' ɾ ũ ش. ũ κ gs-statd.ps ʱȭ Ͽ /usr/lib/ghostscript 丮 ִ. Ѽ ִ. ̿ ڼ κп ٽ ȴ. ϴ ⺻ ũ Ѵٰ ϵ . ° ũ⸦ , Ŀ ġ ´. Ŀ ̵Ű ɾ ̿Ѵ. x y moveto ɾ Ŀ x, yŭ ̵ؼ ġϰ ȴ. ɾ ٿ Ʈ ũƮ Լ C Fortran 밳 ũƮ ϹǷ ĶͰ տ ȴ. ̷ Լ Ÿ ٸ Ȯ ٸ ̹Ƿ ο ο Ѵ. ν غ ƴ. ϳ . ؼ ɾ ؾ Ѵ. xx yy lineto ⼭ xx ǥ, yy ǥ Ÿ. Ű Ҵ x, y ȴ. ᱹ x, y xx, yy ȴ. ̺ 쿡 ɾ newpath stroke ɾ ؾ Ѵ. ݺ 簢 Ʈ ũƮ α . α sample.ps Ͽ Ǿ ִٰ Ѵٸ Ʒ ̴. newpath ⼭ ɾ ο ٿ Է ʿ . ɾ ̿ ĭ ٿ ٿᵵ . Ʈ ũƮ ٸ Ÿ α ּ ɵ ִ. ٿ ۼƮ('%') ȣ ڿ Ϳ ּ ֵȴ. newpath xterm Ʈ gs sample1.ps Էϸ ο ghostscript Ǹ鼭 ȿ 츮 ϴ 簢 ǥõ ̴. ̷ ǥϱ Ź ų ʿ . gs Ʈ Ʒ Էϸ Ȱ ִ. (sample1.ps) run stroke ɾ Ϳ Ѵ. 쿡 ̰ 200, 150 , ǥõǾ 簢 . 쿡 , ʿ ε ۼ ִ. ֵ moveto lineto ϸ ﰢ ǥ ִ. ɾ ͵ rmoveto rlineto ɾ Ѵ. ɾ Ķ ʿ ϸ Ʒ . x y rmoveto x y rlineto x y ʱ ġ ġ , Ÿ Ÿ. rmoveto rlineto 'r' 'relative(ϴ, )' Ÿ. ڼ ̾߱ϸ ù ° ɾ Ŀ ġ x ŭ y ŭ ̵Ų. ° ɾ ϰ ϴµ ٸ Ŀ ̵Ųٴ ̴. ( ߴ.. Ҹ...) ڵ Ǵ ⺻ β Ѵ. ⺻ β 1ȼ̴. ڰ β α ִ. Ʒ ɾ ̷ Ѵ. x setlinewidth ⼭ x β ȼ Ÿ ̴. ȿ β ȿϴ. Ʈ ũƮ ۾ ѵ ʴ´. ȣ ִ. ȣ ɾ . x y r a b arc ⼭ x ȣ ߽ ǥ, y ȣ ߽ ǥ, r ȣ , a κ , b ȣ Ÿ. ݽð þ ȴ. ȣ Ŀ Ÿ ġ Ŀ ġ ȣ ̿ ÷ǰ ȴ. θ ణ ϴµ ̹Ƿ ڼ ϵ . 3 setlinewidth ȣ Ŀ ġ ġ ʴ Ƿ Ǹ ← Ѵ. ġ ġŰ ϳ ִ. ؼ ʱ Ŀ ġ ؾ ϴµ ƿ ְ ȴ. ̷ Ǹ ʷ Ⱑ ۵ Ⱑ ٷ ǰ ȴ. ʱ newpath ɾ Ǹ Ʈ ũƮ Ҵ Ŀ ǰ Ⱑ ۵Ǵ ġ νĵǰ Ǵ ̴. ټ ° newpath ɾ ٲپ Ÿ ִ. ̷ ٲپ α ٽ ʴ ̴. δ newpath ɾ Ŵν ۵ȴ. ΰ ֵ ʱȭ Ų. Ŀ ɾ ̿Ͽ ο θ ϰ ȴ. arc ɾ Ϻ ̿ ִ. ܼ 0, 360 Էϱ⸸ ϸ ȴ. newpath ɾ Ἥ θ , arc ɾ Ἥ Ϻ ´ٸ, Ʈ ũƮ scaling ̿Ͽ Ÿ ִ. ڴ scale ɾ ̿Ͽ η ǥǴ , Ȯ, ִ. scale ɾ ̴. x y scale ⼭ x Ȯ/ ̸, y Ȯ/ ̴. x, y 1 Ǹ ƹ ġ ȴ. Ȯ/ ɾ scale ɾ ԷµDZ ϰ ȴ. ù ° scale ɾ , ٽ scale ɾ ̿Ͽ Ȯ/ ڰ ǰ Ǹ Ȯ/ ڰ õǴ ƴϰ Ͱ Ǵ ġ ȴ. ù ° Ȯ/ ڷ x1, y1 ϰ, ° Ȯ/ ڷ x2, y2 ߴٸ ° scale Ȯ/ ڰ x1*x2, y1*y2 ȴ. ̷ Ȯ/Ҹ 쿡 ݵ ο ξ Ѵ. ؼ Ȯ/Ҹ غ . 3 setlinewidth α Ѻ ְ Ȯ/ ɾ Ӹ ƴ϶ β ģ. α Ÿ β ٸ ͵ ̷ ̴. Ʈ ũƮ ȣ ٸ ɾ ִ. ϳ arcn ɾ ɾ ⸸ arc ɾ ȿ . arc ɾ ð ȣ ݸ, arcn ɾ ð ȣ . ٸ ϳ arcn ɾ ɾ ־ ϴ Ѵ. arcto ɾ . x1 y1 x2 y2 r arcto xt1 yt1 xt2 yt2 ⼭ xt1, yt1, xt2, yt2 ȣ ǥ Ÿ x0, y0, x1, y1 x1, y1, x2, y2 ǥ Ÿ. ⼭ x0, y0 ǹѴ. r ȣ Ÿ. arc ɾ Ŀ ġ ġ ̿ ǥõǰ ȴ. Ⱑ Ŀ ġ xt2, yt2 ȴ. ٿ Ʈ ũƮ Bezier ˰ curveto ɾ ִ. ɾ ־ ڷῡ ,ܻ ϰ ȴ. Ʒ . x1 y1 x2 y2 x3 y3 curveto ⼭ x0, y0 ȴ. x0, y0, x1, y1 ϴ ϰ Ǹ, x3, y3̸ x2, y2, x3, y3 ϴ ϰ ȴ. ⺻ (, , Ÿ ) ٸ ֵǸ ȴ.
Ʈ ũƮ ǥ Ʈ ũƮ ǵ ⺻ ǰ ִ Ʈ Ͽ پ Ʈ ִ. Ʈ ִ ϴ Ʈ ϴ ɵ ϰ ִ. Ϸ̴. /Times-roman findfont α ֵ findfont ɾ ϰϴ Ʈ Ϸ Ǵ ɾ̴. Ʈ ̸ '/' ϸ findfont ɾ Ķͷμ ɾ տ ־. '/' ͷ Ͽ Ʈ ̸ ÿ ְ Ѵ. Ŀ ÿ ؼ ڼ ̾߱ ̴. Ʈ ã Ŀ scalefont ɾ ̿Ͽ Ʈ Ȯ/Ҹ ϰ ȴ. Ȯ/ ڴ ɾ κп ȴ. Ʈ Ȯ/ , setfont ɾ ̿Ͽ Ʈ ϵ . moveto ɾ ̿Ͽ Ŀ ϴ ġ Ű Ÿ ȣ('()') ο show ɾ Ķͷ Ѱ ȴ. Ŀ showpage ɾ ̿Ͽ տ ǥ ְ ȴ. ٸ Ʈ, ũ ٸ ġ ǥϿ. Ʈ ũƮ Ʈ ý Ʈ ã ִ. , ̳ Ÿ ٸ ̿Ͽ ִ. ̷δ ε ǥ ִ. Ǵ ϴĴ ̴.
Ʈ ũƮ äϱ. Ʈ ũƮ äϴµ Ǵ ɵ ִ. 켱 äϴµ Ǵ ɾ 캸 . Ʈ ũƮ ⺻ Ѵ. 츮 ± Ʈߴ α θ ǥǾ ̴. Ʈ ũƮ ä ɾ ִ. ù ° setrgbcolor ɾν ɾ r, g, b , ʷ, Ķ Ͽ ǥϰ ȴ. 0 255̸ Ǽ Ǵ Ҽ Ʒ 3ڸ ϴ. ɾ Ʒ . x y z setrgbcolor ⼭ x, y, z , ʷ, Ķ
Ÿ setrgbcolor ɾ տ ̰ ȴ.
1 0 0 setrgbcolor ʷϻ 쿡
, ʷ, Ķ Į 1 1 1 ϸ ̴.
ɾ ̿Ͽ ϰ Ǹ ٽ ٲٱ
Ŀ ų տ ǥȴ.
Ƚ ̸ ̿Ͽ ڰ
ϴ ǥ ִ. ° ɾ setcmykcolor ɾν ɾ ƴ ʷ ؼ Ѵ. δ ûϻ, ȫ, , ִ. 0 1 ϵ ִ. ɾ Ʒ . w x y z setcmykcolor ⼭ w, x, y, z ûϻ, ȫ, , ϵ Ÿ setcmykcolor ɾ ĶͰ ȴ. Ư¡ տ setrgbcolorɾ ϴ. ° ɾ sethsbcolor ɾ . x y z sethsbcolor ⼭ x, y, z Į ٸ Ư Ÿ. ù ° Ʈ ġ Ÿ hue Ÿ. ° ä, ° Ÿ. Ʈ Į ġ, ä, ؾ Ȳ ȴ. hsbcolor ͼġ ڴ xfig غ ٶ. Ʈ ũƮ κп ߿ ɾ fill closepath ̴. Ʈ ũƮ ̿ äϱ Ȯϰ ִ ̴. 1 1 0 0 setcmykcolor ⼭ closepath ɾ ִ ο ̾ θ ݵ . fill ɾ θ äϴ Ѵ. Ʈ ũƮ ɾ Ͽ ȸ ִ. x setgray ⼭ x ȸ ϵ Ÿ 0 1̴. x 0̶ , 1̶ ǥϰ ȴ. setgray ɾ ̿ϴ ̴. 0.0 setgray 縦 Ʈ ũƮ ſ ŷ ڰ ִٸ 翡 ϰ ȭ α ϴ ̴. 翡 Ʈ ũƮ ṵ̈ 鿡 ̾߱⸦ ϵ ϰڴ. |