annotate libvo/font_load.h @ 7131:1943b619990c

Sipro audio now supported.
author diego
date Thu, 29 Aug 2002 01:56:09 +0000
parents 0dc9cb756b68
children b9ce54c7f30f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7122
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
1 #ifndef __MPLAYER_FONT_LOAD_H
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
2 #define __MPLAYER_FONT_LOAD_H
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
3
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
4 #ifdef HAVE_FREETYPE
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
5 #include <freetype/freetype.h>
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
6 #endif
213
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
7
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
8 typedef struct {
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
9 unsigned char *bmp;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
10 unsigned char *pal;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
11 int w,h,c;
7122
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
12 #ifdef HAVE_FREETYPE
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
13 int charwidth,charheight,pen,baseline,padding;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
14 int current_count, current_alloc;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
15 #endif
213
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
16 } raw_file;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
17
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
18 typedef struct {
214
09d0f437b817 desc fileformat changes
arpi_esp
parents: 213
diff changeset
19 char *name;
1353
c3e3b0ae4d06 Applied DATADIR patch by Vladimir Kushnir
arpi
parents: 706
diff changeset
20 char *fpath;
213
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
21 int spacewidth;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
22 int charspace;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
23 int height;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
24 // char *fname_a;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
25 // char *fname_b;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
26 raw_file* pic_a[16];
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
27 raw_file* pic_b[16];
706
8a7666a78f83 better .smi support and display two-byte characters- patch by Sunjin Yang
arpi_esp
parents: 339
diff changeset
28 short font[65536];
5928
48e91dc9534b .raw width>=65536 support by Georgi Georgiev <chutz@chubaka.homeip.net>
arpi
parents: 5294
diff changeset
29 int start[65536]; // short is not enough for unicode fonts
706
8a7666a78f83 better .smi support and display two-byte characters- patch by Sunjin Yang
arpi_esp
parents: 339
diff changeset
30 short width[65536];
7122
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
31
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
32 #ifdef HAVE_FREETYPE
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
33 int face_cnt;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
34
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
35 FT_Face faces[16];
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
36 FT_UInt glyph_index[65536];
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
37
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
38 int max_width, max_height;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
39
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
40 struct
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
41 {
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
42 int g_r;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
43 int o_r;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
44 int g_w;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
45 int o_w;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
46 int o_size;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
47 unsigned volume;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
48
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
49 unsigned *g;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
50 unsigned *gt;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
51 unsigned *gt2;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
52 unsigned *om;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
53 unsigned char *omt;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
54 unsigned short *tmp;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
55 } tables;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
56 #endif
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
57
213
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
58 } font_desc_t;
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents:
diff changeset
59
5294
4e64fca268e9 moved font_laod.h
arpi
parents: 1353
diff changeset
60 extern font_desc_t* vo_font;
4e64fca268e9 moved font_laod.h
arpi
parents: 1353
diff changeset
61
7122
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
62 #ifdef HAVE_FREETYPE
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
63
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
64 extern char *subtitle_font_encoding;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
65 extern float text_font_scale_factor;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
66 extern float osd_font_scale_factor;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
67 extern float subtitle_font_radius;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
68 extern float subtitle_font_thickness;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
69 extern int subtitle_autoscale;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
70
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
71 extern int vo_image_width;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
72 extern int vo_image_height;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
73
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
74 extern int force_load_font;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
75
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
76 int init_freetype();
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
77 int done_freetype();
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
78
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
79 font_desc_t* read_font_desc(char* fname,float factor,int movie_width, int movie_height);
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
80 void free_font_desc(font_desc_t *desc);
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
81
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
82 void render_one_glyph(font_desc_t *desc, int c);
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
83 int kerning(font_desc_t *desc, int prevc, int c);
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
84
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
85 void load_font(int width, int height);
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
86
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
87 #else
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
88
339
e7e89cd4169f printf's only if verbose>1
arpi_esp
parents: 215
diff changeset
89 raw_file* load_raw(char *name,int verbose);
e7e89cd4169f printf's only if verbose>1
arpi_esp
parents: 215
diff changeset
90 font_desc_t* read_font_desc(char* fname,float factor,int verbose);
7122
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
91
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
92 static void inline render_one_glyph(font_desc_t *desc, int c)
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
93 {
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
94 }
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
95
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
96 static int inline kerning(font_desc_t *desc, int prevc, int c)
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
97 {
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
98 return 0;
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
99 }
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
100
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
101 static void inline load_font(int width, int height)
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
102 {
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
103 }
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
104
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
105 #endif
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
106
0dc9cb756b68 freetype 2.0/2.1+ support - disabled by default until bugs fixed
arpi
parents: 5928
diff changeset
107 #endif /* ! __MPLAYER_FONT_LOAD_H */