version 1.56, 2014/03/23 11:25:26 |
version 1.58, 2014/03/30 21:28:01 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
|
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* 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 75 struct termp_ps { |
|
Line 76 struct termp_ps { |
|
size_t bottom; /* body bottom (AFM units) */ |
size_t bottom; /* body bottom (AFM units) */ |
size_t height; /* page height (AFM units */ |
size_t height; /* page height (AFM units */ |
size_t width; /* page width (AFM units) */ |
size_t width; /* page width (AFM units) */ |
|
size_t lastwidth; /* page width before last ll */ |
size_t left; /* body left (AFM units) */ |
size_t left; /* body left (AFM units) */ |
size_t header; /* header pos (AFM units) */ |
size_t header; /* header pos (AFM units) */ |
size_t footer; /* footer pos (AFM units) */ |
size_t footer; /* footer pos (AFM units) */ |
Line 104 __attribute__((__format__ (__printf__, 2, 3))) |
|
Line 106 __attribute__((__format__ (__printf__, 2, 3))) |
|
static void ps_printf(struct termp *, const char *, ...); |
static void ps_printf(struct termp *, const char *, ...); |
static void ps_putchar(struct termp *, char); |
static void ps_putchar(struct termp *, char); |
static void ps_setfont(struct termp *, enum termfont); |
static void ps_setfont(struct termp *, enum termfont); |
|
static void ps_setwidth(struct termp *, int, size_t); |
static struct termp *pspdf_alloc(char *); |
static struct termp *pspdf_alloc(char *); |
static void pdf_obj(struct termp *, size_t); |
static void pdf_obj(struct termp *, size_t); |
|
|
Line 449 pspdf_alloc(char *outopts) |
|
Line 452 pspdf_alloc(char *outopts) |
|
p->endline = ps_endline; |
p->endline = ps_endline; |
p->hspan = ps_hspan; |
p->hspan = ps_hspan; |
p->letter = ps_letter; |
p->letter = ps_letter; |
|
p->setwidth = ps_setwidth; |
p->width = ps_width; |
p->width = ps_width; |
|
|
toks[0] = "paper"; |
toks[0] = "paper"; |
Line 517 pspdf_alloc(char *outopts) |
|
Line 521 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 = (size_t)pagex; |
p->ps->width = p->ps->lastwidth = (size_t)pagex; |
p->ps->height = (size_t)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; |
Line 528 pspdf_alloc(char *outopts) |
|
Line 532 pspdf_alloc(char *outopts) |
|
|
|
p->defrmargin = pagex - (marginx * 2); |
p->defrmargin = pagex - (marginx * 2); |
return(p); |
return(p); |
|
} |
|
|
|
|
|
static void |
|
ps_setwidth(struct termp *p, int iop, size_t width) |
|
{ |
|
size_t lastwidth; |
|
|
|
lastwidth = p->ps->width; |
|
if (0 < iop) |
|
p->ps->width += width; |
|
else if (0 > iop) |
|
p->ps->width -= width; |
|
else |
|
p->ps->width = width ? width : p->ps->lastwidth; |
|
p->ps->lastwidth = lastwidth; |
} |
} |
|
|
|
|