From 72d22e8a1a1b47635e1b8da49ae703bde01228f2 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 27 Jan 2007 20:47:41 +0000 Subject: Add support for PFB files. This seems to have caused me to completely rewrite the Type 1 font support, and I'm sure the result is more complex than it needs to be, but it seems to work correctly, so I shouldn't complain. [originally from svn r7175] --- bk_pdf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bk_pdf.c') diff --git a/bk_pdf.c b/bk_pdf.c index 3a0ec75..99eb933 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -236,7 +236,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(fontdesc, buf); sprintf(buf, "/StemV %g\n", fi->stemv); objtext(fontdesc, buf); - if (fi->fp) { + if (fi->fontfile) { object *fontfile = new_object(&olist); size_t len; char *ffbuf; @@ -487,13 +487,20 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, rdaddsc(&rs, text); if (o->stream.text) { + if (!o->main.text) + rdaddsc(&o->main, "<<\n"); +#ifdef PDF_NOCOMPRESS + zlen = o->stream.pos; + zbuf = snewn(zlen, char); + memcpy(zbuf, o->stream.text, zlen); + sprintf(text, "/Length %d\n>>\n", zlen); +#else zcontext = deflate_compress_new(DEFLATE_TYPE_ZLIB); deflate_compress_data(zcontext, o->stream.text, o->stream.pos, DEFLATE_END_OF_DATA, &zbuf, &zlen); deflate_compress_free(zcontext); - if (!o->main.text) - rdaddsc(&o->main, "<<\n"); sprintf(text, "/Filter/FlateDecode\n/Length %d\n>>\n", zlen); +#endif rdaddsc(&o->main, text); } -- cgit v1.1