bug-a2ps
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Postscript bug in /reencode when /UnderlineThickness not present in Font


From: Bill Fenner
Subject: Postscript bug in /reencode when /UnderlineThickness not present in FontInfo dictionary
Date: Wed, 20 Jul 2005 17:39:57 -0400

The postscript that a2ps 4.13 generates won't render using Apple's postscript interpreter (tested using MacOS 10.3.x or 10.4.x) which is used, e.g., if you have a raster-based printer attached to your system. In response to my bug report, an Apple engineer pointed out that it appears to be a problem with the postscript that a2ps generates - Apple's text below:

The code in the /reencode procedure currently reads:
     ...
      dup /UnderlineThickness known {
    /UnderlineThickness get
    0 exch FontMatrix transform exch pop
    /UnderlineThickness exch def
      } if

If there is NOT an /UnderlineThickness key in the FontInfo dictionary then this code leaves a copy of the FontInfo dictionary on the operand stack and the remainder of the code does not execute correctly. This code should be rewritten to read:

      dup /UnderlineThickness known {
    /UnderlineThickness get
    0 exch FontMatrix transform exch pop
    /UnderlineThickness exch def
      } { % pop the FontInfo dictionary off the operand stack
       pop
    }ifelse

Most PostScript interpreters define these keys in the FontInfo dictionary so this code executes without an error. It is only in the case where the FontInfo dictionary exists but the /UnderlineThickness does not exist in that dictionary that the code fails.

This code fails in a similar fashion with Adobe Distiller.


--
(back to Bill, the bug reporter)
Presumably the same ifelse might be useful in the code handling / UnderlinePosition.

  Bill






reply via email to

[Prev in Thread] Current Thread [Next in Thread]