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;
68 virtual ~BaseCachedTTFontText() {
80 _offsetX = _offsetY = 0;
85 persistMgr->transferSint32(TMEMBER(_offsetX));
86 persistMgr->transferSint32(TMEMBER(_offsetY));
87 persistMgr->transferUint32(TMEMBER(_color));
101 int getTextWidth(
const byte *text,
int maxLength = -1)
override;
102 int getTextHeight(
const byte *text,
int width)
override;
103 void drawText(
const byte *text,
int x,
int y,
int width, TTextAlign align = TAL_LEFT,
int max_height = -1,
int maxLength = -1)
override;
104 int getLetterHeight()
override;
106 bool loadBuffer(
char *buffer);
109 float getLineHeight()
const {
113 void afterLoad()
override;
114 void initLoop()
override;
119 void measureText(
const WideString &text,
int maxWidth,
int maxHeight,
int &textWidth,
int &textHeight);
121 BaseSurface *renderTextToTexture(
const WideString &text,
int width, TTextAlign align,
int maxHeight,
int &textOffset);
123 BaseCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
133 size_t _maxCharWidth;
134 size_t _maxCharHeight;
143 TTextCharset _charset;
Definition: base_game.h:76
Definition: base_persistence_manager.h:56
Definition: base_font_truetype.h:42
Definition: base_surface.h:38
Definition: base_font_truetype.h:77
Definition: coll_templ.h:63
Definition: base_font.h:37
Definition: achievements_tables.h:27