Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #711

Why do I not see the characters

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.postscript
Subject Why do I not see the characters
Date Sat, 09 Jun 2012 11:30:40 +0200
Organization Decebal Computing
Lines 128
Message-ID <87r4to6ddr.fsf@Compaq.site> (permalink)
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:1UdAT45DBwJdUvfqWA2fgEk/LU0=
X-Homepage http://www.decebal.nl/
Xref csiph.com comp.lang.postscript:711

Show key headers only | View raw


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.

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?

The 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
      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
      200 200 scale
      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

Back to comp.lang.postscript | Previous | NextNext in thread | Find similar


Thread

Why do I not see the characters Cecil Westerhof <Cecil@decebal.nl> - 2012-06-09 11:30 +0200
  Re: Why do I not see the characters Cecil Westerhof <Cecil@decebal.nl> - 2012-06-09 14:04 +0200
    Re: Why do I not see the characters John Deubert <john@acumentraining.com> - 2012-06-09 07:18 -0700
      Re: Why do I not see the characters Cecil Westerhof <Cecil@decebal.nl> - 2012-06-09 19:50 +0200
        Re: Why do I not see the characters Helge Blischke <h.blischke@acm.org> - 2012-06-09 22:24 +0200
    Re: Why do I not see the characters luser- -droog <mijoryx@yahoo.com> - 2012-06-09 10:14 -0700
      Re: Why do I not see the characters Cecil Westerhof <Cecil@decebal.nl> - 2012-06-09 22:16 +0200
        Re: Why do I not see the characters luser- -droog <mijoryx@yahoo.com> - 2012-06-09 14:16 -0700
          Re: Why do I not see the characters Cecil Westerhof <Cecil@decebal.nl> - 2012-06-10 00:15 +0200
            Re: Why do I not see the characters luser- -droog <mijoryx@yahoo.com> - 2012-06-09 15:51 -0700
    Re: Why do I not see the characters luser- -droog <mijoryx@yahoo.com> - 2012-06-09 10:24 -0700

csiph-web