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
27namespace MADS {
28
29#define FONT_SIZE 128
30#define FONT_MAX_WIDTH 255
31#define FONT_MAX_HEIGHT 200
32
33struct FontBuf {
34 byte max_y_size;
35 byte max_x_size;
36
37 byte width[FONT_SIZE];
38 byte *data[FONT_SIZE];
39};
40
41typedef FontBuf Font;
42typedef Font *FontPtr;
43
44extern byte font_colors[4];
45
46extern FontPtr font_inter; /* Font handle for interface text */
47extern FontPtr font_main; /* Font handle for main sentence */
48extern FontPtr font_conv; /* Font handle for conversations */
49extern FontPtr font_menu; /* Font handle for menu stuff */
50extern FontPtr font_misc; /* Font handle for symbols & icons */
51extern FontPtr font_tele; /* Font handle for Rex teleporter */
52
53extern FontPtr font_load(const char *name);
54extern int font_write(FontPtr font, Buffer *target, const char *out_string,
55 int x, int y, int auto_spacing);
56extern void font_set_colors(int background, int high_intense, int med_intense, int low_intense);
57extern int font_string_width(FontPtr font, const char *out_string, int auto_spacing);
58
59extern void init_font();
60
61} // namespace MADS
62
63#endif
Definition: general.h:57
Definition: font.h:33