Mercurial > mplayer.hg
annotate libass/ass_cache.h @ 19965:70352570e9ae
Shadow support in libass.
author | eugeni |
---|---|
date | Sun, 24 Sep 2006 16:04:37 +0000 |
parents | 07be98a5dd5f |
children | fa122b7c71c6 |
rev | line source |
---|---|
18937 | 1 #ifndef __ASS_CACHE_H__ |
2 #define __ASS_CACHE_H__ | |
3 | |
4 #include <ft2build.h> | |
5 #include FT_FREETYPE_H | |
6 #include FT_STROKER_H | |
7 #include FT_GLYPH_H | |
8 | |
9 // font cache | |
10 typedef struct face_desc_s { | |
11 char* family; | |
12 unsigned bold; | |
13 unsigned italic; | |
14 } face_desc_t; | |
15 | |
16 void ass_face_cache_init(void); | |
17 int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, /*out*/ FT_Face* face); | |
18 void ass_face_cache_done(void); | |
19 | |
20 | |
21 // describes a glyph; glyphs with equivalents structs are considered identical | |
22 typedef struct glyph_hash_key_s { | |
23 char bitmap; // bool : true = bitmap, false = outline | |
24 FT_Face face; | |
25 int size; // font size | |
26 int index; // glyph index in the face | |
27 unsigned outline; // border width, 16.16 fixed point value | |
28 int bold, italic; | |
19848 | 29 char be; // blur edges |
18937 | 30 |
31 // the following affects bitmap glyphs only | |
32 unsigned scale_x, scale_y; // 16.16 | |
33 int angle; // signed 16.16 | |
34 | |
35 FT_Vector advance; // subpixel shift vector | |
36 } glyph_hash_key_t; | |
37 | |
38 typedef struct glyph_hash_val_s { | |
19846
bcc792bfa431
Store bitmap glyphs in a separate struct, instead of FreeType's internal buffer.
eugeni
parents:
19539
diff
changeset
|
39 bitmap_t* bm; // the actual glyph bitmaps |
bcc792bfa431
Store bitmap glyphs in a separate struct, instead of FreeType's internal buffer.
eugeni
parents:
19539
diff
changeset
|
40 bitmap_t* bm_o; |
19965 | 41 bitmap_t* bm_s; |
18937 | 42 FT_BBox bbox_scaled; // bbox after scaling, but before rotation |
43 FT_Vector advance; // 26.6, advance distance to the next glyph in line | |
44 } glyph_hash_val_t; | |
45 | |
46 void ass_glyph_cache_init(void); | |
47 void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val); | |
48 glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key); | |
19539 | 49 void ass_glyph_cache_reset(void); |
18937 | 50 void ass_glyph_cache_done(void); |
51 | |
52 #endif | |
53 |