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


Groups > comp.lang.postscript > #712

Re: Why do I not see the characters

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.postscript
Subject Re: Why do I not see the characters
Date 2012-06-09 14:04 +0200
Organization Decebal Computing
Message-ID <878vfw66a3.fsf@Compaq.site> (permalink)
References <87r4to6ddr.fsf@Compaq.site>

Show all headers | View raw


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

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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