From 670fe1b085fde8355b6d1a70b143eab60e34b1b6 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 13 Apr 2017 19:13:59 +0100 Subject: Use splay trees for loading/merging cmaps. This allows for overlaps, merges adjacent (mergeable) ranges and gets us properly searchable results. This causes 1 diff in the test suites (Bug694353.pdf), which is due to the fallback font not having a hypen present at UCS 0x2010. --- include/mupdf/pdf/cmap.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mupdf/pdf/cmap.h b/include/mupdf/pdf/cmap.h index 9edeb9d8..d98cd0ab 100644 --- a/include/mupdf/pdf/cmap.h +++ b/include/mupdf/pdf/cmap.h @@ -24,9 +24,11 @@ struct pdf_xrange_s struct pdf_mrange_s { - unsigned int low, len, out[PDF_MRANGE_CAP]; + unsigned int low, out; }; +typedef struct cmap_splay_s cmap_splay; + struct pdf_cmap_s { fz_storable storable; @@ -53,6 +55,13 @@ struct pdf_cmap_s int mlen, mcap; pdf_mrange *mranges; + + int dlen, dcap; + int *dict; + + int tlen, tcap, ttop; + cmap_splay *tree; + }; pdf_cmap *pdf_new_cmap(fz_context *ctx); @@ -80,6 +89,4 @@ pdf_cmap *pdf_load_system_cmap(fz_context *ctx, const char *name); pdf_cmap *pdf_load_builtin_cmap(fz_context *ctx, const char *name); pdf_cmap *pdf_load_embedded_cmap(fz_context *ctx, pdf_document *doc, pdf_obj *ref); -void pdf_print_cmap(fz_context *ctx, fz_output *out, pdf_cmap *cmap); - #endif -- cgit v1.2.3