synced with r22428
[mplayer/greg.git] / libass / ass_font.h
blob5d986e9f0b287faec8bc7857d8a576432b07b2b7
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>
6 This program 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 This program 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
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __ASS_FONT_H__
22 #define __ASS_FONT_H__
24 #ifdef HAVE_FONTCONFIG
25 #include <fontconfig/fontconfig.h>
26 #endif
28 typedef struct ass_font_desc_s {
29 char* family;
30 unsigned bold;
31 unsigned italic;
32 } ass_font_desc_t;
34 #define ASS_FONT_MAX_FACES 10
36 typedef struct ass_font_s {
37 ass_font_desc_t desc;
38 FT_Library ftlibrary;
39 FT_Face faces[ASS_FONT_MAX_FACES];
40 int n_faces;
41 FT_Matrix m; // current transformation
42 FT_Vector v; // current shift
43 int size;
44 #ifdef HAVE_FONTCONFIG
45 FcCharSet* charset;
46 #endif
47 } ass_font_t;
49 ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc);
50 void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v);
51 void ass_font_set_size(ass_font_t* font, int size);
52 void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc);
53 FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch);
54 FT_Vector ass_font_get_kerning(ass_font_t* font, uint32_t c1, uint32_t c2);
55 void ass_font_free(ass_font_t* font);
57 #endif