aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/page/gs.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-03-20 02:25:59 +0000
committerrsc <devnull@localhost>2006-03-20 02:25:59 +0000
commit17157e4aa85baea6c1503e2c95d98ed66a1596f1 (patch)
tree0d5170a9f88cb8f25e2d824d0b96f57b968d426a /src/cmd/page/gs.c
parent7bd7fd2f4f6fb39400f6f64feb7ec9cba89cf3a3 (diff)
downloadplan9port-17157e4aa85baea6c1503e2c95d98ed66a1596f1.tar.gz
plan9port-17157e4aa85baea6c1503e2c95d98ed66a1596f1.tar.bz2
plan9port-17157e4aa85baea6c1503e2c95d98ed66a1596f1.zip
update lucida
Diffstat (limited to 'src/cmd/page/gs.c')
-rw-r--r--src/cmd/page/gs.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/cmd/page/gs.c b/src/cmd/page/gs.c
index 524701e3..2093af56 100644
--- a/src/cmd/page/gs.c
+++ b/src/cmd/page/gs.c
@@ -7,6 +7,7 @@
#include <u.h>
#include <libc.h>
#include <draw.h>
+#include <cursor.h>
#include <event.h>
#include <bio.h>
#include "page.h"
@@ -134,7 +135,7 @@ spawnmonitor(int fd)
}
int
-spawngs(GSInfo *g)
+spawngs(GSInfo *g, char *safer)
{
char *args[16];
char tb[32], gb[32];
@@ -158,7 +159,7 @@ spawngs(GSInfo *g)
nargs = 0;
args[nargs++] = "gs";
args[nargs++] = "-dNOPAUSE";
- args[nargs++] = "-dSAFER";
+ args[nargs++] = safer;
args[nargs++] = "-sDEVICE=plan9";
args[nargs++] = "-sOutputFile=/fd/3";
args[nargs++] = "-dQUIET";
@@ -268,14 +269,11 @@ setdim(GSInfo *gs, Rectangle bbox, int ppi, int landscape)
if(!Dx(bbox))
bbox = Rect(0, 0, 612, 792); /* 8½×11 */
- switch(landscape){
- case 0:
- pbox = bbox;
- break;
- case 1:
+ if(landscape)
pbox = Rect(bbox.min.y, bbox.min.x, bbox.max.y, bbox.max.x);
- break;
- }
+ else
+ pbox = bbox;
+
gscmd(gs, "/PageSize [%d %d]\n", Dx(pbox), Dy(pbox));
gscmd(gs, "/Margins [%d %d]\n", -pbox.min.x, -pbox.min.y);
gscmd(gs, "currentdevice putdeviceprops pop\n");