summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-02-24 17:06:00 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-02-29 15:56:45 +0100
commit2b65dae7e2ae091c03ffe0811aa4e60457a4cd84 (patch)
tree57593ffc1d970bf67608e5137df3630ed154b31e /include
parent63c0874392c5159e251514db48891500e9854c5d (diff)
downloadmupdf-2b65dae7e2ae091c03ffe0811aa4e60457a4cd84.tar.xz
Pass fz_font to pdf_add_xxx_font_res instead of a fz_buffer.
Make sure all fz_fonts have a ft_buffer available.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/buffer.h6
-rw-r--r--include/mupdf/fitz/font.h5
-rw-r--r--include/mupdf/pdf/font.h4
3 files changed, 9 insertions, 6 deletions
diff --git a/include/mupdf/fitz/buffer.h b/include/mupdf/fitz/buffer.h
index 64096ca4..6f0e812f 100644
--- a/include/mupdf/fitz/buffer.h
+++ b/include/mupdf/fitz/buffer.h
@@ -44,6 +44,7 @@ struct fz_buffer_s
unsigned char *data;
int cap, len;
int unused_bits;
+ int shared;
};
/*
@@ -72,6 +73,11 @@ fz_buffer *fz_new_buffer(fz_context *ctx, int capacity);
fz_buffer *fz_new_buffer_from_data(fz_context *ctx, unsigned char *data, int size);
/*
+ fz_new_buffer_from_shared_data: Like fz_new_buffer, but does not take ownership.
+*/
+fz_buffer *fz_new_buffer_from_shared_data(fz_context *ctx, unsigned char *data, int size);
+
+/*
fz_resize_buffer: Ensure that a buffer has a given capacity,
truncating data if required.
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index ea992112..c16afd45 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -28,6 +28,7 @@ struct fz_font_s
{
int refs;
char name[32];
+ fz_buffer *buffer;
char is_mono;
char is_serif;
@@ -42,10 +43,6 @@ struct fz_font_s
int fake_italic; /* ... synthesize italic */
int force_hinting; /* ... force hinting for DynaLab fonts */
- /* origin of font data */
- fz_buffer *ft_buffer;
- char *ft_filepath; /* kept for downstream consumers (such as SumatraPDF) */
-
fz_matrix t3matrix;
void *t3resources;
fz_buffer **t3procs; /* has 256 entries if used */
diff --git a/include/mupdf/pdf/font.h b/include/mupdf/pdf/font.h
index 40a1a3e5..73b25d2f 100644
--- a/include/mupdf/pdf/font.h
+++ b/include/mupdf/pdf/font.h
@@ -122,8 +122,8 @@ float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize,
void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nestedDepth);
-pdf_obj *pdf_add_simple_font_res(fz_context *ctx, pdf_document *doc, fz_buffer *buffer);
-pdf_obj *pdf_add_cid_font_res(fz_context *ctx, pdf_document *doc, fz_buffer *buffer, fz_font *font);
+pdf_obj *pdf_add_simple_font_res(fz_context *ctx, pdf_document *doc, fz_font *font);
+pdf_obj *pdf_add_cid_font_res(fz_context *ctx, pdf_document *doc, fz_font *font);
int pdf_font_writing_supported(fz_font *font);