diff options
author | Grigori Goronzy <greg@blackbox> | 2011-06-20 22:50:34 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2011-06-20 22:50:34 +0200 |
commit | e5704aa76a2712782442156986f74b8766077ee1 (patch) | |
tree | 755509f7c315f4b542b6bd8b2c5e190206cdf355 /libass/ass_font.c | |
parent | 3a0055a7bd1d6378aece89db0d17cc0ac804a89b (diff) | |
download | libass-e5704aa76a2712782442156986f74b8766077ee1.tar.bz2 libass-e5704aa76a2712782442156986f74b8766077ee1.tar.xz |
Convert outline processing and caching from glyphs to bare outlines
This introduces functions to use and copy pointered outline objects
easily and uses these instead of glyphs everywhere.
Previously the glyph cache was abused for caching vector clipping masks,
but this isn't possible anymore (nor desirable), thus vector clipping
cache has been disabled for the moment.
Diffstat (limited to 'libass/ass_font.c')
-rw-r--r-- | libass/ass_font.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c index 7b55e81..400dad6 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -388,6 +388,25 @@ static int ass_strike_outline_glyph(FT_Face face, ASS_Font *font, return 0; } +void outline_copy(FT_Library lib, FT_Outline *source, FT_Outline **dest) +{ + if (source == NULL) { + *dest = NULL; + return; + } + *dest = calloc(1, sizeof(**dest)); + + FT_Outline_New(lib, source->n_points, source->n_contours, *dest); + FT_Outline_Copy(source, *dest); +} + +void outline_free(FT_Library lib, FT_Outline *outline) +{ + if (outline) + FT_Outline_Done(lib, outline); + free(outline); +} + /** * Slightly embold a glyph without touching its metrics */ |