Mercurial > mplayer.hg
annotate libass/ass_font.h @ 22153:0cf24df5d97b
Revert part of commit r22170.
FFmpeg lavcodecs version is still
(or according to ffmpeg commit r7868, it's back to)
49.3.0, so global variables are not yet directly accessable (if ever).
author | iive |
---|---|
date | Wed, 07 Feb 2007 12:31:37 +0000 |
parents | b4b51eb2904f |
children | 1de2a46a0987 |
rev | line source |
---|---|
21277 | 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 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. | |
10 | |
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. | |
15 | |
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 | |
19 */ | |
20 | |
21 #ifndef __ASS_FONT_H__ | |
22 #define __ASS_FONT_H__ | |
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 |
21619
b4b51eb2904f
Keep reselected fonts in an array, adding new ones to the end. Glyph
eugeni
parents:
21618
diff
changeset
|
34 #define ASS_FONT_MAX_FACES 10 |
b4b51eb2904f
Keep reselected fonts in an array, adding new ones to the end. Glyph
eugeni
parents:
21618
diff
changeset
|
35 |
21321
7b7627ff1937
Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents:
21317
diff
changeset
|
36 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
|
37 ass_font_desc_t desc; |
21349 | 38 FT_Library ftlibrary; |
21619
b4b51eb2904f
Keep reselected fonts in an array, adding new ones to the end. Glyph
eugeni
parents:
21618
diff
changeset
|
39 FT_Face faces[ASS_FONT_MAX_FACES]; |
b4b51eb2904f
Keep reselected fonts in an array, adding new ones to the end. Glyph
eugeni
parents:
21618
diff
changeset
|
40 int n_faces; |
21321
7b7627ff1937
Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents:
21317
diff
changeset
|
41 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
|
42 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
|
43 int size; |
21351
c611dfc4cb85
If a glyph is not found in the current font, switch to another one.
eugeni
parents:
21349
diff
changeset
|
44 #ifdef HAVE_FONTCONFIG |
c611dfc4cb85
If a glyph is not found in the current font, switch to another one.
eugeni
parents:
21349
diff
changeset
|
45 FcCharSet* charset; |
c611dfc4cb85
If a glyph is not found in the current font, switch to another one.
eugeni
parents:
21349
diff
changeset
|
46 #endif |
21321
7b7627ff1937
Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
eugeni
parents:
21317
diff
changeset
|
47 } ass_font_t; |
21277 | 48 |
21460 | 49 ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc); |
21277 | 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); | |
21614
5d2ca7ca18b5
Move ascender, descender, and kerning computation to ass_font.c.
eugeni
parents:
21460
diff
changeset
|
52 void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc); |
21277 | 53 FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch); |
21614
5d2ca7ca18b5
Move ascender, descender, and kerning computation to ass_font.c.
eugeni
parents:
21460
diff
changeset
|
54 FT_Vector ass_font_get_kerning(ass_font_t* font, uint32_t c1, uint32_t c2); |
21277 | 55 void ass_font_free(ass_font_t* font); |
56 | |
57 #endif |