summaryrefslogtreecommitdiff
path: root/bk_pdf.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2007-02-10 12:33:56 +0000
committerBen Harris <bjh21@bjh21.me.uk>2007-02-10 12:33:56 +0000
commit7d287800e5a5bcdf0d4d38679ff7980ce8c18250 (patch)
treed9171fa7beb13a40f36ffb192cd7d5bdde55cf92 /bk_pdf.c
parenta0a77360d18d8207cbd67bb00297553fe90bc43a (diff)
downloadhalibut-7d287800e5a5bcdf0d4d38679ff7980ce8c18250.zip
halibut-7d287800e5a5bcdf0d4d38679ff7980ce8c18250.tar.gz
halibut-7d287800e5a5bcdf0d4d38679ff7980ce8c18250.tar.bz2
halibut-7d287800e5a5bcdf0d4d38679ff7980ce8c18250.tar.xz
Generate a "W" array for CIDFonts, since acroread seems to do very silly
things without one. [originally from svn r7261]
Diffstat (limited to 'bk_pdf.c')
-rw-r--r--bk_pdf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/bk_pdf.c b/bk_pdf.c
index d75244d..a880872 100644
--- a/bk_pdf.c
+++ b/bk_pdf.c
@@ -209,7 +209,16 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords,
"/Ordering(Identity)/Supplement 0>>\n");
objtext(cidfont, "/FontDescriptor ");
objref(cidfont, fontdesc);
- objtext(cidfont, ">>\n");
+ objtext(cidfont, "\n/W[0[");
+ for (i = 0; i < sfnt_nglyphs(fe->font->info->fontfile); i++) {
+ char buf[20];
+ double width;
+ width = find_width(fe->font,
+ sfnt_indextoglyph(fe->font->info->fontfile, i));
+ sprintf(buf, "%g ", 1000.0 * width / FUNITS_PER_PT);
+ objtext(cidfont, buf);
+ }
+ objtext(cidfont, "]]>>\n");
} else {
objtext(font, "/Subtype /Type1\n");
objtext(font, "\n/Encoding <<\n/Type /Encoding\n/Differences [");