summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2007-09-10 07:46:51 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-29 15:19:33 +0100
commit7cc4dfe0c26fa84e6b9245b6874a853405dea87a (patch)
tree34f71d91195617c11cae132b67ce6f4144ab7be5 /src/gui/gui.cpp
parenteecda4921a72acd30955c14e1fb457c5ac690a2a (diff)
downloadmana-7cc4dfe0c26fa84e6b9245b6874a853405dea87a.tar.gz
mana-7cc4dfe0c26fa84e6b9245b6874a853405dea87a.tar.bz2
mana-7cc4dfe0c26fa84e6b9245b6874a853405dea87a.tar.xz
mana-7cc4dfe0c26fa84e6b9245b6874a853405dea87a.zip
Added support for True Type Fonts.
(cherry-picked from mainline)
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 96415298..a65cb0fb 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -24,11 +24,13 @@
#include <guichan/exception.hpp>
#include <guichan/image.hpp>
#include <guichan/imagefont.hpp>
+#include <SDL/SDL_ttf.h>
// Should stay here because of Guichan being sensitive to headers order
#include <guichan/sdl/sdlinput.hpp>
#include "focushandler.h"
+#include "truetypefont.h"
#include "viewport.h"
#include "window.h"
#include "windowcontainer.h"
@@ -106,24 +108,12 @@ Gui::Gui(Graphics *graphics):
// Set global font (based on ISO-8859-15)
try {
- mGuiFont = new gcn::ImageFont("graphics/gui/sansserif8.png",
- " !\"#$%&'()*+,-./"
- "0123456789:;<=>?"
- "@ABCDEFGHIJKLMNO"
- "PQRSTUVWXYZ[\\]^_"
- "`abcdefghijklmno"
- "pqrstuvwxyz{|}~|"
- " ¡¢£¤¥¦§¨©ª«¬­®¯"
- "°±²³´µ¶·¸¹º»¼½¾¿"
- "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ"
- "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß"
- "àáâãäåæçèéêëìíîï"
- "ðñòóôõö÷øùúûüýþÿ"
- );
+ mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 12);
}
catch (gcn::Exception e)
{
- logger->error("Unable to load sansserif8.png!");
+ logger->error(std::string("Unable to load dejavusans.ttf: ")
+ + e.getMessage());
}
// Set speech font
@@ -136,7 +126,8 @@ Gui::Gui(Graphics *graphics):
}
catch (gcn::Exception e)
{
- logger->error("Unable to load rpgfont_wider.png!");
+ logger->error(std::string("Unable to load rpgfont_wider.png: ")
+ + e.getMessage());
}
gcn::Widget::setGlobalFont(mGuiFont);
@@ -152,7 +143,8 @@ Gui::Gui(Graphics *graphics):
}
catch (gcn::Exception e)
{
- logger->error("Unable to load colored hits' fonts!");
+ logger->error(std::string("Unable to load colored hits' fonts: ")
+ + e.getMessage());
}
// Initialize mouse cursor and listen for changes to the option