summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-10-18 13:26:10 +0000
committerTor Andersson <tor@ghostscript.com>2010-10-18 13:26:10 +0000
commit682d4d70a9f8e41cf10b768f1ac86f16d4b14322 (patch)
treed1d892c10026bcf29ed17581614f81662ef53f09
parent5426bcca836e1356645a1e9bb6c9e8766a6bd98e (diff)
downloadmupdf-682d4d70a9f8e41cf10b768f1ac86f16d4b14322.tar.xz
Don't show characters that cannot be encoded by the cmap (this is different from .notdef glyphs).
-rw-r--r--mupdf/pdf_build.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c
index 589f638b..43bb7c00 100644
--- a/mupdf/pdf_build.c
+++ b/mupdf/pdf_build.c
@@ -630,11 +630,10 @@ pdf_showtext(pdf_csi *csi, fz_obj *text)
{
buf = pdf_decodecmap(fontdesc->encoding, buf, &cpt);
cid = pdf_lookupcmap(fontdesc->encoding, cpt);
- if (cid == -1)
- cid = 0;
-
- pdf_showglyph(csi, cid);
-
+ if (cid >= 0)
+ pdf_showglyph(csi, cid);
+ else
+ fz_warn("cannot encode character with code point %#x", cpt);
if (cpt == 32)
pdf_showspace(csi, gstate->wordspace);
}