28 #ifndef WINTERMUTE_BASE_FONTTT_H 29 #define WINTERMUTE_BASE_FONTTT_H 31 #include "engines/wintermute/base/font/base_font_storage.h" 32 #include "engines/wintermute/base/font/base_font.h" 33 #include "engines/wintermute/base/gfx/base_surface.h" 34 #include "common/rect.h" 35 #include "graphics/surface.h" 36 #include "graphics/font.h" 38 #define NUM_CACHED_TEXTS 30 45 class BaseCachedTTFontText {
58 BaseCachedTTFontText() : _text() {
60 _width = _maxHeight = _maxLength = -1;
69 virtual ~BaseCachedTTFontText() {
81 _offsetX = _offsetY = 0;
86 persistMgr->transferSint32(TMEMBER(_offsetX));
87 persistMgr->transferSint32(TMEMBER(_offsetY));
88 persistMgr->transferUint32(TMEMBER(_color));
102 int getTextWidth(
const byte *text,
int maxLength = -1)
override;
103 int getTextHeight(
const byte *text,
int width)
override;
104 void drawText(
const byte *text,
int x,
int y,
int width, TTextAlign align = TAL_LEFT,
int max_height = -1,
int maxLength = -1)
override;
105 int getLetterHeight()
override;
107 bool loadBuffer(
char *buffer);
110 void afterLoad()
override;
111 void initLoop()
override;
116 void measureText(
const WideString &text,
int maxWidth,
int maxHeight,
int &textWidth,
int &textHeight);
118 BaseSurface *renderTextToTexture(
const WideString &text,
int width, TTextAlign align,
int maxHeight,
int &textOffset);
120 BaseCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
130 size_t _maxCharWidth;
131 size_t _maxCharHeight;
140 TTextCharset _charset;
Definition: base_game.h:75
Definition: base_persistence_manager.h:55
Definition: base_font_truetype.h:42
Definition: base_surface.h:37
Definition: base_font_truetype.h:78
Definition: coll_templ.h:347
Definition: base_font.h:37
Definition: achievements_tables.h:27