From: <and...@us...> - 2008-12-04 10:46:24
|
Revision: 9034 http://plplot.svn.sourceforge.net/plplot/?rev=9034&view=rev Author: andrewross Date: 2008-12-04 10:46:20 +0000 (Thu, 04 Dec 2008) Log Message: ----------- Patch from Davide Cesari to allow the physical page size to be set for the ps / psttf drivers using plspage. Modified Paths: -------------- trunk/drivers/ps.c trunk/drivers/psttf.cc trunk/include/ps.h Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2008-12-03 15:48:46 UTC (rev 9033) +++ trunk/drivers/ps.c 2008-12-04 10:46:20 UTC (rev 9034) @@ -156,6 +156,14 @@ { PSDev *dev; + /* Set default values - 7.5 x 10 [inches] (72 points = 1 inch) */ + if (pls->xlength <= 0 || pls->ylength <=0) { + pls->xlength = 540; + pls->ylength = 720; + } + if (pls->xdpi <= 0) pls->xdpi = 72.; + if (pls->ydpi <= 0) pls->ydpi = 72.; + PLFLT pxlx = YPSSIZE/LPAGE_X; PLFLT pxly = XPSSIZE/LPAGE_Y; Modified: trunk/drivers/psttf.cc =================================================================== --- trunk/drivers/psttf.cc 2008-12-03 15:48:46 UTC (rev 9033) +++ trunk/drivers/psttf.cc 2008-12-04 10:46:20 UTC (rev 9034) @@ -195,6 +195,15 @@ PSDev *dev; PostscriptDocument *doc; + /* Set default values - 7.5 x 10 [inches] (72 points = 1 inch) */ + if (pls->xlength <= 0 || pls->ylength <=0) { + pls->xlength = 540; + pls->ylength = 720; + } + if (pls->xdpi <= 0) pls->xdpi = 72.; + if (pls->ydpi <= 0) pls->ydpi = 72.; + + PLFLT pxlx = YPSSIZE/LPAGE_X; PLFLT pxly = XPSSIZE/LPAGE_Y; Modified: trunk/include/ps.h =================================================================== --- trunk/include/ps.h 2008-12-03 15:48:46 UTC (rev 9033) +++ trunk/include/ps.h 2008-12-04 10:46:20 UTC (rev 9034) @@ -10,8 +10,8 @@ #define LINELENGTH 78 #define COPIES 1 -#define XSIZE 540 /* 7.5 x 10 [inches] */ -#define YSIZE 720 /* (72 points = 1 inch) */ +#define XSIZE (int) (pls->xlength*(pls->xdpi/72.)) +#define YSIZE (int) (pls->ylength*(pls->ydpi/72.)) #define ENLARGE 5 #define XPSSIZE ENLARGE*XSIZE #define YPSSIZE ENLARGE*YSIZE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |