=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/term/Attic/post.trm,v retrieving revision 1.1 retrieving revision 1.1.1.3 diff -u -p -r1.1 -r1.1.1.3 --- OpenXM_contrib/gnuplot/term/Attic/post.trm 2000/01/09 17:01:15 1.1 +++ OpenXM_contrib/gnuplot/term/Attic/post.trm 2003/09/15 07:09:38 1.1.1.3 @@ -1,5 +1,5 @@ /* - * $Id: post.trm,v 1.1 2000/01/09 17:01:15 maekawa Exp $ + * $Id: post.trm,v 1.1.1.3 2003/09/15 07:09:38 ohara Exp $ */ /* GNUPLOT - post.trm */ @@ -106,10 +106,6 @@ TERM_PUBLIC void PS_pointsize __PROTO((double ptsize)) #ifdef TERM_BODY /* PostScript driver by Russell Lang, rjl@monu1.cc.monash.edu.au */ -/* From version.c */ -extern char version[]; -extern char patchlevel[]; - #define PS_FLUSH_PATH \ if (ps_path_count) { fprintf(gpoutfile, "stroke "); ps_path_count = 0; } @@ -162,16 +158,17 @@ static char GPFAR * GPFAR PS_header[] = { "/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }\n", " {pop pop pop Solid {pop []} if 0 setdash} ifelse } def\n", /* Border Lines */ -"/BL { stroke gnulinewidth 2 mul setlinewidth } def\n", +"/BL { stroke userlinewidth 2 mul setlinewidth } def\n", /* Axes Lines */ -"/AL { stroke gnulinewidth 2 div setlinewidth } def\n", +"/AL { stroke userlinewidth 2 div setlinewidth } def\n", /* set user defined linewidth */ -"/UL { gnulinewidth mul /userlinewidth exch def } def\n", +"/UL { dup gnulinewidth mul /userlinewidth exch def\n", +" dup 1 lt {pop 1} if 10 mul /udl exch def } def\n", /* Plot Lines */ "/PL { stroke userlinewidth setlinewidth } def\n", /* Line Types */ "/LTb { BL [] 0 0 0 DL } def\n", /* border */ -"/LTa { AL [1 dl 2 dl] 0 setdash 0 0 0 setrgbcolor } def\n", /* axes */ +"/LTa { AL [1 udl mul 2 udl mul] 0 setdash 0 0 0 setrgbcolor } def\n", /* axes */ "/LT0 { PL [] 1 0 0 DL } def\n", "/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def\n", "/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def\n", @@ -443,6 +440,12 @@ static char GPFAR * GPFAR PS_header[] = { /* filled box : usage x1 y1 x2 y2 BoxFill */ "/BoxFill { gsave Rec 1 setgray fill grestore } def\n", +/* oblique symbol font, e.g. set xlabel 'b' "Symbol-Oblique" + gives an oblique (slanted) beta character */ +"/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n", +"dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n", +"currentdict end definefont pop\n", + NULL }; @@ -497,10 +500,10 @@ int can_reencode; return NULL; /* we did not find the name */ - - fnp = (struct PS_FontName *)gp_alloc(sizeof(struct PS_FontName), "PostScript Font record"); - fnp->name = gp_alloc(1+strlen(fname), "PostScript Font name"); - strcpy(fnp->name, fname); + + fnp = (struct PS_FontName *)gp_alloc(sizeof(struct PS_FontName), + "PostScript Font record"); + fnp->name = gp_strdup(fname); fnp->next = PS_DocFonts; PS_DocFonts = fnp; @@ -648,13 +651,15 @@ static int ps_common_uses_fonts; static unsigned int ps_common_xoff, ps_common_yoff; -TERM_PUBLIC void PS_common_init(encap, portrait, uses_fonts, xoff, yoff, bb_xmin, bb_ymin, bb_xmax, bb_ymax, dict) -int encap; /* encapsulated or not - 1 for pslatex */ -int portrait; /* 1 for pslatex */ -int uses_fonts; /* 0 for ps(la)tex */ -unsigned int xoff, yoff; /* how much to translate by */ -unsigned int bb_xmin, bb_ymin, bb_xmax, bb_ymax; /* bounding box */ -char **dict; /* extra entries for the dictionary */ +TERM_PUBLIC void +PS_common_init(encap, portrait, uses_fonts, xoff, yoff, bb_xmin, bb_ymin, bb_xmax, bb_ymax, dict) + int encap; /* encapsulated or not - 1 for pslatex */ + int portrait; /* 1 for pslatex */ + int uses_fonts; /* 0 for ps(la)tex */ + unsigned int xoff, yoff; /* how much to translate by */ + unsigned int bb_xmin, bb_ymin, + bb_xmax, bb_ymax; /* bounding box */ + char **dict; /* extra entries for the dictionary */ { static char GPFAR psi1[] = "%%%%Creator: gnuplot %s patchlevel %s\n\ %%%%CreationDate: %s\ @@ -831,11 +836,14 @@ NULL }; if (outstr) fprintf(gpoutfile, "%%%%Title: %s\n", outstr ); /* JFi */ time(&now); - fprintf(gpoutfile, psi1, version, patchlevel, asctime(localtime(&now)), uses_fonts ? "(atend)" : ""); + fprintf(gpoutfile, psi1, gnuplot_version, gnuplot_patchlevel, + asctime(localtime(&now)), uses_fonts ? "(atend)" : ""); - fprintf(gpoutfile,"%%%%BoundingBox: %d %d %d %d\n", xoff + bb_xmin, yoff + bb_ymin, xoff + bb_xmax, yoff + bb_ymax); + fprintf(gpoutfile,"%%%%BoundingBox: %d %d %d %d\n", xoff + bb_xmin, + yoff + bb_ymin, xoff + bb_xmax, yoff + bb_ymax); - fprintf(gpoutfile,"%%%%Orientation: %s\n", ps_portrait ? "Portrait" : "Landscape"); + fprintf(gpoutfile,"%%%%Orientation: %s\n", + ps_portrait ? "Portrait" : "Landscape"); if (!encap) fprintf(gpoutfile,"%%%%Pages: (atend)\n"); @@ -931,13 +939,14 @@ TERM_PUBLIC void PS_graphics() { static char GPFAR psg1[] = "0 setgray\nnewpath\n"; struct termentry *t = term; + ps_page++; if (!ps_common_encap) fprintf(gpoutfile,"%%%%Page: %d %d\n",ps_page,ps_page); fprintf(gpoutfile,"gnudict begin\ngsave\n"); fprintf(gpoutfile,"%d %d translate\n",ps_common_xoff, ps_common_yoff); - fprintf(gpoutfile,"%.3f %.3f scale\n", (ps_eps ? 0.5 : 1.0)/PS_SC, - (ps_eps ? 0.5 : 1.0)/PS_SC); + fprintf(gpoutfile,"%.3f %.3f scale\n", (ps_common_encap ? 0.5 : 1.0)/PS_SC, + (ps_common_encap ? 0.5 : 1.0)/PS_SC); if (!ps_common_portrait) { fprintf(gpoutfile,"90 rotate\n0 %d translate\n", (int)(-PS_YMAX)); } @@ -1761,7 +1770,7 @@ START_HELP(post) " Braces can be used to place multiple-character text where a single character", " is expected (e.g., 2^{10}). To change the font and/or size, use the full", " form: {/[fontname][=fontsize | *fontscale] text}. Thus {/Symbol=20 G} is a", -" 20-point GAMMA) and {/*0.75 K} is a K at three-quarters of whatever fontsize", +" 20-point GAMMA and {/*0.75 K} is a K at three-quarters of whatever fontsize", " is currently in effect. (The '/' character MUST be the first character after", " the '{'.)", "",