diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-07 18:26:51 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-07 18:26:51 +0000 |
commit | e15ae9a60043d8d9c1b110607c5059f13ca86421 (patch) | |
tree | 22b3b039cdc936ae7063c5fd0092c2c837292d0f /libass/ass_cache.h | |
parent | 2f2d8cef15ccef7f2e0882a482a4fa071054778d (diff) | |
download | mpv-e15ae9a60043d8d9c1b110607c5059f13ca86421.tar.bz2 mpv-e15ae9a60043d8d9c1b110607c5059f13ca86421.tar.xz |
Initial libass release (without mencoder support).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18942 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r-- | libass/ass_cache.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h new file mode 100644 index 0000000000..07038b5e47 --- /dev/null +++ b/libass/ass_cache.h @@ -0,0 +1,50 @@ +#ifndef __ASS_CACHE_H__ +#define __ASS_CACHE_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H +#include FT_STROKER_H +#include FT_GLYPH_H + +// font cache +typedef struct face_desc_s { + char* family; + unsigned bold; + unsigned italic; +} face_desc_t; + +void ass_face_cache_init(void); +int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, /*out*/ FT_Face* face); +void ass_face_cache_done(void); + + +// describes a glyph; glyphs with equivalents structs are considered identical +typedef struct glyph_hash_key_s { + char bitmap; // bool : true = bitmap, false = outline + FT_Face face; + int size; // font size + int index; // glyph index in the face + unsigned outline; // border width, 16.16 fixed point value + int bold, italic; + + // the following affects bitmap glyphs only + unsigned scale_x, scale_y; // 16.16 + int angle; // signed 16.16 + + FT_Vector advance; // subpixel shift vector +} glyph_hash_key_t; + +typedef struct glyph_hash_val_s { + FT_Glyph glyph; // the actual glyphs + FT_Glyph outline_glyph; + FT_BBox bbox_scaled; // bbox after scaling, but before rotation + FT_Vector advance; // 26.6, advance distance to the next glyph in line +} glyph_hash_val_t; + +void ass_glyph_cache_init(void); +void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val); +glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key); +void ass_glyph_cache_done(void); + +#endif + |