summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-12-29 14:02:01 -0700
committerIra Rice <irarice@gmail.com>2008-12-29 14:06:41 -0700
commita5c8eae057746618443c788fcaa04221d8ad7ba4 (patch)
treeab104a2dd1f931730eef50365434b8ac0896ca8b /src/gui/gui.cpp
parent6b680b60af9084767fd50737df763a89ca2c2919 (diff)
downloadmana-client-a5c8eae057746618443c788fcaa04221d8ad7ba4.tar.gz
mana-client-a5c8eae057746618443c788fcaa04221d8ad7ba4.tar.bz2
mana-client-a5c8eae057746618443c788fcaa04221d8ad7ba4.tar.xz
mana-client-a5c8eae057746618443c788fcaa04221d8ad7ba4.zip
Added support for True Type Fonts using GUIChan's inbuilt SDLTrueType
class. NOTE: This commit adds a brand new dependency (SDL_TTF). Make sure to install it, regenerate your config files, reconfigure, and then install before attempting to compile. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 70f82d9d..846a0f44 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -36,6 +36,7 @@
#include "../configuration.h"
#include "../graphics.h"
#include "../log.h"
+#include "../sdltruetypefont.hpp"
#include "../resources/image.h"
#include "../resources/imageset.h"
@@ -110,26 +111,20 @@ Gui::Gui(Graphics *graphics):
Window::setWindowContainer(guiTop);
setTop(guiTop);
- // Set global font (based on ISO-8859-15)
+ // Set global font
try {
- mGuiFont = new gcn::ImageFont("graphics/gui/sansserif8.png",
- " !\"#$%&'()*+,-./"
- "0123456789:;<=>?"
- "@ABCDEFGHIJKLMNO"
- "PQRSTUVWXYZ[\\]^_"
- "`abcdefghijklmno"
- "pqrstuvwxyz{|}~|"
- " ¡¢£¤¥¦§¨©ª«¬­®¯"
- "°±²³´µ¶·¸¹º»¼½¾¿"
- "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ"
- "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß"
- "àáâãäåæçèéêëìíîï"
- "ðñòóôõö÷øùúûüýþÿ"
- );
+ mGuiFont = new gcn::contrib::SDLTrueTypeFont("/usr/local/share/aethyra/data/fonts/dejavusans.ttf", 10);
}
catch (gcn::Exception e)
{
- logger->error("Unable to load sansserif8.png!");
+ try {
+ mGuiFont = new gcn::contrib::SDLTrueTypeFont("data/fonts/dejavusans.ttf", 10);
+ }
+ catch (gcn::Exception e)
+ {
+ logger->error(std::string("Unable to load dejavusans.ttf: ")
+ + e.getMessage());
+ }
}
// Set speech font
@@ -142,7 +137,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());
}
// Set npc name font
@@ -198,7 +194,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