🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1889

Re: Ghostscript + distill?

#1889
From: Nick Holloway
Date: Tue, 08 Sep 1992 11:44
77 lines
2994 bytes
In <1992Sep7.211025.6855@mintaka.lcs.mit.edu> dmjones@theory.lcs.mit.edu (David M. Jones) writes:
> [ Vanishing text when using Glenn Reids Distillery with Ghostscript ]
> 
> This is typical: All font-setting commands simply disappear.  As a
> wild guess, I'd say this probably has something to do with the way
> findfont operates in GhostScript, but does anyone know for sure?

Distill uses the /ScaleMatrix in the font, which is not created by
Ghostscript.  This means that it will just ignore all text.  This seems
to be maintained by the operators scalefont and makefont.  

There is no mention of this dictionary element in the Adobe books I
could lay my hands on.

Here are my versions of these operators to perform the necessary
housekeeping (behaviour derived from asking a laser printer nicely).

    /scalefont {
	dup 3 1 roll scalefont
	dup /ScaleMatrix known {
	    dup /ScaleMatrix get
	}{
	    [ 1 0 0 1 0 0 ]
	} ifelse
	3 -1 roll dup 3 -1 roll scale 
	exch 15 dict copy dup 3 1 roll
	/ScaleMatrix 3 -1 roll put
	readonly
    } bind def

    /makefont {
	dup 3 1 roll makefont
	dup /ScaleMatrix known {
	    dup /ScaleMatrix get
	}{
	    [ 1 0 0 1 0 0 ]
	} ifelse
	3 -1 roll matrix concatmatrix
	exch 15 dict copy dup 3 1 roll
	/ScaleMatrix 3 -1 roll put
	readonly
    } bind def

    (/gnu/lib/ghostscript/gs_init.ps) (r) file cvx exec

This is in my version of gs_init.ps, so it will modify the operators
in the (writable) systemdict, and then it reads the system startup to
define all the rest of the stuff it needs.

I also have a small patch for the distillery.  This just prevents it
from sticking out some binary characters.  Has anybody got any idea why
distill's idea of bounding boxes seems a lot less accurate than bbfig's?

diff -c -r1.1 /dcs/res/alfie/lib/ps/still.ps
*** 1.1	1992/06/04 12:51:52
--- /dcs/res/alfie/lib/ps/still.ps	1992/06/04 12:53:52
***************
*** 1177,1183 ****
      } bdef
      /binaryfix { %def
  	dup false exch { %forall
! 	    dup 128 gt 1 index 32 lt or { %ifelse
  		str1 exch 0 exch put pop true exit
  	    }{ pop } ifelse
  	} forall
--- 1177,1183 ----
      } bdef
      /binaryfix { %def
  	dup false exch { %forall
! 	    dup 126 gt 1 index 32 lt or { %ifelse
  		str1 exch 0 exch put pop true exit
  	    }{ pop } ifelse
  	} forall

--
Nick Holloway |  `O O'  | alfie@dcs.warwick.ac.uk, alfie@warwick.UUCP,
[aka `Alfie'] | // ^ \\ | ..!uunet!mcsun!uknet!warwick!alfie
Technical Details
Message-ID: <1992Sep8.114437.28018@dcs.warwick.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!dcs.warwick.ac.uk!alfie
References: <1992Sep7.211025.6855@mintaka.lcs.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!warwick!dcs.warwick.ac.uk!alfie
From: alfie@dcs.warwick.ac.uk (Nick Holloway)
Newsgroups: comp.lang.postscript
Subject: Re: Ghostscript + distill?
Message-ID: <1992Sep8.114437.28018@dcs.warwick.ac.uk>
Date: 8 Sep 92 11:44:37 GMT
References: <1992Sep7.211025.6855@mintaka.lcs.mit.edu>
Sender: news@dcs.warwick.ac.uk (Network News)
Organization: Department of Computer Science, Warwick University, England
Lines: 77
Nntp-Posting-Host: box