🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #330

Ghostscript/X11 problems

#330
From: Richard Evans
Date: Tue, 01 Sep 1992 15:21
42 lines
2288 bytes
System: Sun SPARCstation, SunOS 4.1.2.  Ghostscript 2.5, X11 driver
===================================================================

I am having problems setting the papersize in the X11 Ghostscript:

1. The a4 operator in a postscript file closes the display and then reopens it.
The link to Ghostview is therefore lost!  Ghostview cannot display the output.
Also the X window (without using ghostview) appears and then disappears and
appears again.  Some example postscript generated from a text formatter is at
the end of this message.

2. A consequence of 1) is that ghostscript sometimes gets a `bad drawable' X
error.  This is because xdev->dest is initialised to an object when the display
is first opened, and is still non-zero when the display is opened again.

Line 476 of gdevxini.c:

	/* Clear the destination pixmap to avoid initializing with garbage. */
	if ( xdev->dest != (Pixmap)0 )
	  { XSetForeground(xdev->dpy, xdev->gc, pixel_white);
	    XFillRectangle(xdev->dpy, xdev->dest, xdev->gc,
			   0, 0, xdev->width, xdev->height);
	  }
	else
	  { xdev->dest = (xdev->bpixmap != (Pixmap)0 ?
			  xdev->bpixmap : (Pixmap)xdev->win);
	  }

If the window/pixmap ID returned on the second open is different from the
first, you get the error.  I fixed it by setting xdev->dest to 0 on entry to
gdev_x_open.

3. If I try gs -sPAPERSIZE=a4 I get a tiny 16x23 pixel X window.  I have no
idea why this is.  Using the postscript a4 operator gives a window of the
correct size.

-------------------------------------------------------------------------------
Richard Evans			 	Telephone : (+44) 223 462121   
Topexpress Ltd			 	Fax       : (+44) 223 315057
Poseidon House, Castle Park	 	E-Mail    : rde@uk.co.topexp    
Cambridge, CB3 0RD, UK		 		  : rde@topexpress.co.uk
-------------------------------------------------------------------------------
Technical Details
Message-ID: <15251.9209011521@igor.topexp.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!topexp.co.UK!rde

Show Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!topexp.co.UK!rde
From: rde@topexp.co.UK (Richard Evans)
Subject: Ghostscript/X11 problems
Message-ID: <15251.9209011521@igor.topexp.co.uk>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 1 Sep 1992 15:21:18 GMT
Approved: bug-ghostscript@prep.ai.mit.edu
Lines: 44