diff options
Diffstat (limited to 'include/fitz/wld_font.h')
-rw-r--r-- | include/fitz/wld_font.h | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/include/fitz/wld_font.h b/include/fitz/wld_font.h index 27217c6c..8bcffb60 100644 --- a/include/fitz/wld_font.h +++ b/include/fitz/wld_font.h @@ -1,43 +1,22 @@ typedef struct fz_font_s fz_font; -typedef struct fz_hmtx_s fz_hmtx; -typedef struct fz_vmtx_s fz_vmtx; typedef struct fz_glyph_s fz_glyph; typedef struct fz_glyphcache_s fz_glyphcache; -struct fz_hmtx_s -{ - unsigned short lo; - unsigned short hi; - int w; /* type3 fonts can be big! */ -}; - -struct fz_vmtx_s -{ - unsigned short lo; - unsigned short hi; - short x; - short y; - short w; -}; +char *ft_errorstring(int err); struct fz_font_s { int refs; char name[32]; - fz_error* (*render)(fz_glyph*, fz_font*, int, fz_matrix); - void (*drop)(fz_font *); + void *ftface; /* has an FT_Face if used */ + int ftsubstitute; /* ... substitute metrics */ - int wmode; - fz_irect bbox; + struct fz_tree_s **t3procs; /* has 256 entries if used */ + fz_matrix t3matrix; - int nhmtx, hmtxcap; - fz_hmtx dhmtx; - fz_hmtx *hmtx; + fz_irect bbox; - int nvmtx, vmtxcap; - fz_vmtx dvmtx; - fz_vmtx *vmtx; }; struct fz_glyph_s @@ -46,23 +25,24 @@ struct fz_glyph_s unsigned char *samples; }; -void fz_initfont(fz_font *font, char *name); -fz_font *fz_keepfont(fz_font *font); +fz_error * fz_newfreetypefont(fz_font **fontp, char *name, int substitute); +fz_error * fz_loadfreetypefontfile(fz_font *font, char *path, int index); +fz_error * fz_loadfreetypefontbuffer(fz_font *font, unsigned char *data, int len, int index); +fz_error * fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix, void **procs); + +fz_error * fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index); +fz_error * fz_newfontfromfile(fz_font **fontp, char *path, int index); + +fz_font * fz_keepfont(fz_font *font); void fz_dropfont(fz_font *font); + void fz_debugfont(fz_font *font); -void fz_setfontwmode(fz_font *font, int wmode); void fz_setfontbbox(fz_font *font, int xmin, int ymin, int xmax, int ymax); -void fz_setdefaulthmtx(fz_font *font, int w); -void fz_setdefaultvmtx(fz_font *font, int y, int w); -fz_error *fz_addhmtx(fz_font *font, int lo, int hi, int w); -fz_error *fz_addvmtx(fz_font *font, int lo, int hi, int x, int y, int w); -fz_error *fz_endhmtx(fz_font *font); -fz_error *fz_endvmtx(fz_font *font); -fz_hmtx fz_gethmtx(fz_font *font, int cid); -fz_vmtx fz_getvmtx(fz_font *font, int cid); -fz_error *fz_newglyphcache(fz_glyphcache **arenap, int slots, int size); -fz_error *fz_renderglyph(fz_glyphcache*, fz_glyph*, fz_font*, int, fz_matrix); +fz_error * fz_renderftglyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm); +fz_error * fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm); +fz_error * fz_newglyphcache(fz_glyphcache **arenap, int slots, int size); +fz_error * fz_renderglyph(fz_glyphcache*, fz_glyph*, fz_font*, int, fz_matrix); void fz_debugglyphcache(fz_glyphcache *); void fz_dropglyphcache(fz_glyphcache *); |