Use MSGT_DECVIDEO in a video decoder.
[mplayer/glamo.git] / libass / ass_font.h
blobca0c213a093527e24cb0a94be28c76b0d8ddfaaf
1 /*
2 * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
4 * This file is part of libass.
6 * libass is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * libass is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with libass; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef LIBASS_FONT_H
22 #define LIBASS_FONT_H
24 #include <stdint.h>
25 #include <ft2build.h>
26 #include FT_GLYPH_H
27 #include "ass.h"
28 #include "ass_types.h"
30 #define ASS_FONT_MAX_FACES 10
31 #define DECO_UNDERLINE 1
32 #define DECO_STRIKETHROUGH 2
34 typedef struct {
35 char *family;
36 unsigned bold;
37 unsigned italic;
38 int treat_family_as_pattern;
39 } ASS_FontDesc;
41 typedef struct {
42 ASS_FontDesc desc;
43 ASS_Library *library;
44 FT_Library ftlibrary;
45 FT_Face faces[ASS_FONT_MAX_FACES];
46 int n_faces;
47 double scale_x, scale_y; // current transform
48 FT_Vector v; // current shift
49 double size;
50 } ASS_Font;
52 // FIXME: passing the hashmap via a void pointer is very ugly.
53 ASS_Font *ass_font_new(void *font_cache, ASS_Library *library,
54 FT_Library ftlibrary, void *fc_priv,
55 ASS_FontDesc *desc);
56 void ass_font_set_transform(ASS_Font *font, double scale_x,
57 double scale_y, FT_Vector *v);
58 void ass_font_set_size(ASS_Font *font, double size);
59 void ass_font_get_asc_desc(ASS_Font *font, uint32_t ch, int *asc,
60 int *desc);
61 FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font,
62 uint32_t ch, ASS_Hinting hinting, int flags);
63 FT_Vector ass_font_get_kerning(ASS_Font *font, uint32_t c1, uint32_t c2);
64 void ass_font_free(ASS_Font *font);
66 #endif /* LIBASS_FONT_H */