summaryrefslogtreecommitdiff
path: root/bk_pdf.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2006-05-14 18:32:08 +0000
committerBen Harris <bjh21@bjh21.me.uk>2006-05-14 18:32:08 +0000
commit3dd6b022f7874eb5576b6938a4406703908ebb88 (patch)
treecf53f56ad84c7961d35ef794836ca6e2f8f55b4d /bk_pdf.c
parent2b31f230ff6fdeecad4ea63347100dd067a3b029 (diff)
downloadhalibut-3dd6b022f7874eb5576b6938a4406703908ebb88.zip
halibut-3dd6b022f7874eb5576b6938a4406703908ebb88.tar.gz
halibut-3dd6b022f7874eb5576b6938a4406703908ebb88.tar.bz2
halibut-3dd6b022f7874eb5576b6938a4406703908ebb88.tar.xz
Generate rather more compact /Differences tables for font encodings, mostly
so I don't have to press SPACE so much to get to the interesting part of the file. [originally from svn r6687]
Diffstat (limited to 'bk_pdf.c')
-rw-r--r--bk_pdf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bk_pdf.c b/bk_pdf.c
index 0a36ad9..2697b16 100644
--- a/bk_pdf.c
+++ b/bk_pdf.c
@@ -133,7 +133,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords,
objtext(resources, "<<\n/Font <<\n");
for (fe = doc->fonts->head; fe; fe = fe->next) {
char fname[40];
- int i;
+ int i, prev;
object *font;
sprintf(fname, "f%d", font_index++);
@@ -157,9 +157,13 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords,
char buf[20];
if (!fe->vector[i])
continue;
- sprintf(buf, "\n%d /", i);
- objtext(font, buf);
- objtext(font, fe->vector[i] ? fe->vector[i] : ".notdef");
+ if (i != prev + 1) {
+ sprintf(buf, "\n%d", i);
+ objtext(font, buf);
+ }
+ objtext(font, i % 8 ? "/" : "\n/");
+ objtext(font, fe->vector[i]);
+ prev = i;
}
objtext(font, "\n]\n>>\n");