The R Project SVN R

Rev

Rev 5483 | Rev 5507 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5483 Rev 5488
Line 471... Line 471...
471
    fprintf(fp, "/r   { 3 index 3 index moveto 1 index 4 -1 roll\n");
471
    fprintf(fp, "/r   { 3 index 3 index moveto 1 index 4 -1 roll\n");
472
    fprintf(fp, "	lineto exch 1 index lineto lineto closepath } def\n");
472
    fprintf(fp, "	lineto exch 1 index lineto lineto closepath } def\n");
473
    fprintf(fp, "/p1  { stroke } def\n");
473
    fprintf(fp, "/p1  { stroke } def\n");
474
    fprintf(fp, "/p2  { bg setrgbcolor fill fg setrgbcolor } def\n");
474
    fprintf(fp, "/p2  { bg setrgbcolor fill fg setrgbcolor } def\n");
475
    fprintf(fp, "/p3  { gsave bg setrgbcolor fill grestore stroke } def\n");
475
    fprintf(fp, "/p3  { gsave bg setrgbcolor fill grestore stroke } def\n");
476
#ifdef OLD
-
 
477
    fprintf(fp, "/t   { 6 -2 roll moveto gsave 3 index true\n");
-
 
478
    fprintf(fp, "	charpath flattenpath pathbbox grestore gsave\n");
-
 
479
    fprintf(fp, "	5 -1 roll rotate 6 -1 roll neg 3 -1 roll 5 -1\n");
-
 
480
    fprintf(fp, "	roll sub mul 4 -1 roll neg 3 -1 roll 4 -1 roll\n");
-
 
481
    fprintf(fp, "	sub mul rmoveto show grestore } def\n");
-
 
482
#else
-
 
483
    fprintf(fp, "/t   { 6 -2 roll moveto gsave rotate\n");
476
    fprintf(fp, "/t   { 6 -2 roll moveto gsave rotate\n");
484
    fprintf(fp, "       ps mul neg 0 2 1 roll rmoveto\n");
477
    fprintf(fp, "       ps mul neg 0 2 1 roll rmoveto\n");
485
    fprintf(fp, "       1 index stringwidth pop\n");
478
    fprintf(fp, "       1 index stringwidth pop\n");
486
    fprintf(fp, "       mul neg 0 rmoveto show grestore } def\n");
479
    fprintf(fp, "       mul neg 0 rmoveto show grestore } def\n");
487
#endif
-
 
488
#ifdef OLD
-
 
489
    fprintf(fp, "/cl  { initclip newpath 3 index 3 index moveto 1 index\n");
-
 
490
    fprintf(fp, "	4 -1 roll lineto  exch 1 index lineto lineto\n");
-
 
491
    fprintf(fp, "	closepath clip newpath } def\n");
-
 
492
#endif
-
 
493
    fprintf(fp, "/rgb { setrgbcolor } def\n");
480
    fprintf(fp, "/rgb { setrgbcolor } def\n");
494
    fprintf(fp, "/s   { scalefont setfont } def\n");
481
    fprintf(fp, "/s   { scalefont setfont } def\n");
495
    fprintf(fp, "/R   { /Font1 findfont } def\n");
482
    fprintf(fp, "/R   { /Font1 findfont } def\n");
496
    fprintf(fp, "/B   { /Font2 findfont } def\n");
483
    fprintf(fp, "/B   { /Font2 findfont } def\n");
497
    fprintf(fp, "/I   { /Font3 findfont } def\n");
484
    fprintf(fp, "/I   { /Font3 findfont } def\n");
Line 524... Line 511...
524
void PostScriptSetLineWidth(FILE *fp, double linewidth)
511
void PostScriptSetLineWidth(FILE *fp, double linewidth)
525
{
512
{
526
    fprintf(fp, "%.2f setlinewidth\n", linewidth);
513
    fprintf(fp, "%.2f setlinewidth\n", linewidth);
527
}
514
}
528
 
515
 
529
void PostScriptSetClipRect(FILE *fp,
-
 
530
			   double x0, double x1, double y0, double y1)
-
 
531
{
-
 
532
    fprintf(fp, "%.2f %.2f %.2f %.2f cl\n", x0, y0, x1, y1);
-
 
533
}
-
 
534
 
-
 
535
void PostScriptSetFont(FILE *fp, int typeface, double size)
516
void PostScriptSetFont(FILE *fp, int typeface, double size)
536
{
517
{
537
    fprintf(fp, "/ps %.0f def %s %.0f s\n", size, TypeFaceDef[typeface], size);
518
    fprintf(fp, "/ps %.0f def %s %.0f s\n", size, TypeFaceDef[typeface], size);
538
}
519
}
539
 
520
 
Line 836... Line 817...
836
 
817
 
837
    dd->dp.canResizePlot = 0;
818
    dd->dp.canResizePlot = 0;
838
    dd->dp.canChangeFont = 1;
819
    dd->dp.canChangeFont = 1;
839
    dd->dp.canRotateText = 1;
820
    dd->dp.canRotateText = 1;
840
    dd->dp.canResizeText = 1;
821
    dd->dp.canResizeText = 1;
841
#ifdef OLD
-
 
842
    dd->dp.canClip = 1;
-
 
843
#else
-
 
844
    dd->dp.canClip = 0;
822
    dd->dp.canClip = 0;
845
#endif
-
 
846
 
823
 
847
    /*	Start the driver */
824
    /*	Start the driver */
848
 
825
 
849
    if(!PS_Open(dd, pd)) {
826
    if(!PS_Open(dd, pd)) {
850
	free(pd);
827
	free(pd);
Line 992... Line 969...
992
}
969
}
993
 
970
 
994
 
971
 
995
static void PS_Clip(double x0, double x1, double y0, double y1, DevDesc *dd)
972
static void PS_Clip(double x0, double x1, double y0, double y1, DevDesc *dd)
996
{
973
{
997
    PostScriptDesc *pd = (PostScriptDesc *) dd->deviceSpecific;
-
 
998
    PostScriptSetClipRect(pd->psfp, x0, x1, y0, y1);
-
 
999
}
974
}
1000
 
975
 
1001
 
976
 
1002
static void PS_Resize(DevDesc *dd)
977
static void PS_Resize(DevDesc *dd)
1003
{
978
{