diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-05-13 14:41:48 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-05-13 14:44:18 +0200 |
commit | 9f510df7318ff4fc12ed4d35bd0454d5a8ddbd88 (patch) | |
tree | c1f49157265351245610e28b561a48cace8f46c3 /source/pdf/pdf-cmap-load.c | |
parent | 4a1d6f9886c141e165c281f127c0cb387c6407d6 (diff) | |
download | mupdf-9f510df7318ff4fc12ed4d35bd0454d5a8ddbd88.tar.xz |
Use code space ranges when remapping ToUnicode CMaps.
Diffstat (limited to 'source/pdf/pdf-cmap-load.c')
-rw-r--r-- | source/pdf/pdf-cmap-load.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/pdf/pdf-cmap-load.c b/source/pdf/pdf-cmap-load.c index d3f17c35..ec27eddd 100644 --- a/source/pdf/pdf-cmap-load.c +++ b/source/pdf/pdf-cmap-load.c @@ -105,9 +105,10 @@ pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes) pdf_cmap *cmap = pdf_new_cmap(ctx); fz_try(ctx) { + unsigned int high = (1 << (bytes * 8)) - 1; sprintf(cmap->cmap_name, "Identity-%c", wmode ? 'V' : 'H'); - pdf_add_codespace(ctx, cmap, 0x0000, 0xffff, bytes); - pdf_map_range_to_range(ctx, cmap, 0x0000, 0xffff, 0); + pdf_add_codespace(ctx, cmap, 0, high, bytes); + pdf_map_range_to_range(ctx, cmap, 0, high, 0); pdf_sort_cmap(ctx, cmap); pdf_set_cmap_wmode(ctx, cmap, wmode); } |