diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-11-26 02:14:34 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-12-03 12:25:52 +0100 |
commit | 673f6e7149c3c5b0e2a1fe334c3b04124fc807c6 (patch) | |
tree | 0009993139bd79dcaf3a3ed867b759069ef6433e /source/html/font.c | |
parent | cf42f2f4d5e95b7254479e80614d1814e74e2387 (diff) | |
download | mupdf-673f6e7149c3c5b0e2a1fe334c3b04124fc807c6.tar.xz |
html: Clean up some names.
Diffstat (limited to 'source/html/font.c')
-rw-r--r-- | source/html/font.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/html/font.c b/source/html/font.c index 51654ae9..ce8c2ed1 100644 --- a/source/html/font.c +++ b/source/html/font.c @@ -9,7 +9,7 @@ static const char *font_names[16] = { }; fz_font * -html_load_font(fz_context *ctx, html_context *htx, +fz_html_load_font(fz_context *ctx, fz_html_font_set *set, const char *family, const char *variant, const char *style, const char *weight) { unsigned char *data; @@ -21,15 +21,25 @@ html_load_font(fz_context *ctx, html_context *htx, int is_italic = !strcmp(style, "italic") || !strcmp(style, "oblique"); int idx = is_mono * 8 + is_sans * 4 + is_bold * 2 + is_italic; - if (!htx->fonts[idx]) + if (!set->fonts[idx]) { data = pdf_lookup_builtin_font(font_names[idx], &size); if (!data) { printf("data=%p idx=%d s=%s\n", data, idx, font_names[idx]); abort(); } - htx->fonts[idx] = fz_new_font_from_memory(ctx, font_names[idx], data, size, 0, 1); + set->fonts[idx] = fz_new_font_from_memory(ctx, font_names[idx], data, size, 0, 1); } - return htx->fonts[idx]; + return set->fonts[idx]; +} + +fz_html_font_set *fz_new_html_font_set(fz_context *ctx) +{ + return fz_malloc_struct(ctx, fz_html_font_set); +} + +void fz_free_html_font_set(fz_context *ctx, fz_html_font_set *set) +{ + fz_free(ctx, set); } |