25 #include "engines/grim/pool.h" 27 #include "graphics/font.h" 28 #include "graphics/pixelformat.h" 31 class SeekableReadStream;
42 virtual int32 getKernedHeight()
const = 0;
43 virtual int32 getFontWidth()
const = 0;
44 virtual int getKernedStringLength(
const Common::String &text)
const = 0;
45 virtual int32 getBaseOffsetY()
const = 0;
47 virtual int32 getCharKernedWidth(uint32 c)
const = 0;
48 virtual int getPoolId()
const = 0;
49 virtual int32 getPoolTag()
const = 0;
50 virtual bool is8Bit()
const = 0;
54 int32 getWCharKernedWidth(byte hi, byte lo)
const {
return getCharKernedWidth(hi) + getCharKernedWidth(lo); }
55 bool isKoreanChar(
const byte hi,
const byte lo)
const {
return (hi >= 0xB0 && hi <= 0xC8 && lo >= 0xA1 && lo <= 0xFE); }
58 static Font *getFirstFont();
71 static int32 getStaticTag() {
return MKTAG(
'F',
'O',
'N',
'T'); }
72 int getPoolId()
const override {
return getId(); }
73 int32 getPoolTag()
const override {
return getStaticTag(); }
79 int32 getKernedHeight()
const override {
return _kernedHeight; }
80 int32 getFontWidth()
const override {
return getCharKernedWidth(
'w'); }
81 int32 getBaseOffsetY()
const override {
return _baseOffsetY; }
83 int32 getCharBitmapWidth(uint32 c)
const {
return _charHeaders[getCharIndex(c)].bitmapWidth; }
84 int32 getCharBitmapPitch(uint32 c)
const {
return _charHeaders[getCharIndex(c)].bitmapPitch; }
85 int32 getCharBitmapHeight(uint32 c)
const {
return _charHeaders[getCharIndex(c)].bitmapHeight; }
86 int32 getCharKernedWidth(uint32 c)
const override {
return _charHeaders[getCharIndex(c)].kernedWidth; }
87 int32 getCharStartingCol(uint32 c)
const {
return _charHeaders[getCharIndex(c)].startingCol; }
88 int32 getCharStartingLine(uint32 c)
const {
return _charHeaders[getCharIndex(c)].startingLine; }
89 int32 getCharOffset(uint32 c)
const {
return _charHeaders[getCharIndex(c)].offset; }
90 const byte *getCharData(uint32 c)
const {
return _fontData + (_charHeaders[getCharIndex(c)].offset); }
92 const byte *getFontData()
const {
return _fontData; }
93 uint32 getDataSize()
const {
return _dataSize; }
94 bool is8Bit()
const override;
96 int getKernedStringLength(
const Common::String &text)
const override;
100 const void *getUserData()
const {
return _userData; }
101 void setUserData(
void *data) { _userData = data; }
103 void saveState(
SaveGame *state)
const;
106 static const uint8 emerFont[][13];
109 uint16 getCharIndex(uint32 c)
const;
122 uint32 _kernedHeight, _baseOffsetY;
123 uint32 _firstChar, _lastChar;
125 CharHeader *_charHeaders;
128 bool _isDBCS, _isUnicode;
134 void loadTTFFromArchive(
const Common::String &filename,
int size);
136 static int32 getStaticTag() {
return MKTAG(
'T',
'T',
'F',
' '); }
137 int getPoolId()
const override {
return getId(); }
138 int32 getPoolTag()
const override {
return getStaticTag(); }
140 int32 getKernedHeight()
const override {
return _font->getFontHeight(); }
141 int32 getBaseOffsetY()
const override {
return 0; }
142 int32 getCharKernedWidth(uint32 c)
const override {
return _font->getCharWidth(c); }
143 int32 getFontWidth()
const override {
return getCharKernedWidth(
'w'); }
145 int getKernedStringLength(
const Common::String &text)
const override;
147 bool is8Bit()
const override {
return false; }
149 void saveState(
SaveGame *state)
const;
153 int32 getWCharKernedWidth(byte hi, byte lo)
const {
return _font->getCharWidth(Common::convertUHCToUCS(hi, lo)); }
Definition: savegame.h:33
Definition: algorithm.h:29
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188