version 1.51, 2011/05/17 14:38:34 |
version 1.53, 2011/09/18 14:14:15 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 429 static struct termp * |
|
Line 429 static struct termp * |
|
pspdf_alloc(char *outopts) |
pspdf_alloc(char *outopts) |
{ |
{ |
struct termp *p; |
struct termp *p; |
size_t pagex, pagey, marginx, marginy, lineheight; |
unsigned int pagex, pagey; |
|
size_t marginx, marginy, lineheight; |
const char *toks[2]; |
const char *toks[2]; |
const char *pp; |
const char *pp; |
char *v; |
char *v; |
Line 485 pspdf_alloc(char *outopts) |
|
Line 486 pspdf_alloc(char *outopts) |
|
} else if (0 == strcasecmp(pp, "legal")) { |
} else if (0 == strcasecmp(pp, "legal")) { |
pagex = 216; |
pagex = 216; |
pagey = 356; |
pagey = 356; |
} else if (2 != sscanf(pp, "%zux%zu", &pagex, &pagey)) |
} else if (2 != sscanf(pp, "%ux%u", &pagex, &pagey)) |
fprintf(stderr, "%s: Unknown paper\n", pp); |
fprintf(stderr, "%s: Unknown paper\n", pp); |
} else if (NULL == pp) |
} else if (NULL == pp) |
pp = "letter"; |
pp = "letter"; |
Line 513 pspdf_alloc(char *outopts) |
|
Line 514 pspdf_alloc(char *outopts) |
|
|
|
lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4)); |
lineheight = PNT2AFM(p, ((double)p->ps->scale * 1.4)); |
|
|
p->ps->width = pagex; |
p->ps->width = (size_t)pagex; |
p->ps->height = pagey; |
p->ps->height = (size_t)pagey; |
p->ps->header = pagey - (marginy / 2) - (lineheight / 2); |
p->ps->header = pagey - (marginy / 2) - (lineheight / 2); |
p->ps->top = pagey - marginy; |
p->ps->top = pagey - marginy; |
p->ps->footer = (marginy / 2) - (lineheight / 2); |
p->ps->footer = (marginy / 2) - (lineheight / 2); |