diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-20 22:17:21 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-20 22:17:21 +0000 |
commit | 7b67e852086ad3ccd98a622f890b245ab6a0a321 (patch) | |
tree | f7341709ff3119209cc69bb114aec5ff95447d8a /src/gui/gui.cpp | |
parent | 9cfafa755012bfd68c661996ddaea76e2e265f81 (diff) | |
download | mana-7b67e852086ad3ccd98a622f890b245ab6a0a321.tar.gz mana-7b67e852086ad3ccd98a622f890b245ab6a0a321.tar.bz2 mana-7b67e852086ad3ccd98a622f890b245ab6a0a321.tar.xz mana-7b67e852086ad3ccd98a622f890b245ab6a0a321.zip |
Added support for unicode charset in textfields and chat.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 97dd4d44..50b891c0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -28,10 +28,8 @@ #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 "sdlinput.h" #include "truetypefont.h" #include "viewport.h" #include "window.h" @@ -48,8 +46,8 @@ // Guichan stuff Gui *gui; -Viewport *viewport; /**< Viewport on the map. */ -gcn::SDLInput *guiInput; /**< GUI input. */ +Viewport *viewport; +SDLInput *guiInput; // Fonts used in showing hits gcn::Font *hitRedFont; @@ -90,12 +88,12 @@ Gui::Gui(Graphics *graphics): gcn::Image::setImageLoader(&imageLoader); // Set input - guiInput = new gcn::SDLInput(); + guiInput = new SDLInput; setInput(guiInput); // Set focus handler delete mFocusHandler; - mFocusHandler = new FocusHandler(); + mFocusHandler = new FocusHandler; // Initialize top GUI widget WindowContainer *guiTop = new WindowContainer(); @@ -117,16 +115,14 @@ Gui::Gui(Graphics *graphics): } // Set speech font - try { - speechFont = new gcn::ImageFont("graphics/gui/rpgfont_wider.png", - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßøèÈåÅ" - ); + try + { + // FIXME: use another font? + speechFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11); } catch (gcn::Exception e) { - logger->log("Unable to load rpgfont_wider.png: %s", + logger->log("Unable to load dejavusans.ttf: %s", e.getMessage().c_str()); throw; } |