summaryrefslogtreecommitdiff
path: root/source/html/font.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-25 23:50:27 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-12-03 12:25:52 +0100
commitcf42f2f4d5e95b7254479e80614d1814e74e2387 (patch)
tree9d0452350d479c0222002c5969a4b0d8ce104925 /source/html/font.c
parentbb238db8919162c8976980b8aa48f70664f2f29d (diff)
downloadmupdf-cf42f2f4d5e95b7254479e80614d1814e74e2387.tar.xz
html: Split html parsing cache and state into html_context.
html_document is now a simple client of html_context.
Diffstat (limited to 'source/html/font.c')
-rw-r--r--source/html/font.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/html/font.c b/source/html/font.c
index 9c408367..51654ae9 100644
--- a/source/html/font.c
+++ b/source/html/font.c
@@ -9,10 +9,9 @@ static const char *font_names[16] = {
};
fz_font *
-html_load_font(html_document *doc,
+html_load_font(fz_context *ctx, html_context *htx,
const char *family, const char *variant, const char *style, const char *weight)
{
- fz_context *ctx = doc->ctx;
unsigned char *data;
unsigned int size;
@@ -22,15 +21,15 @@ html_load_font(html_document *doc,
int is_italic = !strcmp(style, "italic") || !strcmp(style, "oblique");
int idx = is_mono * 8 + is_sans * 4 + is_bold * 2 + is_italic;
- if (!doc->fonts[idx])
+ if (!htx->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();
}
- doc->fonts[idx] = fz_new_font_from_memory(ctx, font_names[idx], data, size, 0, 1);
+ htx->fonts[idx] = fz_new_font_from_memory(ctx, font_names[idx], data, size, 0, 1);
}
- return doc->fonts[idx];
+ return htx->fonts[idx];
}