22 #ifndef GRAPHICS_MACGUI_MACTEXTCANVAS_H 23 #define GRAPHICS_MACGUI_MACTEXTCANVAS_H 25 #include "graphics/macgui/macwindowmanager.h" 26 #include "graphics/image-archive.h" 48 fontId = textSlant = fontSize = 0;
49 palinfo1 = palinfo2 = palinfo3 = 0;
56 fontId = textSlant = fontSize = 0;
57 palinfo1 = palinfo2 = palinfo3 = 0;
63 uint16 palinfo1_, uint16 palinfo2_, uint16 palinfo3_) {
64 setValues(wm_, fontId_, textSlant_, fontSize_, palinfo1_, palinfo2_, palinfo3_);
68 uint16 palinfo1_, uint16 palinfo2_, uint16 palinfo3_) {
69 setValues(wm_, 0, textSlant_, fontSize_, palinfo1_, palinfo2_, palinfo3_);
73 void setValues(
MacWindowManager *wm_, uint16 fontId_, byte textSlant_, uint16 fontSize_,
74 uint16 palinfo1_, uint16 palinfo2_, uint16 palinfo3_) {
77 textSlant = textSlant_;
82 fgcolor = wm_->findBestColor(palinfo1_ & 0xff, palinfo2_ & 0xff, palinfo3_ & 0xff);
86 const Font *getFont();
91 Common::CodePage getEncoding();
96 return (fontId == y->fontId &&
97 textSlant == y->textSlant &&
98 fontSize == y->fontSize &&
99 palinfo1 == y->palinfo1 &&
100 palinfo2 == y->palinfo2 &&
101 palinfo3 == y->palinfo3 &&
102 fgcolor == y->fgcolor);
115 int _textMaxWidth = 0;
116 int _textMaxHeight = 0;
118 int _interLinear = 0;
121 uint32 _tfgcolor = 0;
122 uint32 _tbgcolor = 0;
123 bool _macFontMode =
true;
132 void reallocSurface();
133 void render(
int from,
int to);
134 void render(
int from,
int to,
int shadow);
135 int getAlignOffset(
int row);
147 int getLineWidth(
int line,
bool enforce =
false,
int col = -1);
148 int getLineHeight(
int line);
149 int getLineCharWidth(
int line,
bool enforce =
false);
152 const Common::U32String::value_type *splitString(
const Common::U32String::value_type *s,
int curLine,
MacFontRun &defaultFormatting);
154 void chopChunk(
const Common::U32String &str,
int *curLinePtr,
int indent,
int maxWidth);
155 Common::U32String getTextChunk(
int startRow,
int startCol,
int endRow,
int endCol,
bool formatted =
false,
bool newlines =
true);
162 void reshuffleParagraph(
int *row,
int *col,
MacFontRun &defaultFormatting);
163 void setMaxWidth(
int maxWidth,
MacFontRun &defaultFormatting);
165 void debugPrint(
const char *prefix =
nullptr);
168 void processTable(
int line,
int maxWidth);
169 void parsePicExt(
const Common::U32String &ext, uint16 &w, uint16 &h,
int defpercent);
183 bool paragraphEnd =
false;
184 bool wordContinuation =
false;
186 int firstLineIndent = 0;
189 uint16 picpercent = 50;
195 MacFontRun &firstChunk() {
return chunks[0]; }
206 uint getChunkNum(
int *col);
Definition: managed_surface.h:51
Definition: mactext-canvas.h:177
TextAlign
Definition: font.h:48
Align the text to the left.
Definition: font.h:51
Definition: mactext-canvas.h:172
Definition: mactext-canvas.h:32
Definition: macwindowmanager.h:148
Definition: mactext-canvas.h:110
Definition: formatinfo.h:28
size_type size() const
Definition: array.h:315
Definition: image-archive.h:38