version 1.83, 2017/02/17 14:31:52 |
version 1.86, 2017/10/25 18:52:06 |
|
|
/* $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 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2014, 2015, 2016, 2017 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 538 pspdf_alloc(const struct manoutput *outopts) |
|
Line 538 pspdf_alloc(const struct manoutput *outopts) |
|
size_t marginx, marginy, lineheight; |
size_t marginx, marginy, lineheight; |
const char *pp; |
const char *pp; |
|
|
p = mandoc_calloc(1, sizeof(struct termp)); |
p = mandoc_calloc(1, sizeof(*p)); |
|
p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); |
|
p->maxtcol = 1; |
|
|
p->enc = TERMENC_ASCII; |
p->enc = TERMENC_ASCII; |
p->fontq = mandoc_reallocarray(NULL, |
p->fontq = mandoc_reallocarray(NULL, |
(p->fontsz = 8), sizeof(enum termfont)); |
(p->fontsz = 8), sizeof(*p->fontq)); |
p->fontq[0] = p->fontl = TERMFONT_NONE; |
p->fontq[0] = p->fontl = TERMFONT_NONE; |
p->ps = mandoc_calloc(1, sizeof(struct termp_ps)); |
p->ps = mandoc_calloc(1, sizeof(*p->ps)); |
|
|
p->advance = ps_advance; |
p->advance = ps_advance; |
p->begin = ps_begin; |
p->begin = ps_begin; |
Line 756 ps_closepage(struct termp *p) |
|
Line 759 ps_closepage(struct termp *p) |
|
ps_printf(p, "/Font <<\n"); |
ps_printf(p, "/Font <<\n"); |
for (i = 0; i < (int)TERMFONT__MAX; i++) |
for (i = 0; i < (int)TERMFONT__MAX; i++) |
ps_printf(p, "/F%d %d 0 R\n", i, 3 + i); |
ps_printf(p, "/F%d %d 0 R\n", i, 3 + i); |
ps_printf(p, ">>\n>>\n"); |
ps_printf(p, ">>\n>>\nendobj\n"); |
|
|
/* Page node. */ |
/* Page node. */ |
pdf_obj(p, base + 3); |
pdf_obj(p, base + 3); |
Line 821 ps_end(struct termp *p) |
|
Line 824 ps_end(struct termp *p) |
|
ps_printf(p, "<<\n"); |
ps_printf(p, "<<\n"); |
ps_printf(p, "/Type /Catalog\n"); |
ps_printf(p, "/Type /Catalog\n"); |
ps_printf(p, "/Pages 2 0 R\n"); |
ps_printf(p, "/Pages 2 0 R\n"); |
ps_printf(p, ">>\n"); |
ps_printf(p, ">>\nendobj\n"); |
xref = p->ps->pdfbytes; |
xref = p->ps->pdfbytes; |
ps_printf(p, "xref\n"); |
ps_printf(p, "xref\n"); |
ps_printf(p, "0 %zu\n", base + 1); |
ps_printf(p, "0 %zu\n", base + 1); |
Line 915 ps_begin(struct termp *p) |
|
Line 918 ps_begin(struct termp *p) |
|
ps_printf(p, "/Subtype /Type1\n"); |
ps_printf(p, "/Subtype /Type1\n"); |
ps_printf(p, "/Name /F%d\n", i); |
ps_printf(p, "/Name /F%d\n", i); |
ps_printf(p, "/BaseFont /%s\n", fonts[i].name); |
ps_printf(p, "/BaseFont /%s\n", fonts[i].name); |
ps_printf(p, ">>\n"); |
ps_printf(p, ">>\nendobj\n"); |
} |
} |
} |
} |
|
|
Line 1219 ps_endline(struct termp *p) |
|
Line 1222 ps_endline(struct termp *p) |
|
} |
} |
|
|
ps_closepage(p); |
ps_closepage(p); |
|
|
|
p->tcol->offset -= p->ti; |
|
p->ti = 0; |
} |
} |
|
|
static void |
static void |