ScummVM API documentation
big5.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 GRAPHICS_BIG5_H
23 #define GRAPHICS_BIG5_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "common/stream.h"
28 #include "graphics/surface.h"
29 
30 namespace Graphics {
31 
32 class Big5Font {
33 public:
34  Big5Font();
35  ~Big5Font();
36  void loadPrefixedRaw(Common::ReadStream &input, int height);
37  bool drawBig5Char(byte *dest, uint16 ch, int maxX, int maxY, uint32 destPitch, byte color, byte outlineColor, bool outline = true, int bpp = 1) const;
38  bool drawBig5Char(Graphics::Surface *surf, uint16 ch, const Common::Point &pt, uint32 color, byte outlineColor = 0, bool outline = false) const;
39  bool hasGlyphForBig5Char(uint16 textChar) const { return (textChar & 0x8000) && _chineseTraditionalIndex[textChar & 0x7fff] >= 0; }
40 
41  int getFontHeight() const { return _chineseTraditionalHeight; }
42 
43  static const int kChineseTraditionalWidth = 16;
44 private:
45  static const int kChineseTraditionalMaxHeight = 16;
46  struct ChineseTraditionalGlyph {
47  byte bitmap[kChineseTraditionalMaxHeight][kChineseTraditionalWidth / 8];
48  byte outline[kChineseTraditionalMaxHeight][kChineseTraditionalWidth / 8];
49 
50  void makeOutline(int height);
51  };
52 
53  template <class T> bool drawReal(byte *dest, uint16 textChar, int maxX, int maxY, uint32 destPitch, byte color, byte outlineColor, bool outline) const;
54 
55  Common::Array<ChineseTraditionalGlyph> _chineseTraditionalFont;
56  Common::Array<int> _chineseTraditionalIndex;
57  int _chineseTraditionalHeight;
58 };
59 
60 }
61 #endif
Definition: big5.h:32
Definition: surface.h:66
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: stream.h:385