annotate libass/ass_font.h @ 21447:222f4c2c8c43

Synced with r21462
author torinthiel
date Sun, 03 Dec 2006 12:01:21 +0000
parents c611dfc4cb85
children 62bd8e0d3a0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21277
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
1 // -*- c-basic-offset: 8; indent-tabs-mode: t -*-
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
2 // vim:ts=8:sw=8:noet:ai:
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
3 /*
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
4 Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
5
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
6 This program is free software; you can redistribute it and/or modify
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
8 the Free Software Foundation; either version 2 of the License, or
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
9 (at your option) any later version.
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
10
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
14 GNU General Public License for more details.
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
15
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
17 along with this program; if not, write to the Free Software
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
19 */
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
20
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
21 #ifndef __ASS_FONT_H__
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
22 #define __ASS_FONT_H__
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
23
21351
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
24 #ifdef HAVE_FONTCONFIG
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
25 #include <fontconfig/fontconfig.h>
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
26 #endif
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
27
21321
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
28 typedef struct ass_font_desc_s {
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
29 char* family;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
30 unsigned bold;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
31 unsigned italic;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
32 } ass_font_desc_t;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
33
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
34 typedef struct ass_font_s {
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
35 ass_font_desc_t desc;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
36 char* path;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
37 int index;
21349
11679d93c7d8 Add FT_Library to ass_font_t.
eugeni
parents: 21323
diff changeset
38 FT_Library ftlibrary;
21321
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
39 FT_Face face;
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
40 FT_Matrix m; // current transformation
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
41 FT_Vector v; // current shift
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
42 int size;
21351
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
43 #ifdef HAVE_FONTCONFIG
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
44 FcCharSet* charset;
c611dfc4cb85 If a glyph is not found in the current font, switch to another one.
eugeni
parents: 21349
diff changeset
45 #endif
21321
7b7627ff1937 Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents: 21317
diff changeset
46 } ass_font_t;
21277
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
47
21317
dcfd069efd8f Move ass_font_t allocation to ass_font.h.
eugeni
parents: 21277
diff changeset
48 ass_font_t* ass_font_new(FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc);
21277
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
49 void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v);
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
50 void ass_font_set_size(ass_font_t* font, int size);
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
51 FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch);
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
52 void ass_font_free(ass_font_t* font);
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
53
0603972f083c Move fonts-related code to a separate file.
eugeni
parents:
diff changeset
54 #endif