ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: makempy (pstoedit <-> gs) hangs
       [not found] <mailman.1.1185789602.14300.ntg-context@ntg.nl>
@ 2007-07-30 12:30 ` Wolfgang Werners-Lucchini
  2007-07-30 13:03   ` Arthur Reutenauer
  2007-07-30 22:42   ` makempy (pstoedit <-> gs) hangs luigi scarso
  2007-07-31 20:02 ` itemize with zero start Wolfgang Werners-Lucchini
  1 sibling, 2 replies; 9+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-07-30 12:30 UTC (permalink / raw)
  To: ntg-context

Hallo!

>   I think I've identified the problem: in the PostScript prologue
> file for
> pstoedit you find the following bit of code (slightly simplified):
> 
> 	/getorigfont
> 	{
> 	  dup /OrigFont known
> 	  {
> 	    /OrigFont get getorigfont
> 	  }
> 	  if
> 	}
> 	def
> 
> 
>   I guess anyone, even not familiar with PostScript, can spot the
> error here:
> getorigfont is called recursively ad infinitum! I have no idea why
> this is so,
> but this mistake is easy to correct, by simply commenting out the
> innermost
> ?getorigfont?; and it indeed fixes the problem with Wolfgang's
> code.
> 
>   Why the error wouldn't happen with older versions of gs isn't
> clear to me and
> I haven't tested it (for debugging I used pstoedit 3.44 and gs
> 8.56
> throughout); on the other hand, it's quite clear why the bug
> wouldn't show up
> on code that uses only outlines and no font, like in the last
> example of
> http://wiki.contextgarden.net/User-Defined_Enumerations as George
> pointed out:
> the spurious piece of code is only used for font redefinitions and
> is therefore
> not called in the case of the fuzzy itemize style, because the
> symbols are not
> taken from a font.
> 
>   For people wanting to compile an amended version of pstoedit, the
> attached
> patch should do the trick, although hand-editing the relevant file
> (src/pstoedit.ph) should be just as easy (this is really a 2-byte
> patch ? and
> you can even turn it into a 2-bit patch ;-).

Thank you Arthur!

I have patched 'pstoedit.dll' version 3.44 (0x6B674: 0x20 --> 0x25)
and so it works with gs 8.57 for me!

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: makempy (pstoedit <-> gs) hangs
  2007-07-30 12:30 ` makempy (pstoedit <-> gs) hangs Wolfgang Werners-Lucchini
@ 2007-07-30 13:03   ` Arthur Reutenauer
  2007-07-30 13:46     ` luigi scarso
  2007-07-30 15:54     ` George N. White III
  2007-07-30 22:42   ` makempy (pstoedit <-> gs) hangs luigi scarso
  1 sibling, 2 replies; 9+ messages in thread
From: Arthur Reutenauer @ 2007-07-30 13:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I have patched 'pstoedit.dll' version 3.44 (0x6B674: 0x20 --> 0x25)
> and so it works with gs 8.57 for me!

  (Yes, that 2-bit patch ;-)

  Great! In the mean time I exchanged mail with the author of pstoedit
(thanks to someone who forwarded my previous mail to him ;-) and it
should be fixed in the next release of pstoedit (3.45). Actually the
problem was (of course) a bit more complicated than what I first
described and there was a reason why getorigfont should call itself
recursively; and why it wouldn't work with newer versions of gs (I can
explain it in case anyone is interested).

  Anyway, glad I could help.

	Arthur
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: makempy (pstoedit <-> gs) hangs
  2007-07-30 13:03   ` Arthur Reutenauer
@ 2007-07-30 13:46     ` luigi scarso
  2007-07-30 15:54     ` George N. White III
  1 sibling, 0 replies; 9+ messages in thread
From: luigi scarso @ 2007-07-30 13:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/30/07, Arthur Reutenauer <arthur.reutenauer@normalesup.org> wrote:
> > I have patched 'pstoedit.dll' version 3.44 (0x6B674: 0x20 --> 0x25)
> > and so it works with gs 8.57 for me!
>
>   (Yes, that 2-bit patch ;-)
>
>   Great! In the mean time I exchanged mail with the author of pstoedit
> (thanks to someone who forwarded my previous mail to him ;-) and it
> should be fixed in the next release of pstoedit (3.45). Actually the
> problem was (of course) a bit more complicated than what I first
> described and there was a reason why getorigfont should call itself
> recursively; and why it wouldn't work with newer versions of gs (I can
> explain it in case anyone is interested).
>
>   Anyway, glad I could help.

