summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/text.cpp9
-rw-r--r--src/text.h1
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,
diff --git a/src/text.h b/src/text.h
index d52e4b65..89612050 100644
--- a/src/text.h
+++ b/src/text.h
@@ -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: