diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-06 15:43:43 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-06 15:43:43 +0200 |
commit | d1ca1560865a196d1caa10a27110880b58905db3 (patch) | |
tree | 43ef49c5dbe0c544aae7fc44a9470794c43e825c /pdf/pdf_cmap_load.c | |
parent | e516feff18c3223a597ba23cbefba01b042c70bd (diff) | |
download | mupdf-d1ca1560865a196d1caa10a27110880b58905db3.tar.xz |
pdf: Change how CMap and font data files are generated and compiled.
Diffstat (limited to 'pdf/pdf_cmap_load.c')
-rw-r--r-- | pdf/pdf_cmap_load.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/pdf/pdf_cmap_load.c b/pdf/pdf_cmap_load.c index f6ea4bf8..d671b234 100644 --- a/pdf/pdf_cmap_load.c +++ b/pdf/pdf_cmap_load.c @@ -107,29 +107,23 @@ pdf_new_identity_cmap(int wmode, int bytes) fz_error pdf_load_system_cmap(pdf_cmap **cmapp, char *cmap_name) { - fz_error error; pdf_cmap *usecmap; pdf_cmap *cmap; - int i; pdf_log_font("loading system cmap %s\n", cmap_name); - for (i = 0; pdf_cmap_table[i]; i++) + cmap = pdf_find_builtin_cmap(cmap_name); + if (!cmap) + return fz_throw("no builtin cmap file: %s", cmap_name); + + if (cmap->usecmap_name[0] && !cmap->usecmap) { - if (!strcmp(cmap_name, pdf_cmap_table[i]->cmap_name)) - { - cmap = pdf_cmap_table[i]; - if (cmap->usecmap_name[0] && !cmap->usecmap) - { - error = pdf_load_system_cmap(&usecmap, cmap->usecmap_name); - if (error) - return fz_rethrow(error, "cannot load usecmap: %s", cmap->usecmap_name); - pdf_set_usecmap(cmap, usecmap); - } - *cmapp = cmap; - return fz_okay; - } + usecmap = pdf_find_builtin_cmap(cmap->usecmap_name); + if (!usecmap) + return fz_throw("nu builtin cmap file: %s", cmap->usecmap_name); + pdf_set_usecmap(cmap, usecmap); } - return fz_throw("no builtin cmap file: %s", cmap_name); + *cmapp = cmap; + return fz_okay; } |