summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-07-18 15:56:00 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-07-18 15:56:00 +0200
commitfe187681d8f59dea89a09dd9ee48f757a3ded3bb (patch)
treee4189dc84f0cbb49611e5dd21091907874b8388a /source/pdf
parent146ad732d5cf8f35876d1600115cbcb210fb7d99 (diff)
downloadmupdf-fe187681d8f59dea89a09dd9ee48f757a3ded3bb.tar.xz
allow to extract text for uncacheable glyphs
Certain glyphs such as found in nested Type 3 font can't be cached. Currently, the text extraction device doesn't see these as they're sent only as drawing operations. Sending them also as invisible text fixes potentially missing letters.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-op-run.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
index da881b2e..22e6a4be 100644
--- a/source/pdf/pdf-op-run.c
+++ b/source/pdf/pdf-op-run.c
@@ -1142,18 +1142,18 @@ pdf_show_char(pdf_csi *csi, pdf_run_state *pr, int cid)
fz_matrix composed;
fz_concat(&composed, &trm, &gstate->ctm);
fz_render_t3_glyph_direct(ctx, pr->dev, fontdesc->font, gid, &composed, gstate, pr->nested_depth);
+ /* Render text invisibly so that it can still be extracted. */
+ pr->text_mode = 3;
}
- else
- {
- fz_union_rect(&pr->text_bbox, &bbox);
- /* add glyph to textobject */
- fz_add_text(ctx, pr->text, gid, ucsbuf[0], trm.e, trm.f);
+ fz_union_rect(&pr->text_bbox, &bbox);
- /* add filler glyphs for one-to-many unicode mapping */
- for (i = 1; i < ucslen; i++)
- fz_add_text(ctx, pr->text, -1, ucsbuf[i], trm.e, trm.f);
- }
+ /* add glyph to textobject */
+ fz_add_text(ctx, pr->text, gid, ucsbuf[0], trm.e, trm.f);
+
+ /* add filler glyphs for one-to-many unicode mapping */
+ for (i = 1; i < ucslen; i++)
+ fz_add_text(ctx, pr->text, -1, ucsbuf[i], trm.e, trm.f);
if (fontdesc->wmode == 0)
{