Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.postscript Subject: Re: Why do I not see the characters Date: Sat, 09 Jun 2012 14:04:04 +0200 Organization: Decebal Computing Lines: 142 Message-ID: <878vfw66a3.fsf@Compaq.site> References: <87r4to6ddr.fsf@Compaq.site> NNTP-Posting-Host: lYLrXPFpjyZ8237ODaoN+w.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:A7cJKSi2sh4y3lo8N9iwkFBwn2E= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.postscript:712 Op zaterdag 9 jun 2012 11:30 CEST schreef Cecil Westerhof: > I just started trying to do some things with postscript. I made a > little program based on the rosette example in the bluebook. I want in > the different wedges to display characters of a string, but they do > not appear. What am I doing wrong. The first part I found. I did not understand what was happening correctly. Below a correct working version. Comment is welcome. ;-} > > I also started making a library. But I am working with epstopdf to > make a pdf and then convert to create a png. Ideally I would not have > to have the library in the program itself, but could use an include. > But that is not possible with epstopdf. I tried to use the command > that epstopdf generates without the -dSAFER, but to no avail. Anyone > an idea how to solve this? Help with this is still very welcome. The new code: %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 600 600 /pageBottom 0 def /pageLeft 0 def /pageRight 600 def /pageTop 600 def %% Library functions /grayBackground { % gray newpath gsave setgray newpath pageLeft pageBottom pageRight pageTop rectangle fill stroke .4 setgray usedFont authorFont scalefont setfont ((c) Cecil Westerhof - Decebal Computing) 550 5 rightString grestore } def /rectangle { % left bottom right top 4 dict begin /top exch def /right exch def /bottom exch def /left exch def left bottom moveto right bottom lineto right top lineto left top lineto left bottom lineto closepath end } def /rightString { % string x y 3 dict begin /y exch def /x exch def /string exch def x y moveto string stringwidth pop neg 0 rmoveto string show end } def %% Normal functions /wedge { % string gsave newpath 0 0 moveto 1 0 translate halfTurn rotate 0 halfTurn sin translate gsave 0 0 halfTurn sin 90 -90 arc closepath gsave fill grestore 0 setgray stroke grestore 0 setgray -90 rotate dup stringwidth pop neg 2 div 0 moveto show grestore } def % Library init /authorFont 10 def /backgroundGray .6 def /usedFont /Bookman findfont def % Program init /steps 14 def /turn 360 steps div neg def /halfTurn turn 2 div def /string (Testing) def backgroundGray grayBackground gsave 300 300 translate 0 0 moveto 200 200 scale usedFont .25 scalefont setfont 0.02 setlinewidth 180 rotate 0 1 steps 2 div 1 sub { dup steps div .5 add setgray string exch 1 getinterval wedge turn rotate } for grestore showpage -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof