Initial import of MPlayer SVN rev 28382 and FFmpeg SVN rev 16846.
[vaapi:mplayer.git] / libass / .svn / text-base / ass_font.h.svn-base
1 // -*- c-basic-offset: 8; indent-tabs-mode: t -*-
2 // vim:ts=8:sw=8:noet:ai:
3 /*
4  * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
5  *
6  * This file is part of libass.
7  *
8  * libass is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * libass is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with libass; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef LIBASS_FONT_H
24 #define LIBASS_FONT_H
25
26 #include <stdint.h>
27 #include <ft2build.h>
28 #include FT_GLYPH_H
29 #include "ass.h"
30 #include "ass_types.h"
31
32 typedef struct ass_font_desc_s {
33         char* family;
34         unsigned bold;
35         unsigned italic;
36 } ass_font_desc_t;
37
38 #define ASS_FONT_MAX_FACES 10
39
40 typedef struct ass_font_s {
41         ass_font_desc_t desc;
42         ass_library_t* library;
43         FT_Library ftlibrary;
44         FT_Face faces[ASS_FONT_MAX_FACES];
45         int n_faces;
46         double scale_x, scale_y; // current transform
47         FT_Vector v; // current shift
48         double size;
49 } ass_font_t;
50
51 ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc);
52 void ass_font_set_transform(ass_font_t* font, double scale_x, double scale_y, FT_Vector* v);
53 void ass_font_set_size(ass_font_t* font, double size);
54 void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc);
55 FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch, ass_hinting_t hinting);
56 FT_Vector ass_font_get_kerning(ass_font_t* font, uint32_t c1, uint32_t c2);
57 void ass_font_free(ass_font_t* font);
58
59 #endif /* LIBASS_FONT_H */