summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-11-04 14:46:53 +0100
committerTor Andersson <tor@ghostscript.com>2004-11-04 14:46:53 +0100
commitcbbee31601e34f1f513a4d046d52963baebf07fa (patch)
tree6393fbd6066e53dcb7ed2b52f262f6ef0514e927 /include
parent3386060e982e4fc353a4c405316c0c83bf459bab (diff)
downloadmupdf-cbbee31601e34f1f513a4d046d52963baebf07fa.tar.xz
type3 fonts
Diffstat (limited to 'include')
-rw-r--r--include/fitz/font.h2
-rw-r--r--include/fitz/math.h15
-rw-r--r--include/mupdf/content.h2
-rw-r--r--include/mupdf/rsrc.h17
4 files changed, 24 insertions, 12 deletions
diff --git a/include/fitz/font.h b/include/fitz/font.h
index 4d9fb5e8..9fd9218b 100644
--- a/include/fitz/font.h
+++ b/include/fitz/font.h
@@ -8,7 +8,7 @@ struct fz_hmtx_s
{
unsigned short lo;
unsigned short hi;
- short w;
+ int w; /* type3 fonts can be big! */
};
struct fz_vmtx_s
diff --git a/include/fitz/math.h b/include/fitz/math.h
index bcbfee00..bfc1f8e6 100644
--- a/include/fitz/math.h
+++ b/include/fitz/math.h
@@ -4,6 +4,21 @@ static inline unsigned char fz_mul255(unsigned char a, unsigned char b)
return ((a + 1) * b) >> 8;
}
+/* floor / ceil towards/from +/- inf */
+static inline float fz_floor(float x)
+{
+ if (x > 0)
+ return floor(x);
+ return ceil(x);
+}
+
+static inline float fz_ceil(float x)
+{
+ if (x > 0)
+ return ceil(x);
+ return floor(x);
+}
+
/* divide and floor towards -inf */
static inline int fz_idiv(int a, int b)
{
diff --git a/include/mupdf/content.h b/include/mupdf/content.h
index 3f85fe06..96b31f8e 100644
--- a/include/mupdf/content.h
+++ b/include/mupdf/content.h
@@ -99,7 +99,7 @@ fz_error *pdf_flushtext(pdf_csi*);
fz_error *pdf_showimage(pdf_csi*, pdf_image *img);
/* interpret.c */
-fz_error *pdf_newcsi(pdf_csi **csip);
+fz_error *pdf_newcsi(pdf_csi **csip, int maskonly);
fz_error *pdf_runcsi(pdf_csi *, pdf_xref *xref, fz_obj *rdb, fz_file *);
void pdf_dropcsi(pdf_csi *csi);
diff --git a/include/mupdf/rsrc.h b/include/mupdf/rsrc.h
index 9dc12acd..896e4335 100644
--- a/include/mupdf/rsrc.h
+++ b/include/mupdf/rsrc.h
@@ -17,7 +17,6 @@ void *pdf_findresource(pdf_rsrc *list, fz_obj *ref);
* Functions
*/
-
typedef struct pdf_function_s pdf_function;
fz_error *pdf_loadfunction(pdf_function **func, pdf_xref *xref, fz_obj *obj);
@@ -91,9 +90,6 @@ struct pdf_font_s
{
fz_font super;
- void *ftface;
- int substitute;
-
/* FontDescriptor */
int flags;
float italicangle;
@@ -108,18 +104,16 @@ struct pdf_font_s
int ncidtogid;
unsigned short *cidtogid;
- /* Raw data for freetype */
+ /* Freetype */
+ int substitute;
+ void *ftface;
char *filename;
fz_buffer *fontdata;
-};
-struct pdf_type3_s
-{
+ /* Type3 data */
fz_rect bbox;
fz_matrix matrix;
- int widths[256];
fz_tree *charprocs[256];
- int tounicode[256];
};
/* cmap.c */
@@ -134,6 +128,9 @@ fz_error *pdf_loadembeddedfont(pdf_font *font, pdf_xref *xref, fz_obj *stmref);
fz_error *pdf_loadsystemfont(pdf_font *font, char *basefont, char *collection);
fz_error *pdf_loadsubstitutefont(pdf_font *font, int fdflags, char *collection);
+/* type3.c */
+fz_error *pdf_loadtype3font(pdf_font **fontp, pdf_xref *xref, fz_obj *font);
+
/* font.c */
fz_error *pdf_loadfontdescriptor(pdf_font *font, pdf_xref *xref, fz_obj *desc, char *collection);
fz_error *pdf_loadfont(pdf_font **fontp, pdf_xref *xref, fz_obj *font);