ScummVM API documentation
kofont.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 DARKSEED_KOFONT_H
23#define DARKSEED_KOFONT_H
24
25#include "graphics/font.h"
26#include "common/file.h"
27#include "darkseed/gamefont.h"
28
29namespace Darkseed {
30
31class KoFont : public Graphics::Font {
32private:
36 Common::Array<Common::Array<uint8>> _fontDataSetOther;
37
38 GameFont *_gameFont;
39
40public:
41 KoFont();
42 ~KoFont();
43
44 int getFontHeight() const override;
45 int getMaxCharWidth() const override;
46 int getCharWidth(uint32 chr) const override;
47 void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
48
49 static void extractKoIndexComponents(uint32 charIdx, uint16 *param_2, uint16 *param_3, uint16 *param_4);
50 static bool isConsonant(uint32 charIdx);
51 static Common::U32String getObjectString(const Common::U32String &object);
52 static Common::U32String getTopicString(const Common::U32String &object);
53 static Common::U32String getLinkingString(const Common::U32String &object);
54 static Common::U32String getLocationString(const Common::U32String &object);
55private:
56 void loadFontDataSet(Common::Array<Common::Array<uint8>> &dataSet, int size, int packedGlyphSize, Common::File &file);
57 void loadFontGlyph(Common::Array<uint8> &pixels, int packedGlyphSize, Common::File &file);
58
59 void createGlyph(uint8 *pixels, uint32 chr) const;
60 void addToGlyph(uint8 *destPixels, int16 index) const;
61 void addPixels(uint8 *destPixels, const Common::Array<uint8> &pixels) const;
62 int getOtherCharIdx(uint32 chr) const;
63 void drawOtherGlyph(Graphics::Surface *dst, uint8 chr, int x, int y) const;
64};
65
66} // namespace Darkseed
67
68#endif // DARKSEED_KOFONT_H
Definition: array.h:52
Definition: file.h:47
Definition: ustr.h:57
Definition: gamefont.h:31
Definition: kofont.h:31
void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override
int getFontHeight() const override
int getCharWidth(uint32 chr) const override
int getMaxCharWidth() const override
Definition: font.h:83
Definition: surface.h:67