summaryrefslogtreecommitdiff
path: root/pdf/pdf_interpret.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-31 17:58:34 +0000
committerRobin Watts <robin.watts@artifex.com>2012-01-31 18:01:37 +0000
commit3e65ed4eb3a8aa8cd6375a7029ac3b61a35a1157 (patch)
tree414965143f8ec0ca505e046847e2ea647e3e6149 /pdf/pdf_interpret.c
parent0da4f606b85007f6c1bdfc9255ccef8307dabb11 (diff)
downloadmupdf-3e65ed4eb3a8aa8cd6375a7029ac3b61a35a1157.tar.xz
Fix big 692824: incorrect application of word space.
Word space should only be applied when the codepoint is 32, and is read from a single byte encoding region. Ghostscript gets this wrong too.
Diffstat (limited to 'pdf/pdf_interpret.c')
-rw-r--r--pdf/pdf_interpret.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c
index 3b774d71..63f208a1 100644
--- a/pdf/pdf_interpret.c
+++ b/pdf/pdf_interpret.c
@@ -816,13 +816,14 @@ pdf_show_string(pdf_csi *csi, unsigned char *buf, int len)
while (buf < end)
{
- buf = pdf_decode_cmap(fontdesc->encoding, buf, &cpt);
+ int w;
+ buf = pdf_decode_cmap(fontdesc->encoding, buf, &cpt, &w);
cid = pdf_lookup_cmap(fontdesc->encoding, cpt);
if (cid >= 0)
pdf_show_char(csi, cid);
else
fz_warn(ctx, "cannot encode character with code point %#x", cpt);
- if (cpt == 32)
+ if (cpt == 32 && w == 1)
pdf_show_space(csi, gstate->word_space);
}
}