diff options
-rw-r--r-- | graphics/macgui/mactext.cpp | 15 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index fe6cf4ee62..b2ea78474a 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -37,6 +37,15 @@ const Font *MacFontRun::getFont() { return font; } +const Common::String MacFontRun::toString() { + return Common::String::format("\001\015%c%c%c%c%c%c%c%c%c%c%c%c", + (fontId >> 8) & 0xff, fontId & 0xff, + textSlant & 0xff, unk3f & 0xff, + (fontSize >> 8) & 0xff, fontSize & 0xff, + (palinfo1 >> 8) & 0xff, palinfo1 & 0xff, + (palinfo2 >> 8) & 0xff, palinfo2 & 0xff, + (palinfo3 >> 8) & 0xff, palinfo3 & 0xff); +} MacText::~MacText(){ delete _macFont; @@ -370,6 +379,9 @@ void MacText::appendText(Common::String str, int fontId = kMacFontChicago, int f MacFontRun fontRun = MacFontRun(_wm, fontId, fontSlant, 0, fontSize, 0, 0, 0); + _str += fontRun.toString(); + _str += str; + resizeAndFormatLines(newLines, &fontRun); splitString(str); @@ -382,6 +394,9 @@ void MacText::appendTextDefault(Common::String str) { uint oldLen = _textLines.size(); uint newLines = 1 + getNewlinesInString(str); + _str += _defaultFormatting.toString(); + _str += str; + resizeAndFormatLines(newLines, &_defaultFormatting); splitString(str); diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 2f001f782a..1cdb0d3a12 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -71,6 +71,8 @@ struct MacFontRun { } const Font *getFont(); + + const Common::String toString(); }; struct MacTextLine { |