version 1.90, 2017/11/02 14:53:02 |
version 1.92, 2020/09/06 14:45:22 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2014,2015,2016,2017,2020 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2017 Marc Espie <espie@openbsd.org> |
* Copyright (c) 2017 Marc Espie <espie@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
Line 111 static void ps_printf(struct termp *, const char *, |
|
Line 111 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, int); |
static void ps_setwidth(struct termp *, int, int); |
static struct termp *pspdf_alloc(const struct manoutput *); |
static struct termp *pspdf_alloc(const struct manoutput *, enum termtype); |
static void pdf_obj(struct termp *, size_t); |
static void pdf_obj(struct termp *, size_t); |
|
|
/* |
/* |
Line 514 static const struct font fonts[TERMFONT__MAX] = { |
|
Line 514 static const struct font fonts[TERMFONT__MAX] = { |
|
void * |
void * |
pdf_alloc(const struct manoutput *outopts) |
pdf_alloc(const struct manoutput *outopts) |
{ |
{ |
struct termp *p; |
return pspdf_alloc(outopts, TERMTYPE_PDF); |
|
|
if (NULL != (p = pspdf_alloc(outopts))) |
|
p->type = TERMTYPE_PDF; |
|
|
|
return p; |
|
} |
} |
|
|
void * |
void * |
ps_alloc(const struct manoutput *outopts) |
ps_alloc(const struct manoutput *outopts) |
{ |
{ |
struct termp *p; |
return pspdf_alloc(outopts, TERMTYPE_PS); |
|
|
if (NULL != (p = pspdf_alloc(outopts))) |
|
p->type = TERMTYPE_PS; |
|
|
|
return p; |
|
} |
} |
|
|
static struct termp * |
static struct termp * |
pspdf_alloc(const struct manoutput *outopts) |
pspdf_alloc(const struct manoutput *outopts, enum termtype type) |
{ |
{ |
struct termp *p; |
struct termp *p; |
unsigned int pagex, pagey; |
unsigned int pagex, pagey; |
Line 544 pspdf_alloc(const struct manoutput *outopts) |
|
Line 534 pspdf_alloc(const struct manoutput *outopts) |
|
p = mandoc_calloc(1, sizeof(*p)); |
p = mandoc_calloc(1, sizeof(*p)); |
p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); |
p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); |
p->maxtcol = 1; |
p->maxtcol = 1; |
|
p->type = type; |
|
|
p->enc = TERMENC_ASCII; |
p->enc = TERMENC_ASCII; |
p->fontq = mandoc_reallocarray(NULL, |
p->fontq = mandoc_reallocarray(NULL, |
Line 1261 ps_endline(struct termp *p) |
|
Line 1252 ps_endline(struct termp *p) |
|
|
|
ps_closepage(p); |
ps_closepage(p); |
|
|
p->tcol->offset -= p->ti; |
if ((int)p->tcol->offset > p->ti) |
|
p->tcol->offset -= p->ti; |
|
else |
|
p->tcol->offset = 0; |
p->ti = 0; |
p->ti = 0; |
} |
} |
|
|