diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-03-15 12:44:36 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-03-16 14:51:41 +0100 |
commit | 4b66d5773bf513e72a82b10b0f80a529aaa12313 (patch) | |
tree | 8bdd71bb0ba499c8b0dd9ace6fc87b0bfd1798aa /source/fitz | |
parent | 1cd2046b3cce264a3d13481652868fd1c31537fc (diff) | |
download | mupdf-4b66d5773bf513e72a82b10b0f80a529aaa12313.tar.xz |
Simplify PDF font creation code.
Don't create a useless pdf_font_desc when writing font resources.
Simplify reference counting by using fewer intermediate variables.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/font.c | 4 | ||||
-rw-r--r-- | source/fitz/noto.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index 5ff25e1a..e822703f 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -647,11 +647,11 @@ fz_new_base14_font(fz_context *ctx, const char *name) } fz_font * -fz_new_cjk_font(fz_context *ctx, int registry, int serif, int wmode) +fz_new_cjk_font(fz_context *ctx, int ordering, int serif, int wmode) { const unsigned char *data; int size, index; - data = fz_lookup_cjk_font(ctx, registry, serif, wmode, &size, &index); + data = fz_lookup_cjk_font(ctx, ordering, serif, wmode, &size, &index); if (!data) fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin CJK font"); return fz_new_font_from_memory(ctx, NULL, data, size, index, 0); diff --git a/source/fitz/noto.c b/source/fitz/noto.c index f6951ba2..d16e800e 100644 --- a/source/fitz/noto.c +++ b/source/fitz/noto.c @@ -138,13 +138,13 @@ fz_lookup_builtin_font(fz_context *ctx, const char *name, int is_bold, int is_it } const unsigned char * -fz_lookup_cjk_font(fz_context *ctx, int registry, int serif, int wmode, int *size, int *index) +fz_lookup_cjk_font(fz_context *ctx, int ordering, int serif, int wmode, int *size, int *index) { if (index) *index = 0; #ifndef TOFU_CJK #ifndef TOFU_CJK_EXT #ifndef TOFU_CJK_LANG - switch (registry) { + switch (ordering) { case FZ_ADOBE_JAPAN_1: RETURN(han_SourceHanSansJP_Regular_otf); case FZ_ADOBE_KOREA_1: RETURN(han_SourceHanSansKR_Regular_otf); default: |