version 1.1, 2000/01/09 17:01:15 |
version 1.1.1.3, 2003/09/15 07:09:38 |
Line 106 TERM_PUBLIC void PS_pointsize __PROTO((double ptsize)) |
|
Line 106 TERM_PUBLIC void PS_pointsize __PROTO((double ptsize)) |
|
#ifdef TERM_BODY |
#ifdef TERM_BODY |
/* PostScript driver by Russell Lang, rjl@monu1.cc.monash.edu.au */ |
/* PostScript driver by Russell Lang, rjl@monu1.cc.monash.edu.au */ |
|
|
/* From version.c */ |
|
extern char version[]; |
|
extern char patchlevel[]; |
|
|
|
#define PS_FLUSH_PATH \ |
#define PS_FLUSH_PATH \ |
if (ps_path_count) { fprintf(gpoutfile, "stroke "); ps_path_count = 0; } |
if (ps_path_count) { fprintf(gpoutfile, "stroke "); ps_path_count = 0; } |
|
|
Line 162 static char GPFAR * GPFAR PS_header[] = { |
|
Line 158 static char GPFAR * GPFAR PS_header[] = { |
|
"/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }\n", |
"/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }\n", |
" {pop pop pop Solid {pop []} if 0 setdash} ifelse } def\n", |
" {pop pop pop Solid {pop []} if 0 setdash} ifelse } def\n", |
/* Border Lines */ |
/* Border Lines */ |
"/BL { stroke gnulinewidth 2 mul setlinewidth } def\n", |
"/BL { stroke userlinewidth 2 mul setlinewidth } def\n", |
/* Axes Lines */ |
/* Axes Lines */ |
"/AL { stroke gnulinewidth 2 div setlinewidth } def\n", |
"/AL { stroke userlinewidth 2 div setlinewidth } def\n", |
/* set user defined linewidth */ |
/* 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 */ |
/* Plot Lines */ |
"/PL { stroke userlinewidth setlinewidth } def\n", |
"/PL { stroke userlinewidth setlinewidth } def\n", |
/* Line Types */ |
/* Line Types */ |
"/LTb { BL [] 0 0 0 DL } def\n", /* border */ |
"/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", |
"/LT0 { PL [] 1 0 0 DL } def\n", |
"/LT1 { PL [4 dl 2 dl] 0 1 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", |
"/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def\n", |
Line 443 static char GPFAR * GPFAR PS_header[] = { |
|
Line 440 static char GPFAR * GPFAR PS_header[] = { |
|
/* filled box : usage x1 y1 x2 y2 BoxFill */ |
/* filled box : usage x1 y1 x2 y2 BoxFill */ |
"/BoxFill { gsave Rec 1 setgray fill grestore } def\n", |
"/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 |
NULL |
}; |
}; |
|
|
Line 497 int can_reencode; |
|
Line 500 int can_reencode; |
|
return NULL; |
return NULL; |
|
|
/* we did not find the name */ |
/* we did not find the name */ |
|
|
fnp = (struct PS_FontName *)gp_alloc(sizeof(struct PS_FontName), "PostScript Font record"); |
fnp = (struct PS_FontName *)gp_alloc(sizeof(struct PS_FontName), |
fnp->name = gp_alloc(1+strlen(fname), "PostScript Font name"); |
"PostScript Font record"); |
strcpy(fnp->name, fname); |
fnp->name = gp_strdup(fname); |
fnp->next = PS_DocFonts; |
fnp->next = PS_DocFonts; |
PS_DocFonts = fnp; |
PS_DocFonts = fnp; |
|
|
Line 648 static int ps_common_uses_fonts; |
|
Line 651 static int ps_common_uses_fonts; |
|
static unsigned int ps_common_xoff, ps_common_yoff; |
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) |
TERM_PUBLIC void |
int encap; /* encapsulated or not - 1 for pslatex */ |
PS_common_init(encap, portrait, uses_fonts, xoff, yoff, bb_xmin, bb_ymin, bb_xmax, bb_ymax, dict) |
int portrait; /* 1 for pslatex */ |
int encap; /* encapsulated or not - 1 for pslatex */ |
int uses_fonts; /* 0 for ps(la)tex */ |
int portrait; /* 1 for pslatex */ |
unsigned int xoff, yoff; /* how much to translate by */ |
int uses_fonts; /* 0 for ps(la)tex */ |
unsigned int bb_xmin, bb_ymin, bb_xmax, bb_ymax; /* bounding box */ |
unsigned int xoff, yoff; /* how much to translate by */ |
char **dict; /* extra entries for the dictionary */ |
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\ |
static char GPFAR psi1[] = "%%%%Creator: gnuplot %s patchlevel %s\n\ |
%%%%CreationDate: %s\ |
%%%%CreationDate: %s\ |
|
|
|
|
if (outstr) fprintf(gpoutfile, "%%%%Title: %s\n", outstr ); /* JFi */ |
if (outstr) fprintf(gpoutfile, "%%%%Title: %s\n", outstr ); /* JFi */ |
time(&now); |
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) |
if (!encap) |
fprintf(gpoutfile,"%%%%Pages: (atend)\n"); |
fprintf(gpoutfile,"%%%%Pages: (atend)\n"); |
Line 931 TERM_PUBLIC void PS_graphics() |
|
Line 939 TERM_PUBLIC void PS_graphics() |
|
{ |
{ |
static char GPFAR psg1[] = "0 setgray\nnewpath\n"; |
static char GPFAR psg1[] = "0 setgray\nnewpath\n"; |
struct termentry *t = term; |
struct termentry *t = term; |
|
|
ps_page++; |
ps_page++; |
if (!ps_common_encap) |
if (!ps_common_encap) |
fprintf(gpoutfile,"%%%%Page: %d %d\n",ps_page,ps_page); |
fprintf(gpoutfile,"%%%%Page: %d %d\n",ps_page,ps_page); |
fprintf(gpoutfile,"gnudict begin\ngsave\n"); |
fprintf(gpoutfile,"gnudict begin\ngsave\n"); |
fprintf(gpoutfile,"%d %d translate\n",ps_common_xoff, ps_common_yoff); |
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, |
fprintf(gpoutfile,"%.3f %.3f scale\n", (ps_common_encap ? 0.5 : 1.0)/PS_SC, |
(ps_eps ? 0.5 : 1.0)/PS_SC); |
(ps_common_encap ? 0.5 : 1.0)/PS_SC); |
if (!ps_common_portrait) { |
if (!ps_common_portrait) { |
fprintf(gpoutfile,"90 rotate\n0 %d translate\n", (int)(-PS_YMAX)); |
fprintf(gpoutfile,"90 rotate\n0 %d translate\n", (int)(-PS_YMAX)); |
} |
} |
Line 1761 START_HELP(post) |
|
Line 1770 START_HELP(post) |
|
" Braces can be used to place multiple-character text where a single character", |
" 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", |
" 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", |
" 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", |
" is currently in effect. (The '/' character MUST be the first character after", |
" the '{'.)", |
" the '{'.)", |
"", |
"", |