This is a modified version of Ghostscript, patched as below. The changes are: - Change error code with mswinpr2 printing cancelled, to make exit a little cleaner. - Remove mswinrp2 temporary file when printing cancelled. - Fix TextAlphaBits=4 bug, which resulted in xscale=4, yscale=1 instead of the correct xscale=2, yscale=2. - Fix arcto bug. - Return error code for 'gs -h', to force Win32 GUI Ghostscript to pause on exit. The original Ghostscript distribution is in ftp://ftp.cs.wisc.edu/ghost/aladdin/gs401w32.zip.orig Russell Lang, 2 Aug 1996 diff -c ./gdevwpr2.c ../gdevwpr2.c *** ./gdevwpr2.c Mon Jun 24 23:51:42 1996 --- ../gdevwpr2.c Thu Aug 01 17:58:40 1996 *************** *** 106,112 **** pd.Flags = PD_PRINTSETUP | PD_RETURNDC; if (!PrintDlg(&pd)) { /* device not opened - exit ghostscript */ ! return gs_error_limitcheck; } GlobalFree(pd.hDevMode); GlobalFree(pd.hDevNames); --- 106,112 ---- pd.Flags = PD_PRINTSETUP | PD_RETURNDC; if (!PrintDlg(&pd)) { /* device not opened - exit ghostscript */ ! return gs_error_Fatal; } GlobalFree(pd.hDevMode); GlobalFree(pd.hDevNames); *************** *** 169,174 **** --- 169,176 ---- wdev->fname, "wb"); fclose(pfile); code = gdev_prn_open(dev); + /* delete unwanted temporary file */ + unlink(wdev->fname); /* inform user of progress with dialog box and allow cancel */ #ifdef __WIN32__ *************** *** 211,218 **** #endif DeleteDC(wdev->hdcprn); code = gdev_prn_close(dev); - /* delete unwanted temporary file */ - unlink(wdev->fname); return code; } --- 213,218 ---- *************** *** 335,341 **** } if (hDlgModeless == 0) ! code = gs_error_unknownerror; else { /* push out the page */ SetWindowText(GetDlgItem(hDlgModeless, CANCEL_PCDONE), "Ejecting page..."); --- 335,341 ---- } if (hDlgModeless == 0) ! code = gs_error_Fatal; /* exit Ghostscript cleanly */ else { /* push out the page */ SetWindowText(GetDlgItem(hDlgModeless, CANCEL_PCDONE), "Ejecting page..."); diff -c ./gschar.c ../gschar.c *** ./gschar.c Tue Jun 11 12:52:04 1996 --- ../gschar.c Thu Aug 01 17:33:56 1996 *************** *** 524,531 **** { int more_bits = alpha_bits - (log2_scale.x + log2_scale.y); if ( more_bits > 0 ) ! { log2_scale.x += (more_bits + 1) >> 1; ! log2_scale.y += more_bits >> 1; } } else --- 524,537 ---- { int more_bits = alpha_bits - (log2_scale.x + log2_scale.y); if ( more_bits > 0 ) ! { if (log2_scale.x <= log2_scale.y) ! { log2_scale.x += (more_bits + 1) >> 1; ! log2_scale.y += more_bits >> 1; ! } ! else ! { log2_scale.x += more_bits >> 1; ! log2_scale.y += (more_bits + 1) >> 1; ! } } } else diff -c ./gspath1.c ../gspath1.c *** ./gspath1.c Sun Jul 07 15:21:14 1996 --- ../gspath1.c Thu Aug 01 17:34:54 1996 *************** *** 170,176 **** yt0 = ay1 + dy0 * l0; xt2 = ax1 + dx2 * l2; yt2 = ay1 + dy2 * l2; ! code = arc_add(pgs, true, arad, xt0, yt0, xt2, yt2, ax1, ay1); } } if ( retxy != 0 ) --- 170,176 ---- yt0 = ay1 + dy0 * l0; xt2 = ax1 + dx2 * l2; yt2 = ay1 + dy2 * l2; ! code = arc_add(pgs, arc_lineto, arad, xt0, yt0, xt2, yt2, ax1, ay1); } } if ( retxy != 0 ) diff -c ./imainarg.c ../imainarg.c *** ./imainarg.c Tue Jul 09 17:32:50 1996 --- ../imainarg.c Fri Aug 02 05:17:08 1996 *************** *** 292,298 **** helping = true; } if ( helping ) ! gs_exit(0); } /* Execute files named in the command line, */ /* processing options along the way. */ --- 292,298 ---- helping = true; } if ( helping ) ! gs_exit(1); } /* Execute files named in the command line, */ /* processing options along the way. */ *************** *** 424,430 **** case 'h': /* print help */ case '?': /* ditto */ print_help(minst); ! gs_exit(0); case 'I': /* specify search path */ gs_main_add_lib_path(minst, arg_copy(arg)); break; --- 424,430 ---- case 'h': /* print help */ case '?': /* ditto */ print_help(minst); ! gs_exit(1); case 'I': /* specify search path */ gs_main_add_lib_path(minst, arg_copy(arg)); break;