Well, you made 30, you can make 31 :)

-- 
luigi
----------------------------------------------------------------
If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: makempy (pstoedit <-> gs) hangs
  2007-07-30 13:03   ` Arthur Reutenauer
  2007-07-30 13:46     ` luigi scarso
@ 2007-07-30 15:54     ` George N. White III
  2007-07-30 21:52       ` Bug in pstoedit 3.44 (was: makempy (pstoedit <-> gs) hangs) Arthur Reutenauer
  1 sibling, 1 reply; 9+ messages in thread
From: George N. White III @ 2007-07-30 15:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/30/07, Arthur Reutenauer <arthur.reutenauer@normalesup.org> wrote:

> > I have patched 'pstoedit.dll' version 3.44 (0x6B674: 0x20 --> 0x25)
> > and so it works with gs 8.57 for me!
>
>   (Yes, that 2-bit patch ;-)
>
>   Great! In the mean time I exchanged mail with the author of pstoedit
> (thanks to someone who forwarded my previous mail to him ;-) and it
> should be fixed in the next release of pstoedit (3.45). Actually the
> problem was (of course) a bit more complicated than what I first
> described and there was a reason why getorigfont should call itself
> recursively; and why it wouldn't work with newer versions of gs (I can
> explain it in case anyone is interested).

I'm interested, but it is good to post the explanation so it becomes
part of the public record google can find.  Problems like this have a
way of cropping up many times -- it will be a few years before all linux
distros have updated to the new version, and some will make backports
of the patch.  The next people who encounter this will benefit from seeing
the explanation so they can make the fix in somewhat different versions
of pstoedit..

-- 
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug in pstoedit 3.44 (was: makempy (pstoedit <-> gs) hangs)
  2007-07-30 15:54     ` George N. White III
@ 2007-07-30 21:52       ` Arthur Reutenauer
  2007-07-31  8:07         ` luigi scarso
  0 siblings, 1 reply; 9+ messages in thread
From: Arthur Reutenauer @ 2007-07-30 21:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I'm interested, but it is good to post the explanation so it becomes
> part of the public record google can find.

  Well, that wouldn't be the first time I report a bug indirectly; so here goes:

  When font dictionaries are altered (by changing FontMatrix, etc ...)
in PostScript, it is customary to keep a copy of the original
dictionary, which appears in the modified dictionary as a object
associated with the key OrigFont.  Now, if a programmer wants to access
the original dictionary, he / she must of course expect to search the
dictionary recursively; hence the original definition of getorigfont
(which wasn't that bad actually):

        % Here the stack must contain a font dictionary
        /getorigfont
        {
          dup /OrigFont known
          {
            /OrigFont get getorigfont
          }
          if
        }
        def

  This definition could have worked in other languages ... but not in
PostScript, because of the nature of dictionaries: they're so-called
“composite objects”, meaning that if you copy this object on the stack you get
eaxctly the same physical object (this is a bit like pointers in C); for
further details see the PostScript Language Reference Manual, section 3.3.1
(http://www.adobe.com/products/postscript/pdfs/PLRM.pdf).  Anyway, this means
that a dictionary can contain itself, and this was the case with the font at
stake (LMSans by the Latin Modern team, converted from cminch by Knuth).  So
retrieving OrigFont yielded the exact same dictionary at each iteration, and
this created the endless loop.

  This (somewhat weird) definition of the font only started with
Ghostscript 8.56; this is why the bug didn't happen with older versions
of Ghostscript.

  The real bugfix Wolfgang Glunz (author of pstoedit) did was to check
at each iteration if the retrieved OrigFont dictionary was actually
different, thus avoiding the loop, but still looking for the “most
original” font dictionary.  As I said, the new code will be incorporated in
pstoedit 3.45 and looks like:

	% font getorigfont font
	/getorigfont
	{ 210 pscover
	  %
	  % retrieves the father font of the input font if possible
	  % returns a font.
	  %
	  dup /OrigFont known
	  % OrigFont is provided at least if Font was generated with makefont
	  { 211 pscover
	    dup % for comparison
	    dup /OrigFont get ne  % ne is a weak check against recursion
	                          % but is was needed from gs8.56
	    {
	      /OrigFont get getorigfont
	    } if
	  } if
	}
	def

  For people wanting to experiment with pstoedit, you will certainly find the
-pscover switch most useful: it writes to the file “pscover.txt” a unique
number corresponding to a particular chunk of code in the PostScript prologue
(the psinXXXXXX file); look for “xyz pscover”, where xyz is a integral number;
this is how I found the bug in the first place.

   That's about all. Hope you had fun reading this,

	Arthur
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: makempy (pstoedit <-> gs) hangs
  2007-07-30 12:30 ` makempy (pstoedit <-> gs) hangs Wolfgang Werners-Lucchini
  2007-07-30 13:03   ` Arthur Reutenauer
@ 2007-07-30 22:42   ` luigi scarso
  1 sibling, 0 replies; 9+ messages in thread
