[comp.text] TeXsun patch

grunwald@uiucdcsm.cs.uiuc.edu (02/05/88)

For people who've been using my TeX previewers, texx(X11) and texsun(SunView),
apply the following mods to file 'dvistuff.c'. The error manifests it self as
``jumbled'' letters, i.e. not aligned correctly. I'm suprised I didn't notice
it earlier & deduce the problem. You probably won't be able to 'patch' these
via 'patch' - you'll have to do them by hand.

I've also posted a new version of everything in pub/TeX/iptex.tar.Z on 
a.cs.uiuc.edu (anonymous FTP). I'll also post a complete update the previewers
in pub/TeX/previewers.tar.Z (it requires the other stuff). Recent features:
Complete tpic support, man pages, (thanks tim morgan), sliding while viewing
the exposed image, a cheesy ``restart where I left off'' attempt.

*** /tmp/,RCSt1a17841	Tue Feb  2 17:26:38 1988
--- /tmp/,RCSt2a17841	Tue Feb  2 17:26:39 1988
***************
*** 86,103 ****
  static long *pageOffset;
  
  /*
!  * Correct devpos (the actual device position) to be within dviMaxDrift pixels
   * of dvipos (the virtual DVI position).
   */
  #define FIXDRIFT(devpos, dvipos) \
! 	if ((devpos) < (dvipos)) \
! 		if ((dvipos) - (devpos) <= dviMaxDrift) \
! 			/* void */; \
! 		else \
! 			(devpos) = (dvipos) - dviMaxDrift; \
  	else \
! 		if ((devpos) - (dvipos) <= dviMaxDrift) \
! 			/* void */; \
  		else \
  			(devpos) = (dvipos) + dviMaxDrift
  
--- 86,100 ----
  static long *pageOffset;
  
  /*
!  * Correct devpos (the actual device position) to be within MaxDrift pixels
   * of dvipos (the virtual DVI position).
   */
  #define FIXDRIFT(devpos, dvipos) \
! 	if (ABS((devpos) - (dvipos)) <= dviMaxDrift) \
! 		/* void */; \
  	else \
! 		if ((devpos) < (dvipos)) \
! 			(devpos) = (dvipos) - dviMaxDrift; \
  		else \
  			(devpos) = (dvipos) + dviMaxDrift
  
***************
*** 305,311 ****
      }
  
      if (dviMaxDrift == -1) {
! 	dviMaxDrift = 3;
      }
  
      if (dviDPI == -1) {
--- 302,308 ----
      }
  
      if (dviMaxDrift == -1) {
! 	dviMaxDrift = DEFAULT_MAX_DRIFT;
      }
  
      if (dviDPI == -1) {
***************
*** 762,767 ****
--- 759,766 ----
      int shrunkWidth;
      int glyphWide;
      int glyphHigh;
+     int glyphAdvance;
+     int shrunkAdvance;
  
      int bytesWide;
      int shrunkBytesWide;
***************
*** 818,825 ****
--- 817,828 ----
      glyphHigh = gly -> g_height;
      glyphWide = gly -> g_width;
  
+     gly -> g_pixwidth = fromSP(gly -> g_tfmwidth);
+     glyphAdvance = gly -> g_pixwidth;
+ 
      shrunkHeight = (glyphHigh + shrinkH - 1) / shrinkH;
      shrunkWidth =  (glyphWide + shrinkW - 1) / shrinkW;
+     shrunkAdvance =  (glyphAdvance + shrinkW - 1) / shrinkW;
  
      bytesWide = (gly -> g_width + 7) >> 3;
      
***************
*** 935,940 ****
--- 938,944 ----
  
      ngly -> g_raster = (char * ) shrunkRaster;
      ngly -> g_width = shrunkWidth;
+     ngly -> g_pixwidth = shrunkAdvance;
      ngly -> g_height = shrunkHeight;
  
      ngly -> g_xorigin = gly -> g_xorigin / shrinkH;