22 #ifndef CRYOMNI3D_FONT_MANAGER_H 23 #define CRYOMNI3D_FONT_MANAGER_H 25 #include "common/array.h" 26 #include "common/path.h" 27 #include "common/str.h" 28 #include "common/str-enc.h" 29 #include "common/ustr.h" 30 #include "common/rect.h" 32 #include "graphics/font.h" 46 void loadTTFList(
const Common::Path &listFile, Common::CodePage codepage);
47 void setCurrentFont(
int currentFont);
48 uint getCurrentFont() {
return _currentFontId; }
49 void setTransparentBackground(
bool transparent) { _transparentBackground = transparent; }
50 void setSpaceWidth(uint additionalSpace);
51 void setForeColor(byte color) { _foreColor = color; }
52 void setLineHeight(
int h) { _lineHeight = h; }
53 int lineHeight() {
return _lineHeight; }
54 void setCharSpacing(uint w) { _charSpacing = w; }
57 int getFontMaxHeight() {
return _currentFont->getFontHeight(); }
59 void displayInt(uint x, uint y,
int value)
const {
63 void displayStr(uint x, uint y,
const Common::String &text)
const { displayStr_(x, y, toU32(text)); }
64 void displayStr(uint x, uint y,
const Common::U32String &text)
const { displayStr_(x, y, text); }
65 uint getStrWidth(
const Common::String &text)
const {
return getStrWidth(toU32(text)); }
68 uint getLinesCount(
const Common::String &text, uint width) {
return getLinesCount(toU32(text), width); }
70 void setupBlock(
const Common::Rect &block,
bool justifyText =
false) {
72 _blockPos.x = block.
left;
73 _blockPos.y = block.top;
74 _justifyText = justifyText;
77 _blockTextStr = toU32(text);
78 return displayBlockText(_blockTextStr, _blockTextStr.begin());
80 bool displayBlockTextContinue() {
return displayBlockText(_blockTextStr, _blockTextRemaining); }
88 bool displayBlockText(
const Common::U32String &text, Common::U32String::const_iterator begin);
89 void calculateWordWrap(
const Common::U32String &text, Common::U32String::const_iterator *position,
92 Common::CodePage _codepage;
97 bool _transparentBackground;
110 Common::U32String::const_iterator _blockTextRemaining;
113 void setupWrapParameters();
114 bool _useSpaceDelimiter;
115 bool _keepASCIIjoined;
Definition: managed_surface.h:51
Definition: cryomni3d.h:62
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
Definition: font_manager.h:40
Definition: formatinfo.h:28
int16 left
Definition: rect.h:145