summaryrefslogtreecommitdiff
path: root/source/fitz/font.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-11-11 14:37:16 +0100
committerTor Andersson <tor.andersson@artifex.com>2013-11-11 16:12:46 +0100
commit7570e7fa8a40cb41db6a1ab14b225cf00c4f56f5 (patch)
tree1b2853d64609e8365715521beaf079f533ebe84a /source/fitz/font.c
parenta2c945506ea2a2b58edbde84124094c6b4f69eac (diff)
downloadmupdf-7570e7fa8a40cb41db6a1ab14b225cf00c4f56f5.tar.xz
Add hooks to load system fonts. Use them in PDF interpreter.
Diffstat (limited to 'source/fitz/font.c')
-rw-r--r--source/fitz/font.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index d78ccd6d..d201f441 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -185,6 +185,7 @@ struct fz_font_context_s {
int ctx_refs;
FT_Library ftlib;
int ftlib_refs;
+ fz_load_system_font_func load_font;
};
#undef __FTERRORS_H__
@@ -204,6 +205,7 @@ void fz_new_font_context(fz_context *ctx)
ctx->font->ctx_refs = 1;
ctx->font->ftlib = NULL;
ctx->font->ftlib_refs = 0;
+ ctx->font->load_font = NULL;
}
fz_font_context *
@@ -229,6 +231,18 @@ void fz_drop_font_context(fz_context *ctx)
fz_free(ctx, ctx->font);
}
+void fz_install_load_system_font_func(fz_context *ctx, fz_load_system_font_func f)
+{
+ ctx->font->load_font = f;
+}
+
+fz_buffer *fz_load_system_font(fz_context *ctx, const char *name)
+{
+ if (ctx->font->load_font)
+ return ctx->font->load_font(ctx, name);
+ return NULL;
+}
+
static const struct ft_error ft_errors[] =
{
#include FT_ERRORS_H