diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2011-08-17 18:59:00 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2015-07-10 10:42:40 +0200 |
commit | 38f4a39bdbe6090d39e86b620c772ba5cd88c8a5 (patch) | |
tree | 8e67b50042c1c732c3100838eb22e4dcd90545dd /libass/ass_font.h | |
parent | d5091c88d10cbea95f3e45b31a8738d7cd8e3819 (diff) | |
download | libass-38f4a39bdbe6090d39e86b620c772ba5cd88c8a5.tar.bz2 libass-38f4a39bdbe6090d39e86b620c772ba5cd88c8a5.tar.xz |
Never add a face twice to an ASS_Font
Introduce a unique ID per font face and check it in add_face to make
sure we never add a font face twice. This is useful in case the glyph
coverage report is unreliable.
Diffstat (limited to 'libass/ass_font.h')
-rw-r--r-- | libass/ass_font.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libass/ass_font.h b/libass/ass_font.h index 9ccc83a2..f29e301f 100644 --- a/libass/ass_font.h +++ b/libass/ass_font.h @@ -24,9 +24,13 @@ #include FT_GLYPH_H #include FT_OUTLINE_H +typedef struct ass_font ASS_Font; +typedef struct ass_font_desc ASS_FontDesc; + #include "ass.h" #include "ass_types.h" #include "ass_fontselect.h" +#include "ass_cache.h" #define VERTICAL_LOWER_BOUND 0x02f1 @@ -34,28 +38,25 @@ #define DECO_UNDERLINE 1 #define DECO_STRIKETHROUGH 2 -typedef struct ass_shaper_font_data ASS_ShaperFontData; - -typedef struct { +struct ass_font_desc { char *family; unsigned bold; unsigned italic; int vertical; // @font vertical layout -} ASS_FontDesc; +}; -typedef struct { +struct ass_font { ASS_FontDesc desc; ASS_Library *library; FT_Library ftlibrary; + int faces_uid[ASS_FONT_MAX_FACES]; FT_Face faces[ASS_FONT_MAX_FACES]; ASS_ShaperFontData *shaper_priv; int n_faces; double scale_x, scale_y; // current transform FT_Vector v; // current shift double size; -} ASS_Font; - -#include "ass_cache.h" +}; ASS_Font *ass_font_new(Cache *font_cache, ASS_Library *library, FT_Library ftlibrary, ASS_FontSelector *fontsel, |