Beginner's postscript question with parens 
Author Message
 Beginner's postscript question with parens

I am having a problem with the interpretation of parens in postscript.
Here is the chunk of postscript code in question:

-1112  722 (you and me (for helping create the fonts) -0.00145 0 205 9 12
A1`
-1112  794 (  distributed with it),) -0.00145 0 205 9 12 A1`

The line should be formatted as:
   you and me (for helping create the fonts
      distributed with it),

But is printed as:
   you and me (for helping create the fonts -0.00145 0 205 9 12 A1`-1112
 794 (  distributed with it),

The problem is the use of "(" in the text when it isn't closed within the
same text.  The following line is interpretted as text until it gets to
the closing ")".  Is there some way to delimit the "(" in the text as
belonging to the text and not postscript?

Thanks!  Tom.

------------------------------------------------------------------------

Mayo Clinic           | If you don't know where | Voice: (507) 266-4261
200 First Street SW   |you're going you'll never| FAX:   (507) 284-0796
Mail Stop 751 Siebens |       get there.        |
Rochester, MN  55905  +-------------------------+
------------------------------------------------------------------------



Mon, 06 Jan 1997 23:57:04 GMT  
 Beginner's postscript question with parens

writes:

Quote:
> Is there some way to delimit the "(" in the text as
> belonging to the text and not postscript?

Use the backslash ("\") to precede any parens intended literally (i.e.,
not as string delimiters. Same for any other characters that would
otherwise be perceived as delimiters by the RIP.

Scott Walker
COPS Tech Support



Tue, 07 Jan 1997 20:29:08 GMT  
 Beginner's postscript question with parens

<I am having a problem with the interpretation of parens in postscript.
<Here is the chunk of postscript code in question:
<
<-1112  722 (you and me (for helping create the fonts) -0.00145 0 205 9 12
<A1`
<-1112  794 (  distributed with it),) -0.00145 0 205 9 12 A1`
<
<The line should be formatted as:
<   you and me (for helping create the fonts
<      distributed with it),
<
<But is printed as:
<   you and me (for helping create the fonts -0.00145 0 205 9 12 A1`-1112
< 794 (  distributed with it),
<
<The problem is the use of "(" in the text when it isn't closed within the
<same text.  The following line is interpretted as text until it gets to
<the closing ")".  Is there some way to delimit the "(" in the text as
<belonging to the text and not postscript?

If you did a little RTFM of the PostScript manual, you would find that a
( or ) within a string should have a \ in front of it, i.e., \( or \).
If the pair is matched within the same string the \ isn't necessary.
If you don't know if the pair will be matched, use \ all the time.
--
        |-old uucp-| spool.cs.wisc.edu!astroatc!vidiot!brown


     [The need for igniting the midnight petroleum has come to an end as well.]



Wed, 08 Jan 1997 14:49:36 GMT  
 Beginner's postscript question with parens

writes:
    *  I am having a problem with the interpretation of parens in
    *  postscript.  Here is the chunk of postscript code in question:

    *  -1112  722 (you and me (for helping create the fonts) -0.00145 0 205 9  
12
 A1`
    *  -1112  794 (  distributed with it),) -0.00145 0 205 9 12 A1`

    *  The line should be formatted as:
    *    you and me (for helping create the fonts
    *       distributed with it),

    *  But is printed as:
    *    you and me (for helping create the fonts -0.00145 0 205 9 12  
A1`-1112
    *  794 (  distributed with it),

    *  The problem is the use of "(" in the text when it isn't
    *  closed within the same text.  The following line is
    *  interpretted as text until it gets to the closing ")".  Is
    *  there some way to delimit the "(" in the text as belonging
    *  to the text and not postscript?
This is documented in the PostScript Language Reference Manual.
The scanner recognises nested parentheses within strings.  This
fragment of PostScript:
        %!PS
        /Courier-Bold findfont 24 scalefont setfont
        100 200 moveto (This is a (Nested) String) show
Displays as:
        This is a (Nested) String
If you wish to have unbalenced parentheses within strings, you must
delimit them with backslash characters, a la, \( and \).

        ........  Henry



Thu, 09 Jan 1997 01:01:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help with 'cannot use parens' error

2. Beginner's simple question

3. Beginner's xps question

4. Beginner's question

5. Beginner's questions

6. Excel with VB (beginner's question)

7. Excel with VD (beginner's question)

8. beginner's question --> CR/LF

9. beginner's question on image

10. Beginner's question

11. Encapsulated PostScript beginner question

12. UNIX, ksh, and Postscript: Beginner Question

 

 
Powered by phpBB® Forum Software