diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-31 17:58:34 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-01-31 18:01:37 +0000 |
commit | 3e65ed4eb3a8aa8cd6375a7029ac3b61a35a1157 (patch) | |
tree | 414965143f8ec0ca505e046847e2ea647e3e6149 /pdf/pdf_interpret.c | |
parent | 0da4f606b85007f6c1bdfc9255ccef8307dabb11 (diff) | |
download | mupdf-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.c | 5 |
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); } } |