diff options
author | Eugene Sandulenko | 2017-01-30 10:10:22 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-30 10:10:22 +0100 |
commit | 7b24fb0b01b5b32d1e22e83139a9bfbd1bd5e02b (patch) | |
tree | 1d0ad64ae3068b990d9365b3ca2add36bef0b778 /graphics/macgui/mactext.cpp | |
parent | b4a31646ffc543a8294010eae8dc6633d5693d98 (diff) | |
download | scummvm-rg350-7b24fb0b01b5b32d1e22e83139a9bfbd1bd5e02b.tar.gz scummvm-rg350-7b24fb0b01b5b32d1e22e83139a9bfbd1bd5e02b.tar.bz2 scummvm-rg350-7b24fb0b01b5b32d1e22e83139a9bfbd1bd5e02b.zip |
GRAPHICS: Initial work on rich text formatting in MacText
Diffstat (limited to 'graphics/macgui/mactext.cpp')
-rw-r--r-- | graphics/macgui/mactext.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index ae233d5c9e..8d83c19ceb 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -19,12 +19,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "graphics/macgui/macfontmanager.h" #include "graphics/macgui/mactext.h" +#include "graphics/macgui/macwindowmanager.h" #include "graphics/font.h" namespace Graphics { -MacText::MacText(Common::String s, MacWindowManager *wm, const Graphics::Font *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment) { +const Font *MacFontRun::getFont() { + if (font) + return font; + + MacFont macFont = MacFont(fontId, fontSize, textSlant); + + font = wm->_fontMan->getFont(macFont); + + return font; +} + +MacText::MacText(Common::String s, MacWindowManager *wm, const Font *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment) { _str = s; _wm = wm; _font = font; @@ -40,6 +53,9 @@ MacText::MacText(Common::String s, MacWindowManager *wm, const Graphics::Font *f splitString(_str); _fullRefresh = true; + + _defaultFormatting.font = font; + _defaultFormatting.wm = wm; } void MacText::splitString(Common::String &str) { |