summaryrefslogtreecommitdiff
path: root/source/xps/xps-glyphs.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-11-11 14:37:03 +0100
committerTor Andersson <tor.andersson@artifex.com>2013-11-11 16:12:45 +0100
commita2c945506ea2a2b58edbde84124094c6b4f69eac (patch)
tree3bcb66ff73e4323621f21a622a8049b71ee9a58f /source/xps/xps-glyphs.c
parentcdc3d601bfe1f16ea96f35526644eaf53415be80 (diff)
downloadmupdf-a2c945506ea2a2b58edbde84124094c6b4f69eac.tar.xz
Add fz_new_font_from_buffer function.
Use fz_buffer to wrap and reference count data used in font.
Diffstat (limited to 'source/xps/xps-glyphs.c')
-rw-r--r--source/xps/xps-glyphs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c
index 02ed6fee..b26e18dc 100644
--- a/source/xps/xps-glyphs.c
+++ b/source/xps/xps-glyphs.c
@@ -522,7 +522,9 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm,
fz_try(doc->ctx)
{
- font = fz_new_font_from_memory(doc->ctx, NULL, part->data, part->size, subfontid, 1);
+ fz_buffer *buf = fz_new_buffer_from_data(doc->ctx, part->data, part->size);
+ font = fz_new_font_from_buffer(doc->ctx, NULL, buf, subfontid, 1);
+ fz_drop_buffer(doc->ctx, buf);
}
fz_catch(doc->ctx)
{
@@ -542,9 +544,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm,
xps_insert_font(doc, fakename, font);
- /* NOTE: we keep part->data in the font */
- font->ft_data = part->data;
- font->ft_size = part->size;
+ /* NOTE: we already saved part->data in the buffer in the font */
fz_free(doc->ctx, part->name);
fz_free(doc->ctx, part);
}