From: luigi scarso @ 2007-07-30 22:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Thank you Arthur!
>
> I have patched 'pstoedit.dll' version 3.44 (0x6B674: 0x20 --> 0x25)
> and so it works with gs 8.57 for me!
Also from,
http://www.ntg.nl/pipermail/ntg-context/2005/011598.html
(yes 2005 !)
this works now
\starttext
 \startMPcode
 graphictext "MP" scaled 8 outlinefill
withdrawcolor .7blue withfillcolor .7white dashed
evenly withpen
pencircle scaled 2pt ;
\stopMPcode


-- 
luigi
----------------------------------------------------------------
If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug in pstoedit 3.44 (was: makempy (pstoedit <-> gs) hangs)
  2007-07-30 21:52       ` Bug in pstoedit 3.44 (was: makempy (pstoedit <-> gs) hangs) Arthur Reutenauer
@ 2007-07-31  8:07         ` luigi scarso
  0 siblings, 0 replies; 9+ messages in thread
From: luigi scarso @ 2007-07-31  8:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/30/07, Arthur Reutenauer <arthur.reutenauer@normalesup.org> wrote:
> > I'm interested, but it is good to post the explanation so it becomes
> > part of the public record google can find.
>
>   Well, that wouldn't be the first time I report a bug indirectly; so here goes:
ok, thank you very much !

-- 
luigi
----------------------------------------------------------------
If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: itemize with zero start
       [not found] <mailman.1.1185789602.14300.ntg-context@ntg.nl>
  2007-07-30 12:30 ` makempy (pstoedit <-> gs) hangs Wolfgang Werners-Lucchini
@ 2007-07-31 20:02 ` Wolfgang Werners-Lucchini
  2007-07-31 20:36   ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-07-31 20:02 UTC (permalink / raw)
  To: ntg-context

Hallo,

has nobody tested this with 
ConTeXt version <= 2007.07.03 19:38 MKII?

Wolfgang

> Here is an other example!
> Remove the three-line-comment, and the error is gone!
> Strange what?
> 
> Wolfgang
> ---------------------------------------------
> \setupbodyfont[sansserif,11pt]
> \setuphead[section][style=ssb]
> \setupsection[section][conversion=Romannumerals]
> 
> \setupitemize[each][a][stopper=:]
> 
> \definestartstop[Beweis][
>   before={{\bf Beweis:}\endgraf\blank},
>   after={\rightaligned{{\bf q.e.d.}}}
>   ]
> 
> \starttext
> 
> \section{Zofff}
> 
> \startBeweis
> \startitemize
> \item zack
> \item zong
> \stopitemize
> \stopBeweis
> %
> %==================================================================
> %
> \section{Bamm}
> 
> \startitemize
> \item bla
> \item blub
> \item bautz
> \stopitemize
> 
> \stoptext
> ---------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: itemize with zero start
  2007-07-31 20:02 ` itemize with zero start Wolfgang Werners-Lucchini
@ 2007-07-31 20:36   ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2007-07-31 20:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Werners-Lucchini wrote:
> Hallo,
> 
> has nobody tested this with 

did you update?


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-31 20:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1.1185789602.14300.ntg-context@ntg.nl>
2007-07-30 12:30 ` makempy (pstoedit <-> gs) hangs Wolfgang Werners-Lucchini
2007-07-30 13:03   ` Arthur Reutenauer
2007-07-30 13:46     ` luigi scarso
2007-07-30 15:54     ` George N. White III
2007-07-30 21:52       ` Bug in pstoedit 3.44 (was: makempy (pstoedit <-> gs) hangs) Arthur Reutenauer
2007-07-31  8:07         ` luigi scarso
2007-07-30 22:42   ` makempy (pstoedit <-> gs) hangs luigi scarso
2007-07-31 20:02 ` itemize with zero start Wolfgang Werners-Lucchini
2007-07-31 20:36   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).