X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fttf.h;h=0d1ff50f5881c2b8b4797b16dfa5e96f821ddd59;hp=d37f745404b8e5f5a2fb3401092f69e48cf7a114;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hpb=f9843bbeaa52fe428420eed8d2c8992f763a8d68 diff --git a/lib/ttf.h b/lib/ttf.h index d37f745..0d1ff50 100644 --- a/lib/ttf.h +++ b/lib/ttf.h @@ -122,7 +122,7 @@ typedef struct _ttfpoint { } ttfpoint_t; typedef struct _ttfglyph { U16 advance; - U16 bearing; + S16 bearing; S16 xmin,ymin,xmax,ymax; int code_size; U8*code; @@ -140,13 +140,36 @@ typedef struct _table_head { } table_head_t; typedef struct _table_post { - U16 italic_angle; + U32 italic_angle; U16 underline_position; U16 underline_thickness; } table_post_t; +typedef struct _table_cvt { + S16*values; + int num; +} table_cvt_t; + +typedef struct _table_gasp { + int num; + struct { + U16 size; + U16 behaviour; + } *records; +} table_gasp_t; + +typedef struct _table_code { + U8*code; + int size; +} table_code_t; + typedef struct _ttf { - char*name; + char*family_name; /* nameId 1 */ + char*subfamily_name; /* nameId 2 */ + char*font_uid; /* nameId 3 */ + char*full_name; /* nameId 4 */ + char*version_string; /* nameId 5 */ + char*postscript_name; /* nameId 6 */ ttf_table_t*tables; @@ -155,12 +178,16 @@ typedef struct _ttf { table_os2_t*os2; table_hea_t*hea; table_post_t*post; + table_cvt_t*cvt; + table_gasp_t*gasp; + table_code_t*prep; + table_code_t*fpgm; U16 flags; char is_vertical; S16 ascent; - S16 descent; + S16 descent; // ymin, *not* negative ymin S16 lineGap; int num_glyphs; @@ -179,6 +206,8 @@ ttf_t*ttf_load(void*data, int length); ttf_table_t*ttf_addtable(ttf_t*ttf, U32 tag); void ttf_create_truetype_tables(ttf_t*ttf); void ttf_dump(ttf_t*ttf); +void ttf_destroy(ttf_t*ttf); void ttf_save(ttf_t*ttf, const char*filename); +void ttf_save_eot(ttf_t*ttf, const char*filename); #endif