1 #ifndef MUPDF_PDF_CMAP_H
2 #define MUPDF_PDF_CMAP_H
8 typedef struct pdf_cmap_s pdf_cmap;
9 typedef struct pdf_range_s pdf_range;
10 typedef struct pdf_xrange_s pdf_xrange;
11 typedef struct pdf_mrange_s pdf_mrange;
13 #define PDF_MRANGE_CAP 8
17 unsigned short low, high, out;
22 unsigned int low, high, out;
27 unsigned int low, len, out[PDF_MRANGE_CAP];
35 char usecmap_name[32];
58 pdf_cmap *pdf_new_cmap(fz_context *ctx);
59 pdf_cmap *pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap);
60 void pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap);
61 void pdf_free_cmap_imp(fz_context *ctx, fz_storable *cmap);
62 unsigned int pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap);
64 int pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap);
65 void pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode);
66 void pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap);
68 void pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n);
69 void pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *map, int len);
70 void pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo);
71 void pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int one, int *many, int len);
72 void pdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap);
74 int pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt);
75 int pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out);
76 int pdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt);
78 pdf_cmap *pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes);
79 pdf_cmap *pdf_load_cmap(fz_context *ctx, fz_stream *file);
80 pdf_cmap *pdf_load_system_cmap(fz_context *ctx, char *name);
81 pdf_cmap *pdf_load_builtin_cmap(fz_context *ctx, char *name);
82 pdf_cmap *pdf_load_embedded_cmap(pdf_document *doc, pdf_obj *ref);
85 void pdf_print_cmap(fz_context *ctx, pdf_cmap *cmap);