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 #ifndef FREESCAPE_FONT_H
22 #define FREESCAPE_FONT_H
23 
24 #include "common/array.h"
25 #include "common/stream.h"
26 
27 #include "graphics/font.h"
28 #include "graphics/managed_surface.h"
29 
30 namespace Freescape {
31 
32 class Font : public Graphics::Font {
33 public:
34  Font();
36  ~Font() override;
37 
38  void setBackground(uint32 color);
39  void setSecondaryColor(uint32 color);
40  int getFontHeight() const override;
41  int getMaxCharWidth() const override;
42  int getCharWidth(uint32 chr) const override;
43  int getKerningOffset(uint32 left, uint32 right) const override { return _kerningOffset; }
44  void setKernelingOffset(int offset) { _kerningOffset = offset; }
45  void setCharWidth(int width) { _charWidth = width; }
46 
47  void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
48 
49  //const Graphics::ManagedSurface &getImageSurface() const { return _image; }
50 private:
52  uint32 _backgroundColor;
53  uint32 _secondaryColor;
54  int _kerningOffset;
55  int _charWidth;
56 };
57 
58 } // End of namespace Freescape
59 
60 #endif // FREESCAPE_FONT_H
int getKerningOffset(uint32 left, uint32 right) const override
Definition: font.h:43
Definition: font.h:83
Definition: surface.h:67
Definition: area.h:36
Definition: array.h:52
int getFontHeight() const override
void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override
int getCharWidth(uint32 chr) const override
Definition: font.h:32
int getMaxCharWidth() const override