1
#ifndef __ASS_CACHE_H__
2
#define __ASS_CACHE_H__
10
typedef struct face_desc_s {
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);
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
25
int size; // font size
26
int index; // glyph index in the face
27
unsigned outline; // border width, 16.16 fixed point value
30
// the following affects bitmap glyphs only
31
unsigned scale_x, scale_y; // 16.16
32
int angle; // signed 16.16
34
FT_Vector advance; // subpixel shift vector
37
typedef struct glyph_hash_val_s {
38
FT_Glyph glyph; // the actual glyphs
39
FT_Glyph outline_glyph;
40
FT_BBox bbox_scaled; // bbox after scaling, but before rotation
41
FT_Vector advance; // 26.6, advance distance to the next glyph in line
44
void ass_glyph_cache_init(void);
45
void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val);
46
glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
47
void ass_glyph_cache_done(void);