diff options
Diffstat (limited to 'include/fitz/font.h')
-rw-r--r-- | include/fitz/font.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/include/fitz/font.h b/include/fitz/font.h new file mode 100644 index 00000000..743d87fa --- /dev/null +++ b/include/fitz/font.h @@ -0,0 +1,63 @@ +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 c; + short w; +}; + +struct fz_vmtx_s +{ + unsigned short c; + short x; + short y; + short w; +}; + +struct fz_font_s +{ + char name[32]; + + fz_error* (*render)(fz_glyph*, fz_font*, int, fz_matrix); + void (*free)(fz_font *); + + int wmode; + fz_irect bbox; + + int nhmtx, hmtxcap; + fz_hmtx dhmtx; + fz_hmtx *hmtx; + + int nvmtx, vmtxcap; + fz_vmtx dvmtx; + fz_vmtx *vmtx; +}; + +struct fz_glyph_s +{ + int w, h, lsb, top; + unsigned char *bitmap; +}; + +void fz_initfont(fz_font *font, char *name); +void fz_freefont(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 gid, int w); +fz_error *fz_addvmtx(fz_font *font, int gid, 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 gid); +fz_vmtx fz_getvmtx(fz_font *font, int gid); + +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_freeglyphcache(fz_glyphcache *); + |