diff options
Diffstat (limited to 'sci-electronics/ng-spice-rework/files/ng-spice-rework-postscript.patch')
-rw-r--r-- | sci-electronics/ng-spice-rework/files/ng-spice-rework-postscript.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/sci-electronics/ng-spice-rework/files/ng-spice-rework-postscript.patch b/sci-electronics/ng-spice-rework/files/ng-spice-rework-postscript.patch new file mode 100644 index 000000000..e9e1a67e4 --- /dev/null +++ b/sci-electronics/ng-spice-rework/files/ng-spice-rework-postscript.patch @@ -0,0 +1,79 @@ +diff -Nadurp ng-spice-rework-17/src/frontend/postsc.c ng-spice-rework-17-r1/src/frontend/postsc.c +--- ng-spice-rework-17/src/frontend/postsc.c 2005-05-30 22:28:30.000000000 +0200 ++++ ng-spice-rework-17-r1/src/frontend/postsc.c 2006-05-04 09:44:06.000000000 +0200 +@@ -88,14 +88,13 @@ PS_Init(void) + scale = 1.0; + } + ++ dispdev->numlinestyles = NUMELEMS(linestyle); + if (!cp_getvar("hcopypscolor", VT_STRING, pscolor)) { + colorflag = 0; + dispdev->numcolors = 2; +- dispdev->numlinestyles = NUMELEMS(linestyle); + } else { + colorflag = 1; + dispdev->numcolors = 18; /* don't know what the maximum should be */ +- dispdev->numlinestyles = 1; + } + pscolor[0]='\0'; + +@@ -118,6 +117,10 @@ PS_Init(void) + dispdev->height = 10000; + } + ++ dispdev->width *= 1000; ++ dispdev->height *= 1000; ++ scale *= 1000.0; ++ + /* The following side effects have to be considered + * when the printer is called by com_hardcopy ! + * gr_init: +@@ -160,6 +163,7 @@ PS_NewViewport(GRAPH *graph) + { + int x1,x2,y1,y2; + hcopygraphid = graph->graphid; ++ bool nobg; + + if (!(plotfile = fopen(graph->devdep, "w"))) { + perror(graph->devdep); +@@ -180,29 +184,33 @@ PS_NewViewport(GRAPH *graph) + graph->absolute.width = dispdev->width; + graph->absolute.height = dispdev->height; + /* Also done in gr_init, if called . . . */ +- graph->viewportxoff = 8 * fontwidth; +- graph->viewportyoff = 4 * fontheight; ++ graph->viewportxoff = 8 * graph->fontwidth; ++ graph->viewportyoff = 4 * graph->fontheight; + + xoff = scale * XOFF; + yoff = scale * YOFF; + + x1 = 0.75 * 72; + y1 = x1; +- x2 = graph->absolute.width + .75 * 72; +- y2 = graph->absolute.height + .75 * 72; ++ x2 = graph->absolute.width / 1000 + 0.75 * 72; ++ y2 = graph->absolute.height / 1000 + 0.75 * 72; + /* start file off with a % */ + fprintf(plotfile, "%%!PS-Adobe-3.0 EPSF-3.0\n"); + fprintf(plotfile, "%%%%Creator: nutmeg\n"); + fprintf(plotfile, "%%%%BoundingBox: %d %d %d %d\n",x1,y1,x2,y2); + + fprintf(plotfile, "%g %g scale\n", 1.0 / scale, 1.0 / scale); ++ fprintf(plotfile, "1000 setlinewidth\n"); + +- if (colorflag == 1){ /* set the background to color0 */ ++ cp_getvar("hcopypsnobg", VT_BOOL, &nobg); ++ if (!nobg && colorflag == 1){ /* set the background to color0 */ + PS_SelectColor(0); + fprintf(plotfile,"%s setrgbcolor\n",pscolor); + fprintf(plotfile,"newpath\n"); +- fprintf(plotfile,"%d %d moveto %d %d lineto\n",x1,y1,x2,y1); +- fprintf(plotfile,"%d %d lineto %d %d lineto\n",x2,y2,x1,y2); ++ fprintf(plotfile,"%d %d moveto %d %d lineto\n", ++ x1*1000,y1*1000,x2*1000,y1*1000); ++ fprintf(plotfile,"%d %d lineto %d %d lineto\n", ++ x2*1000,y2*1000,x1*1000,y2*1000); + fprintf(plotfile,"closepath fill\n"); + } + |