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 FONT_H
23#define FONT_H
24
25#include "common/ptr.h"
26#include "graphics/font.h"
27
28namespace Graphics {
29class ManagedSurface;
30}
31
32namespace AGDS {
33
34class Font : public Graphics::Font {
36 int _glyphW, _glyphH;
37 int _cellW, _cellH;
38 uint8 _width[0x100];
39
40public:
41 Font(Graphics::ManagedSurface *surface, int gw, int gh);
42
43 virtual int getFontHeight() const {
44 return _glyphH;
45 }
46
47 virtual int getMaxCharWidth() const {
48 return _glyphW;
49 }
50
51 virtual int getCharWidth(uint32 chr) const {
52 return chr < 0x100 ? _width[chr] : 0;
53 }
54
55 virtual void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const;
56};
57
58} // End of namespace AGDS
59
60#endif /* AGDS_FONT_H */
Definition: font.h:34
virtual int getCharWidth(uint32 chr) const
Definition: font.h:51
virtual void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const
virtual int getMaxCharWidth() const
Definition: font.h:47
virtual int getFontHeight() const
Definition: font.h:43
Definition: font.h:83
Definition: managed_surface.h:51
Definition: formatinfo.h:28
Definition: surface.h:67