Problems with Enhanced mode and Postscript

View: New views
6 Messages — Rating Filter:   Alert me  

Problems with Enhanced mode and Postscript

by Philipp K. Janert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


There seem to be some inconsistencies regarding
the behaviour of "escape" characters when using
enhanced text mode with Postscript terminals.

According to the documentation, backslashes
escape control characters. Furthermore, single
backslashes should be used with single-quoted
strings, but double backslashes with double-quoted
strings.

Here are the commands:
        set label 1 at 0,0 "f\\{x\\}"
        set label 2 at 0,1 'f\{x\}'
        plot [-1:1][-1:2] 3

This should create two labels, looking like:
        f{x}

Everything looks good (as expected) using
wxt enhanced.

But when using Postscript, I find output that
looks like this:
        f\x\
for both labels.

Is this a known issue?

Best,

                Ph.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problems with Enhanced mode and Postscript

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 06 July 2008, Philipp K. Janert wrote:

>
> There seem to be some inconsistencies regarding
> the behaviour of "escape" characters when using
> enhanced text mode with Postscript terminals.
>
> According to the documentation, backslashes
> escape control characters. Furthermore, single
> backslashes should be used with single-quoted
> strings, but double backslashes with double-quoted
> strings.
>
> Here are the commands:
> set label 1 at 0,0 "f\\{x\\}"
> set label 2 at 0,1 'f\{x\}'
> plot [-1:1][-1:2] 3

This is a known bug.
# 1968636    incorrect treatment of '\{' and '\}' in postscript

It would be easy to fix, except that it may have bad side effects for
multibyte encodings, in particular SJIS and EUC.  Shige Takeno was
kind enough to investigate the earlier escape sequences.
Perhaps he could do the same for this pair as well.

        Ethan


> This should create two labels, looking like:
> f{x}
>
> Everything looks good (as expected) using
> wxt enhanced.
>
> But when using Postscript, I find output that
> looks like this:
> f\x\
> for both labels.
>
> Is this a known issue?
>
> Best,
>
> Ph.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problems with Enhanced mode and Postscript

by Philipp K. Janert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I see. Thanks.

This does not just affect {}, though, but seems
to be a problem with the escape-mechanism.

Stuff, like \~etc also does not work as expected.

Has this been introduced relatively recently? E.g.
as consequence of including support for multibyte
char sets?

Best,

                Ph.

On Sunday 06 July 2008 17:29, you wrote:

> On Sunday 06 July 2008, Philipp K. Janert wrote:
> > There seem to be some inconsistencies regarding
> > the behaviour of "escape" characters when using
> > enhanced text mode with Postscript terminals.
> >
> > According to the documentation, backslashes
> > escape control characters. Furthermore, single
> > backslashes should be used with single-quoted
> > strings, but double backslashes with double-quoted
> > strings.
> >
> > Here are the commands:
> > set label 1 at 0,0 "f\\{x\\}"
> > set label 2 at 0,1 'f\{x\}'
> > plot [-1:1][-1:2] 3
>
> This is a known bug.
> # 1968636    incorrect treatment of '\{' and '\}' in postscript
>
> It would be easy to fix, except that it may have bad side effects for
> multibyte encodings, in particular SJIS and EUC.  Shige Takeno was
> kind enough to investigate the earlier escape sequences.
> Perhaps he could do the same for this pair as well.
>
> Ethan
>
> > This should create two labels, looking like:
> > f{x}
> >
> > Everything looks good (as expected) using
> > wxt enhanced.
> >
> > But when using Postscript, I find output that
> > looks like this:
> > f\x\
> > for both labels.
> >
> > Is this a known issue?
> >
> > Best,
> >
> > Ph.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problems with Enhanced mode and Postscript

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 06 July 2008, Philipp K. Janert wrote:
>
> I see. Thanks.
>
> This does not just affect {}, though, but seems
> to be a problem with the escape-mechanism.
>
> Stuff, like \~etc also does not work as expected.

Please read the comments beginning at line 2628 in the
file term.c.   The intent was to allow escapes of the
formatting characters used by the enhanced text mode:

     if (strchr("^_@&~",p[1]) == NULL)

Unfortunately at the time we overlooked the curly brackets,
which are not strictly speaking format characters but are
interpreted as a special case by the enhanced text code.
But as you see the '~' character is correctly handled
(confirmed here using both 4.2 and current CVS).
 
> Has this been introduced relatively recently? E.g.
> as consequence of including support for multibyte
> char sets?

Nope.  The current code has been this way since 2004.
(version 3.8 something).

        Ethan


