ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Arthur Reutenauer <arthur.reutenauer@normalesup.org>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: makempy (pstoedit <-> gs) hangs
Date: Mon, 30 Jul 2007 01:37:25 +0200	[thread overview]
Message-ID: <20070729233725.GA11143@phare.normalesup.org> (raw)
In-Reply-To: <22af238a0707290552m4878635ase391bbd9bb7038cd@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

  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 ;-).


>                                                       Since pstoedit
> mucks with ghostscript's SYSTEMDICT it isn't surprising that problems
> arise for newer gs versions.

  That's what I thought too (even if the bug had nothing to do with that
apparently). I wonder if all that is really needed and if it wouldn't be
simpler and less error-prone to use a custom dictionary where all the
overriding functions are defined. Instead the author of pstoedit does quite
scary things with systemdict ...

>                               Maybe it is time for ghostscript to get
> an mpost driver.

  Sure, wouldn't harm either.

	Arthur

[-- Attachment #2: pstoedit.patch --]
[-- Type: text/x-diff, Size: 577 bytes --]

diff -cNrp pstoedit-3.44/src/pstoedit.ph pstoedit-3.44-patched/src/pstoedit.ph
*** pstoedit-3.44/src/pstoedit.ph	Mon Jul 30 00:35:24 2007
--- pstoedit-3.44-patched/src/pstoedit.ph	Mon Jul 30 00:34:29 2007
*************** const char * const PS_prologue[] = 
*** 1920,1926 ****
   " { 210 pscover ",
   " dup /OrigFont known ",
   " { 211 pscover ",
!  " /OrigFont get getorigfont  ",
   " }  ",
   " if ",
   " }  ",
--- 1920,1926 ----
   " { 210 pscover ",
   " dup /OrigFont known ",
   " { 211 pscover ",
!  " /OrigFont get % getorigfont  ",
   " }  ",
   " if ",
   " }  ",

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2007-07-29 23:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2244.1185265633.2368.ntg-context@ntg.nl>
2007-07-28 18:35 ` Wolfgang Werners-Lucchini
2007-07-29 12:52   ` George N. White III
2007-07-29 23:37     ` Arthur Reutenauer [this message]
     [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 13:46     ` luigi scarso
2007-07-30 15:54     ` George N. White III
2007-07-30 22:42   ` luigi scarso
     [not found] <mailman.2215.1185128434.2368.ntg-context@ntg.nl>
2007-07-23 22:49 ` Wolfgang Werners-Lucchini
2007-07-24  7:51   ` Hans Hagen
2007-07-20 23:19 Wolfgang Werners-Lucchini
2007-07-22 13:03 ` Mojca Miklavec
2007-07-29 12:45   ` George N. White III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070729233725.GA11143@phare.normalesup.org \
    --to=arthur.reutenauer@normalesup.org \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).