From 2a6d79c4355c0d56a1f438c4ab0314b2f5aec724 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 19 Nov 2009 22:45:42 +0000 Subject: [PATCH] postscript hardcopy allows setting of background color --- src/frontend/com_hardcopy.c | 6 +++++- src/frontend/postsc.c | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/frontend/com_hardcopy.c b/src/frontend/com_hardcopy.c index 0db88191f..2498e1b8f 100644 --- a/src/frontend/com_hardcopy.c +++ b/src/frontend/com_hardcopy.c @@ -53,7 +53,11 @@ com_hardcopy(wordlist *wl) } if (!cp_getvar("hcopydevtype", VT_STRING, buf)) { - devtype = "plot5"; +#if defined (HAS_WINDOWS) || defined (__MINGW32__) || defined (_MSC_VER) + devtype = "postscript"; +#else + devtype = "plot5"; +#endif } else { devtype = buf; } diff --git a/src/frontend/postsc.c b/src/frontend/postsc.c index 43aafe5f5..3ada69006 100644 --- a/src/frontend/postsc.c +++ b/src/frontend/postsc.c @@ -65,6 +65,7 @@ static int fontwidth = FONTWIDTH; static int fontheight = FONTHEIGHT; static int screenflag = 0; static int colorflag = 0; +static int setcolor = 0; static double scale; /* Used for fine tuning */ static int xtadj; /* text adjustment x */ static int ytadj; /* text adjustment y */ @@ -88,7 +89,7 @@ PS_Init(void) scale = 1.0; } - if (!cp_getvar("hcopypscolor", VT_STRING, pscolor)) { + if (!cp_getvar("hcopypscolor", VT_NUM, &setcolor)) { colorflag = 0; dispdev->numcolors = 2; dispdev->numlinestyles = NUMELEMS(linestyle); @@ -97,7 +98,7 @@ PS_Init(void) dispdev->numcolors = 18; /* don't know what the maximum should be */ dispdev->numlinestyles = 1; } - pscolor[0]='\0'; +// pscolor[0]='\0'; if (!cp_getvar("hcopywidth", VT_STRING, pswidth)) { dispdev->width = 7.75 * 72.0 * scale; /* (8 1/2 - 3/4) * 72 */ @@ -198,7 +199,7 @@ PS_NewViewport(GRAPH *graph) fprintf(plotfile, "%g %g scale\n", 1.0 / scale, 1.0 / scale); if (colorflag == 1){ /* set the background to color0 */ - PS_SelectColor(0); + PS_SelectColor(setcolor); fprintf(plotfile,"%s setrgbcolor\n",pscolor); fprintf(plotfile,"newpath\n"); fprintf(plotfile,"%d %d moveto %d %d lineto\n",x1,y1,x2,y1);