>
> Best,
>
> Ph.
>
> On Sunday 06 July 2008 17:29, you wrote:
> > On Sunday 06 July 2008, Philipp K. Janert wrote:
> > > There seem to be some inconsistencies regarding
> > > the behaviour of "escape" characters when using
> > > enhanced text mode with Postscript terminals.
> > >
> > > According to the documentation, backslashes
> > > escape control characters. Furthermore, single
> > > backslashes should be used with single-quoted
> > > strings, but double backslashes with double-quoted
> > > strings.
> > >
> > > Here are the commands:
> > > set label 1 at 0,0 "f\\{x\\}"
> > > set label 2 at 0,1 'f\{x\}'
> > > plot [-1:1][-1:2] 3
> >
> > This is a known bug.
> > # 1968636    incorrect treatment of '\{' and '\}' in postscript
> >
> > It would be easy to fix, except that it may have bad side effects for
> > multibyte encodings, in particular SJIS and EUC.  Shige Takeno was
> > kind enough to investigate the earlier escape sequences.
> > Perhaps he could do the same for this pair as well.
> >
> > Ethan
> >
> > > This should create two labels, looking like:
> > > f{x}
> > >
> > > Everything looks good (as expected) using
> > > wxt enhanced.
> > >
> > > But when using Postscript, I find output that
> > > looks like this:
> > > f\x\
> > > for both labels.
> > >
> > > Is this a known issue?
> > >
> > > Best,
> > >
> > > Ph.
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> gnuplot-beta mailing list
> gnuplot-beta@...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>



--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problems with Enhanced mode and Postscript

by Philipp K. Janert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 06 July 2008 19:12, you wrote:

> On Sunday 06 July 2008, Philipp K. Janert wrote:
> > I see. Thanks.
> >
> > This does not just affect {}, though, but seems
> > to be a problem with the escape-mechanism.
> >
> > Stuff, like \~etc also does not work as expected.
>
> Please read the comments beginning at line 2628 in the
> file term.c.   The intent was to allow escapes of the
> formatting characters used by the enhanced text mode:
>
>      if (strchr("^_@&~",p[1]) == NULL)
>
> Unfortunately at the time we overlooked the curly brackets,
> which are not strictly speaking format characters but are
> interpreted as a special case by the enhanced text code.
> But as you see the '~' character is correctly handled
> (confirmed here using both 4.2 and current CVS).

Let me check that again. I had a hard time
getting it right, but maybe that was because
I tried to use it in conjunction with curlies.

>
> > Has this been introduced relatively recently? E.g.
> > as consequence of including support for multibyte
> > char sets?
>
> Nope.  The current code has been this way since 2004.
> (version 3.8 something).

That's pretty recent. ;-)

The docs/psdoc/ps_guide.ps file specifically
gives examples with curlies, and since it is a
Postscript file itself, I would have thought that
Postscript works.

>
> Ethan
>
> > Best,
> >
> > Ph.
> >
> > On Sunday 06 July 2008 17:29, you wrote:
> > > On Sunday 06 July 2008, Philipp K. Janert wrote:
> > > > There seem to be some inconsistencies regarding
> > > > the behaviour of "escape" characters when using
> > > > enhanced text mode with Postscript terminals.
> > > >
> > > > According to the documentation, backslashes
> > > > escape control characters. Furthermore, single
> > > > backslashes should be used with single-quoted
> > > > strings, but double backslashes with double-quoted
> > > > strings.
> > > >
> > > > Here are the commands:
> > > > set label 1 at 0,0 "f\\{x\\}"
> > > > set label 2 at 0,1 'f\{x\}'
> > > > plot [-1:1][-1:2] 3
> > >
> > > This is a known bug.
> > > # 1968636    incorrect treatment of '\{' and '\}' in postscript
> > >
> > > It would be easy to fix, except that it may have bad side effects for
> > > multibyte encodings, in particular SJIS and EUC.  Shige Takeno was
> > > kind enough to investigate the earlier escape sequences.
> > > Perhaps he could do the same for this pair as well.
> > >
> > > Ethan
> > >
> > > > This should create two labels, looking like:
> > > > f{x}
> > > >
> > > > Everything looks good (as expected) using
> > > > wxt enhanced.
> > > >
> > > > But when using Postscript, I find output that
> > > > looks like this:
> > > > f\x\
> > > > for both labels.
> > > >
> > > > Is this a known issue?
> > > >
> > > > Best,
> > > >
> > > > Ph.
> >
> > -------------------------------------------------------------------------
> > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> > Studies have shown that voting for your favorite open source project,
> > along with a healthy diet, reduces your potential for chronic lameness
> > and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> > _______________________________________________
> > gnuplot-beta mailing list
> > gnuplot-beta@...
> > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problems with Enhanced mode and Postscript

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 06 July 2008 20:53:53 Philipp K. Janert wrote:

> > Please read the comments beginning at line 2628 in the
> > file term.c.   The intent was to allow escapes of the
> > formatting characters used by the enhanced text mode:
> >
> >      if (strchr("^_@&~",p[1]) == NULL)

> > > Has this been introduced relatively recently? E.g.
> > > as consequence of including support for multibyte
> > > char sets?
> >
> > Nope.  The current code has been this way since 2004.
> > (version 3.8 something).
>
> That's pretty recent. ;-)
>
> The docs/psdoc/ps_guide.ps file specifically
> gives examples with curlies, and since it is a
> Postscript file itself, I would have thought that
> Postscript works.

Sure.  I agree it's a bug, and the simple-minded fix is obvious -
just add curly brackets to the test above.   My concern is that
the simple-minded fix may break some character encodings.
Or maybe not.   The encodings at risk are not ones that I use,
so I can't easily test.

--
Ethan A Merritt

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta