diff options
author | Grigori Goronzy <greg@hein> | 2009-07-07 20:25:55 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-07 23:07:50 +0200 |
commit | f54a0cf94853d8372225bb0b45d6bd2b8e4e6fde (patch) | |
tree | 9c0e3b14e8ecf6e8cc1fe3f2107aad94d134cdd4 /libass/ass_font.h | |
parent | 5a2b270b218a429763f0a032386705f55bca0a92 (diff) | |
download | libass-f54a0cf94853d8372225bb0b45d6bd2b8e4e6fde.tar.bz2 libass-f54a0cf94853d8372225bb0b45d6bd2b8e4e6fde.tar.xz |
Support for underline and strikethrough
Add support for the underline (\u) and strikethrough/strikeout (\s)
properties. This is a bit tricky, since FreeType doesn't offer
any method of adding the lines, so you have to draw them yourself.
libass uses various information from TrueType tables to get position
and size of the lines, does a few simple consistency checks (some fonts
might be broken) and if everything is alright, adds new contours for
the lines.
Sometimes, rendering errors can occur:
- Currently, kerning isn't taken into account, which means the lines
can overlap a little, leading to small optical glitches.
- Some (broken) fonts use the wrong winding direction. In this case,
the FreeType stroker will only consider the added lines to be "outside"
and only stroke the line instead of the whole glyph.
Diffstat (limited to 'libass/ass_font.h')
-rw-r--r-- | libass/ass_font.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libass/ass_font.h b/libass/ass_font.h index b208064..8fe4c1e 100644 --- a/libass/ass_font.h +++ b/libass/ass_font.h @@ -27,6 +27,10 @@ #include "ass.h" #include "ass_types.h" +#define ASS_FONT_MAX_FACES 10 +#define DECO_UNDERLINE 1 +#define DECO_STRIKETHROUGH 2 + typedef struct ass_font_desc_s { char *family; unsigned bold; @@ -34,8 +38,6 @@ typedef struct ass_font_desc_s { int treat_family_as_pattern; } ass_font_desc_t; -#define ASS_FONT_MAX_FACES 10 - typedef struct ass_font_s { ass_font_desc_t desc; ass_library_t *library; @@ -57,7 +59,7 @@ void ass_font_set_size(ass_font_t *font, double size); void ass_font_get_asc_desc(ass_font_t *font, uint32_t ch, int *asc, int *desc); FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ass_font_t *font, - uint32_t ch, ass_hinting_t hinting); + uint32_t ch, ass_hinting_t hinting, int flags); FT_Vector ass_font_get_kerning(ass_font_t *font, uint32_t c1, uint32_t c2); void ass_font_free(ass_font_t *font); |