diff options
-rw-r--r-- | src/text.cpp | 9 | ||||
-rw-r--r-- | src/text.h | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/text.cpp b/src/text.cpp index 57aaa54f..384a048f 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -42,6 +42,7 @@ Text::Text(const std::string &text, int x, int y, const gcn::Color* color, bool isSpeech) : mText(text), mColor(color), + mFont(gui->getFont()), mIsSpeech(isSpeech) { if (textManager == 0) @@ -69,8 +70,8 @@ Text::Text(const std::string &text, int x, int y, sbImage->decRef(); } ++mInstances; - mHeight = boldFont->getHeight(); - mWidth = boldFont->getWidth(text); + mHeight = mFont->getHeight(); + mWidth = mFont->getWidth(text); switch (alignment) { @@ -121,8 +122,6 @@ void Text::adviseXY(int x, int y) void Text::draw(gcn::Graphics *graphics, int xOff, int yOff) { - graphics->setFont(boldFont); - if (mIsSpeech) { static_cast<Graphics*>(graphics)->drawImageRect( mX - xOff - 5, mY - yOff - 5, mWidth + 10, mHeight + 10, @@ -138,7 +137,7 @@ void Text::draw(gcn::Graphics *graphics, int xOff, int yOff) TextRenderer::renderText(graphics, mText, mX - xOff, mY - yOff, gcn::Graphics::LEFT, - *mColor, boldFont, !mIsSpeech, true); + *mColor, mFont, !mIsSpeech, true); } FlashText::FlashText(const std::string &text, int x, int y, @@ -71,6 +71,7 @@ class Text static int mInstances; /**< Instances of text. */ std::string mText; /**< The text to display. */ const gcn::Color *mColor; /**< The color of the text. */ + gcn::Font *mFont; /**< The font of the text */ bool mIsSpeech; /**< Is this text a speech bubble? */ protected: |