ScummVM API documentation
wou_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 NUVIE_FONTS_WOU_FONT_H
23 #define NUVIE_FONTS_WOU_FONT_H
24 
25 #include "ultima/nuvie/fonts/font.h"
26 
27 namespace Ultima {
28 namespace Nuvie {
29 
30 class Configuration;
31 class Screen;
32 class U6Shape;
33 
34 class WOUFont : public Font {
35 private:
36  unsigned char *font_data;
37  unsigned char *char_buf;
38  uint16 height;
39  uint8 pixel_char;
40 
41 public:
42 
43  WOUFont();
44  ~WOUFont() override;
45 
46  bool init(const Common::Path &filename);
47  bool initWithBuffer(unsigned char *buffer, uint32 buffer_len);
48 
49 
50  uint16 drawChar(Screen *screen, uint8 char_num, uint16 x, uint16 y,
51  uint8 color) override;
52 
53  uint16 drawStringToShape(U6Shape *shp, const char *str, uint16 x, uint16 y, uint8 color);
54  uint8 drawCharToShape(U6Shape *shp, uint8 char_num, uint16 x, uint16 y, uint8 color);
55 
56  uint16 getCharWidth(uint8 c) override;
57  uint16 getCharHeight() override {
58  return height;
59  }
60 private:
61  bool initCharBuf();
62 };
63 
64 } // End of namespace Nuvie
65 } // End of namespace Ultima
66 
67 #endif
Definition: path.h:52
Definition: atari-screen.h:60
Definition: screen.h:41
Definition: u6_shape.h:47
Definition: detection.h:27
Definition: wou_font.h:34
Definition: font.h:42