[comp.sources.bugs] snftobdf 1.1 to 1.2 patches

mleisher@nmsu.edu (Mark Leisher) (11/20/90)

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is snftobdf/patch, a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 11/17/1990 17:11 UTC by mleisher@nmsu.edu
# Source directory /thrinakia1/mleisher/x_stuff/snftobdf
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   3647 -rw-rw-r-- snftobdf1.1-1.2
#     21 -rw-rw-r-- patchlevel.h
#
# ============= snftobdf1.1-1.2 ==============
if test -f 'snftobdf1.1-1.2' -a X"$1" != X"-c"; then
	echo 'x - skipping snftobdf1.1-1.2 (File already exists)'
else
echo 'x - extracting snftobdf1.1-1.2 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'snftobdf1.1-1.2' &&
*** output.c.ORIG	Thu Oct 18 18:19:46 1990
--- output.c	Sat Nov 17 09:56:43 1990
***************
*** 6,12 ****
X  
X  extern char *program;
X  
! static int pixelSize, resX, resY;
X  
X  void
X  SetSizeAndRes(tf)
--- 6,12 ----
X  
X  extern char *program;
X  
! static int pointSize, pixelSize, resX, resY;
X  
X  void
X  SetSizeAndRes(tf)
***************
*** 17,26 ****
X          res_x_found = 0,
X          res_y_found = 0;
X  
!     resX = resY = pixelSize = 0;
X      for (i = 0; i < tf->pFI->nProps; i++) {
!         if (!strcmp(tf->pFP[i].name, "PIXEL_SIZE"))
!           pixelSize = tf->pFP[i].value;
X          else if (!strcmp(tf->pFP[i].name, "RESOLUTION"))
X            res = tf->pFP[i].value;
X          else if (!strcmp(tf->pFP[i].name, "RESOLUTION_X"))
--- 17,28 ----
X          res_x_found = 0,
X          res_y_found = 0;
X  
!     resX = resY = pointSize = pixelSize = 0;
X      for (i = 0; i < tf->pFI->nProps; i++) {
!         if (!strcmp(tf->pFP[i].name, "POINT_SIZE"))
!           pointSize = tf->pFP[i].value / 10;
!         else if (!strcmp(tf->pFP[i].name, "PIXEL_SIZE"))
!           pixelSize = tf->pFP[i].name;
X          else if (!strcmp(tf->pFP[i].name, "RESOLUTION"))
X            res = tf->pFP[i].value;
X          else if (!strcmp(tf->pFP[i].name, "RESOLUTION_X"))
***************
*** 63,69 ****
X      time(&clock);
X      printf("STARTFONT %s\n", BDF_VERSION);
X      printf("COMMENT\n");
!     printf("COMMENT GENERATED BY \"%s %d.%d\"\n", program,
X             SNFTOBDF_VERSION, patchlevel);
X      printf("COMMENT AUTHOR %s\n", AUTHOR_STRING);
X      printf("COMMENT DATE %s", ctime(&clock));
--- 65,71 ----
X      time(&clock);
X      printf("STARTFONT %s\n", BDF_VERSION);
X      printf("COMMENT\n");
!     printf("COMMENT GENERATED BY \"snftobdf %d.%d\"\n",
X             SNFTOBDF_VERSION, patchlevel);
X      printf("COMMENT AUTHOR %s\n", AUTHOR_STRING);
X      printf("COMMENT DATE %s", ctime(&clock));
***************
*** 84,97 ****
X      if (pixelSize == 0)
X        pixelSize = maxBounds->metrics.rightSideBearing +
X                    maxBounds->metrics.leftSideBearing;
X  
!     printf("SIZE %d %d %d\n", pixelSize, resX, resY);
X  
!     b1 = maxBounds->metrics.rightSideBearing -
!          minBounds->metrics.leftSideBearing;
X      b2 = maxBounds->metrics.ascent +
X           maxBounds->metrics.descent;
!     b3 = minBounds->metrics.leftSideBearing;
X      b4 = -(maxBounds->metrics.descent);
X  
X      printf("FONTBOUNDINGBOX %d %d %d %d\n", b1, b2, b3, b4);
--- 86,101 ----
X      if (pixelSize == 0)
X        pixelSize = maxBounds->metrics.rightSideBearing +
X                    maxBounds->metrics.leftSideBearing;
+     if (pointSize == 0)
+       pointSize = pixelSize;
X  
!     printf("SIZE %d %d %d\n", pointSize, resX, resY);
X  
!     b1 = maxBounds->metrics.rightSideBearing +
!          maxBounds->metrics.leftSideBearing;
X      b2 = maxBounds->metrics.ascent +
X           maxBounds->metrics.descent;
!     b3 = -(maxBounds->metrics.leftSideBearing);
X      b4 = -(maxBounds->metrics.descent);
X  
X      printf("FONTBOUNDINGBOX %d %d %d %d\n", b1, b2, b3, b4);
***************
*** 164,170 ****
X                         ((rownum << 8) & 0xff00)|(colnum & 0xff));
X              }
X                  
!             swidth = (dwidth * 72270)/(pixelSize * resX);
X              printf("SWIDTH %d 0\n", swidth);
X              printf("DWIDTH %d 0\n", dwidth);
X  
--- 168,174 ----
X                         ((rownum << 8) & 0xff00)|(colnum & 0xff));
X              }
X                  
!             swidth = (dwidth * 72270)/(pointSize * resX);
X              printf("SWIDTH %d 0\n", swidth);
X              printf("DWIDTH %d 0\n", dwidth);
X  
SHAR_EOF
chmod 0664 snftobdf1.1-1.2 ||
echo 'restore of snftobdf1.1-1.2 failed'
Wc_c="`wc -c < 'snftobdf1.1-1.2'`"
test 3647 -eq "$Wc_c" ||
	echo 'snftobdf1.1-1.2: original size 3647, current size' "$Wc_c"
fi
# ============= patchlevel.h ==============
if test -f 'patchlevel.h' -a X"$1" != X"-c"; then
	echo 'x - skipping patchlevel.h (File already exists)'
else
echo 'x - extracting patchlevel.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patchlevel.h' &&
#define patchlevel 2
SHAR_EOF
chmod 0664 patchlevel.h ||
echo 'restore of patchlevel.h failed'
Wc_c="`wc -c < 'patchlevel.h'`"
test 21 -eq "$Wc_c" ||
	echo 'patchlevel.h: original size 21, current size' "$Wc_c"
fi
exit 0
-----------------------------------------------------------------------------
mleisher@nmsu.edu                      "I laughed.
Mark Leisher                                I cried.
Computing Research Lab                          I fell down.
New Mexico State University                        It changed my life."
Las Cruces, NM                     - Rich [Cowboy Feng's Space Bar and Grille]