ScummVM API documentation
font.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MADS_CORE_FONT_H
23 #define MADS_CORE_FONT_H
24 
25 #include "mads/core/buffer.h"
26 
27 namespace MADS {
28 
29 #define FONT_SIZE 128
30 #define FONT_MAX_WIDTH 255
31 #define FONT_MAX_HEIGHT 200
32 
33 struct FontBuf {
34  byte max_y_size;
35  byte max_x_size;
36 
37  byte width[FONT_SIZE];
38  byte *data[FONT_SIZE];
39 };
40 
41 typedef FontBuf Font;
42 typedef Font *FontPtr;
43 
44 extern byte font_colors[4];
45 
46 extern FontPtr font_inter; /* Font handle for interface text */
47 extern FontPtr font_main; /* Font handle for main sentence */
48 extern FontPtr font_conv; /* Font handle for conversations */
49 extern FontPtr font_menu; /* Font handle for menu stuff */
50 extern FontPtr font_misc; /* Font handle for symbols & icons */
51 extern FontPtr font_tele; /* Font handle for Rex teleporter */
52 
53 extern FontPtr font_load(const char *name);
54 extern int font_write(FontPtr font, Buffer *target, const char *out_string,
55  int x, int y, int auto_spacing);
56 extern void font_set_colors(int background, int high_intense, int med_intense, int low_intense);
57 extern int font_string_width(FontPtr font, const char *out_string, int auto_spacing);
58 
59 extern void init_font();
60 
61 } // namespace MADS
62 
63 #endif
Definition: font.h:33
Definition: general.h:57
Definition: anim_timer.h:27