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

Re: 8r encoding + xdvi :-(



Earlier today I wrote:

> ...
> In this case Private/compose seems to interfere with charpath + pathbbox
> used in gsftopk.  I'll try to come up with a workaround soon.

Here's a patch (relative to gsftopk 1.9) which I believe solves all problems
with *.gsf + gsftopk + xdvi which do not occur also with *.gsf + dvips + gs:

Please let me know if you find additional problems.

--Paul Vojta, vojta@math.berkeley.edu

-- cut here --
*** /home/seattle_b/fac/vojta/Xdvi/gsftopk/render.ps	Tue Apr 25 19:04:50 1995
--- ./render.ps	Tue May 30 18:48:26 1995
***************
*** 1,5 ****
  % render.ps - write font bitmaps and metric information to standard output.
! % Version 1.9.
  
  % Copyright (c) 1994 Paul Vojta.  All rights reserved.
  %
--- 1,5 ----
  % render.ps - write font bitmaps and metric information to standard output.
! % Version 1.10.
  
  % Copyright (c) 1994 Paul Vojta.  All rights reserved.
  %
***************
*** 69,76 ****
  bind def
  
  % (exec) getbbox -
! %	Get bounding box of the executable object.
! %	It also makes a device just a few pixels larger on each side.
  
  /getbbox
    {
--- 69,76 ----
  bind def
  
  % (exec) getbbox -
! %	Get bounding box of the executable object and save it in char-urx,
! %	char-ury, etc.
  
  /getbbox
    {
***************
*** 85,91 ****
--- 85,121 ----
        /char-lly exch floor cvi def
        /char-llx exch floor cvi def
      grestore
+   }
+ bind def
  
+ % - drawfontbbox -
+ %	Draw the font's bbox.
+ 
+ /drawfontbbox
+   {
+     currentfont /FontBBox get
+     dup dup 0 get exch 1 get currentfont /FontMatrix get transform moveto
+     dup dup 0 get exch 3 get currentfont /FontMatrix get transform lineto
+     dup dup 2 get exch 1 get currentfont /FontMatrix get transform lineto
+     dup     2 get exch 3 get currentfont /FontMatrix get transform lineto
+   }
+ bind def
+ 
+ % (exec) mkbboxdev -
+ %	Get bounding box of the executable object and make a device a few
+ %	pixels larger on each side.  If pathbbox fails for the object,
+ %	then use the font's bbox.
+ 
+ /mkbboxdev
+   {
+     getbbox
+ 
+     char-llx char-urx sub round 0 eq char-lly char-ury sub round 0 eq or
+       {
+ 	{drawfontbbox} getbbox
+       }
+     if
+ 
        matrix
        char-urx char-llx sub 4 add % width
  	dup /width exch def
***************
*** 190,197 ****
  % Define the font, and make it current.
  
  /TargetFont fontname cvlit findfont def
-   TargetFont
    [ font-size 0 specinfo cvx exec 0 exch font-size 0 0 ]
  makefont setfont
  
  % If the font's bounding box is zero, then do not use it.
--- 220,227 ----
  % Define the font, and make it current.
  
  /TargetFont fontname cvlit findfont def
    [ font-size 0 specinfo cvx exec 0 exch font-size 0 0 ]
+   TargetFont exch
  makefont setfont
  
  % If the font's bounding box is zero, then do not use it.
***************
*** 207,219 ****
  
  usefontbbox
    {
!     { currentfont /FontBBox get
!       dup dup 0 get exch 1 get currentfont /FontMatrix get transform moveto
!       dup dup 0 get exch 3 get currentfont /FontMatrix get transform lineto
!       dup dup 2 get exch 1 get currentfont /FontMatrix get transform lineto
!       dup     2 get exch 3 get currentfont /FontMatrix get transform lineto
!     }
!     getbbox
    }
  if
  
--- 237,243 ----
  
  usefontbbox
    {
!     {drawfontbbox} mkbboxdev
    }
  if
  
***************
*** 227,233 ****
      % Get the character's bounding box.  This also makes the device.
      usefontbbox not
        {
! 	{ 0 0 moveto charstring true charpath } getbbox
        }
      if
  
--- 251,257 ----
      % Get the character's bounding box.  This also makes the device.
      usefontbbox not
        {
! 	{ 0 0 moveto charstring true charpath } mkbboxdev
        }
      if