diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2007-09-10 07:46:51 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2007-09-10 07:46:51 +0000 |
commit | ce2b0db3129cc4f3f20c322fd6c727ce663838cc (patch) | |
tree | 90a79ae61c7f231dd9fbd5dcd99c814b2ad3ab05 /src/gui/gui.cpp | |
parent | 6635397f7a397bdd430fc062cc9e8c5bd3efed82 (diff) | |
download | mana-ce2b0db3129cc4f3f20c322fd6c727ce663838cc.tar.gz mana-ce2b0db3129cc4f3f20c322fd6c727ce663838cc.tar.bz2 mana-ce2b0db3129cc4f3f20c322fd6c727ce663838cc.tar.xz mana-ce2b0db3129cc4f3f20c322fd6c727ce663838cc.zip |
Added support for True Type Fonts.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 620dfb0b..dc51054c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -26,14 +26,16 @@ #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" -#include "viewport.h" #include "../configlistener.h" #include "../configuration.h" @@ -104,14 +106,13 @@ Gui::Gui(Graphics *graphics): // Set global font try { - mGuiFont = new gcn::ImageFont("graphics/gui/sansserif8.png", - " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[" - "\\]^_`abcdefghijklmnopqrstuvwxyz{|}~|" - ); + mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 12); } catch (gcn::Exception e) { - logger->error("Unable to load sansserif8.png!"); + logger->log("Unable to load dejavusans.ttf: %s", + e.getMessage().c_str()); + throw; } // Set speech font @@ -124,7 +125,9 @@ Gui::Gui(Graphics *graphics): } catch (gcn::Exception e) { - logger->error("Unable to load rpgfont_wider.png!"); + logger->log("Unable to load rpgfont_wider.png: %s", + e.getMessage().c_str()); + throw; } gcn::Widget::setGlobalFont(mGuiFont); @@ -140,7 +143,8 @@ Gui::Gui(Graphics *graphics): } catch (gcn::Exception e) { - logger->error("Unable to load colored hits' fonts!"); + logger->log("Unable to load colored hits' fonts: %s", e.getMessage().c_str()); + throw; } // Initialize mouse cursor and listen for changes to the option |