22 #ifndef SCI_GRAPHICS_TEXT32_H 23 #define SCI_GRAPHICS_TEXT32_H 25 #include "sci/engine/state.h" 26 #include "sci/graphics/celobj32.h" 27 #include "sci/graphics/frameout.h" 28 #include "sci/graphics/helpers.h" 33 kTextAlignDefault = -1,
39 enum ScrollDirection {
64 int16 _width, _height;
96 GuiResourceId _fontId;
112 TextAlign _alignment;
119 void drawFrame(
const Common::Rect &rect,
const int16 size,
const uint8 color,
const bool doScaling);
121 void drawChar(
const uint16 charIndex);
122 void drawText(
const uint index, uint length);
129 void drawTextRTL(
const char *text, uint length);
138 uint getLongest(uint *charIndex,
const int16 maxWidth);
144 int16 getTextWidth(
const uint index, uint length)
const;
150 void getTextDimensions(
const uint index, uint length, int16 &width, int16& height)
const;
154 const int16 scriptWidth =
g_sci->_gfxFrameout->getScriptWidth();
155 const int16 scriptHeight =
g_sci->_gfxFrameout->getScriptHeight();
158 mulinc(scaledRect, scaleX, scaleY);
198 reg_t createFontBitmap(int16 width, int16 height,
const Common::Rect &rect,
const Common::String &text,
const uint8 foreColor,
const uint8 backColor,
const uint8 skipColor,
const GuiResourceId fontId, TextAlign alignment,
const int16 borderColor,
bool dimmed,
const bool doScaling,
const bool gc);
208 reg_t createTitledFontBitmap(int16 width, int16 height,
const Common::Rect &textRect,
const Common::String &text,
const uint8 foreColor,
const uint8 backColor,
const uint8 skipColor,
const GuiResourceId fontId,
const TextAlign alignment,
const int16 borderColor,
const Common::String &title,
const uint8 titleForeColor,
const uint8 titleBackColor,
const GuiResourceId titleFontId,
const bool doScaling,
const bool gc);
210 inline int scaleUpWidth(
int value)
const {
211 const int scriptWidth =
g_sci->_gfxFrameout->getScriptWidth();
212 return (value * scriptWidth + _xResolution - 1) /
_xResolution;
215 inline int scaleUpHeight(
int value)
const {
216 const int scriptHeight =
g_sci->_gfxFrameout->getScriptHeight();
217 return (value * scriptHeight + _yResolution - 1) /
_yResolution;
239 void invertRect(
const reg_t bitmap,
const int16 bitmapStride,
const Common::Rect &rect,
const uint8 foreColor,
const uint8 backColor,
const bool doScaling);
245 void setFont(
const GuiResourceId fontId);
255 uint16
getCharWidth(
const uint16 charIndex,
const bool doScaling)
const;
266 int16 getTextWidth(
const Common::String &text,
const uint index,
const uint length);
290 void scrollLine(
const Common::String &textLine,
int numLines, uint8 color, TextAlign align, GuiResourceId fontId, ScrollDirection dir);
292 bool SwitchToFont1001OnKorean(
const char *text);
298 #endif // SCI_GRAPHICS_TEXT32_H reg_t createTitledFontBitmap(int16 width, int16 height, const Common::Rect &textRect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, const Common::String &title, const uint8 titleForeColor, const uint8 titleBackColor, const GuiResourceId titleFontId, const bool doScaling, const bool gc)
static int16 _yResolution
Definition: text32.h:185
int16 getTextCount(const Common::String &text, const uint index, const Common::Rect &textRect, const bool doScaling)
Common::Rect getTextSize(const Common::String &text, const int16 maxWidth, bool doScaling)
Definition: rational.h:40
reg_t _bitmap
Definition: text32.h:173
void scrollLine(const Common::String &textLine, int numLines, uint8 color, TextAlign align, GuiResourceId fontId, ScrollDirection dir)
Definition: celobj32.h:64
int16 getStringWidth(const Common::String &text)
int16 getScaledFontHeight() const
void erase(const Common::Rect &rect, const bool doScaling)
static int16 _xResolution
Definition: text32.h:179
Definition: seg_manager.h:48
GfxFont * _font
Definition: text32.h:193
void setFont(const GuiResourceId fontId)
Definition: vm_types.h:39
uint16 getCharWidth(const uint16 charIndex, const bool doScaling) const
reg_t createFontBitmap(int16 width, int16 height, const Common::Rect &rect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, TextAlign alignment, const int16 borderColor, bool dimmed, const bool doScaling, const bool gc)