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 BLADERUNNER_FONT_H
23#define BLADERUNNER_FONT_H
24
25#include "common/array.h"
26#include "common/str.h"
27
28#include "graphics/font.h"
29
30namespace Graphics {
31struct Surface;
32}
33
34namespace BladeRunner {
35
36class BladeRunnerEngine;
37
38class Font : public Graphics::Font {
39 struct Character {
40 int x;
41 int y;
42 int width;
43 int height;
44 int dataOffset;
45 };
46
47 uint32 _characterCount;
48 int _maxWidth;
49 int _maxHeight;
50 Common::Array<Character> _characters;
51 int _dataSize;
52 uint16 *_data;
53 int _screenWidth;
54 int _screenHeight;
55 int _spacing;
56 bool _useFontColor;
57
58public:
59 ~Font() override;
60
61 static Font* load(BladeRunnerEngine *vm, const Common::String &fileName, int spacing, bool useFontColor);
62
63 int getFontHeight() const override;
64 int getMaxCharWidth() const override;
65 int getCharWidth(uint32 chr) const override;
66 void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
67
68private:
69 Font();
70 void reset();
71 void close();
72 // void drawCharacter(const uint8 character, Graphics::Surface &surface, int x, int y) const;
73};
74
75} // End of namespace BladeRunner
76
77#endif
Definition: bladerunner.h:113
Definition: font.h:38
int getCharWidth(uint32 chr) const override
int getMaxCharWidth() const override
void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override
int getFontHeight() const override
Definition: str.h:59
Definition: font.h:83
Definition: formatinfo.h:28
Definition: surface.h:67