From 2b65dae7e2ae091c03ffe0811aa4e60457a4cd84 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 24 Feb 2016 17:06:00 +0100 Subject: Pass fz_font to pdf_add_xxx_font_res instead of a fz_buffer. Make sure all fz_fonts have a ft_buffer available. --- source/tools/pdfcreate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/tools/pdfcreate.c') diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c index e36e0e68..70d0aa42 100644 --- a/source/tools/pdfcreate.c +++ b/source/tools/pdfcreate.c @@ -371,9 +371,12 @@ static int create_pdf(fz_context *ctx, char *output, resources fonts[], int num_ pch = strchr(content.fonts[k].name, ':'); if (pch != NULL) { + fz_font *font; im_font_buff = fz_read_file(ctx, &(pch[1])); - font_res = pdf_add_simple_font_res(ctx, pdf, im_font_buff); + font = fz_new_font_from_buffer(ctx, NULL, im_font_buff, 0, 0); + font_res = pdf_add_simple_font_res(ctx, pdf, font); fz_drop_buffer(ctx, im_font_buff); + fz_drop_font(ctx, font); im_font_buff = NULL; /* Look through our font page resources and update the indirect -- cgit v1.2.3