🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
3 messages
3 total messages Started by David M. Jones Mon, 07 Sep 1992 21:10
Ghostscript + distill?
#1884
Author: David M. Jones
Date: Mon, 07 Sep 1992 21:10
36 lines
1401 bytes
Has anyone been able to get Glenn Reid's still.ps to work with
Ghostscript?  I have still.ps V 1.0d release 12 edit 0 and Ghostscript
version 2.4.1.  If I give the following file:

    %!

    /Times-Roman findfont 12 scalefont setfont

    72 300 moveto

    (hello, world) show

    showpage

to distill, I get the following:

    %%BeginSetup
     PROLOGUE begin
    (hello, world) 71.9999 300 T
    1 ENDPAGE
    %%PageTrailer
    %%PageFonts: 
    %%PageBoundingBox: 71 299 129 299 
     end %PROLOGUE
    %%Trailer
    %%Pages: 1 
    %%BoundingBox: 71 299 129 299 
    %%DocumentFonts: 
    %%EOF

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?

David M. Jones                              "Trifles! Trifles light as air!"
dmjones@theory.lcs.mit.edu                              -- the Hystricide
Re: Ghostscript + distill?
#1889
Author: 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
Re: Ghostscript + distill?
#1928
Author: David M. Jones
Date: Fri, 11 Sep 1992 16:41
29 lines
1943 bytes
In article <1992Sep8.114437.28018@dcs.warwick.ac.uk>, alfie@dcs (Nick Holloway) writes:
>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).

Your definitions of scalefont and makefont do seem to solve the
problem.

Unfortunately, now it seems that distill doesn't work with version 71
of the LaserPrep header (neither does bbfig).  Luckily I have an
alternative now.

Thanks for you answer.

David M. Jones                              "Trifles! Trifles light as air!"
dmjones@theory.lcs.mit.edu                              -- the Hystricide
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads