diff options
author | Angelo Castellani <udp.castellani@gmail.com> | 2011-05-12 01:25:29 -0400 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-05-13 11:06:00 +0200 |
commit | 9641f4c6c24656a73ee759f7c176ba682ae01acf (patch) | |
tree | 27836da80454d51c35c9b16b8e6191e3827406c7 /src/gui/gui.cpp | |
parent | 1d6311a5ffde800ece8d3085fb5fe7c2c9c50a58 (diff) | |
download | mana-9641f4c6c24656a73ee759f7c176ba682ae01acf.tar.gz mana-9641f4c6c24656a73ee759f7c176ba682ae01acf.tar.bz2 mana-9641f4c6c24656a73ee759f7c176ba682ae01acf.tar.xz mana-9641f4c6c24656a73ee759f7c176ba682ae01acf.zip |
Made the setup keyboard tab prettier.
Incidentally I added support for a monospaced font (which may come in handy).
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d1c18ab2..593bed10 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -50,6 +50,9 @@ SDLInput *guiInput = 0; // Bolded font gcn::Font *boldFont = 0; +// Mono font +gcn::Font *monoFont = 0; + class GuiConfigListener : public EventListener { public: @@ -136,6 +139,19 @@ Gui::Gui(Graphics *graphics): std::string("': ") + e.getMessage()); } + // Set mono font + fontFile = branding.getValue("monoFont", "fonts/dejavusans-mono.ttf"); + path = resman->getPath(fontFile); + try + { + monoFont = new TrueTypeFont(path, fontSize); + } + catch (gcn::Exception e) + { + logger->error(std::string("Unable to load '") + fontFile + + std::string("': ") + e.getMessage()); + } + gcn::Widget::setGlobalFont(mGuiFont); // Initialize mouse cursor and listen for changes to the option @@ -153,6 +169,7 @@ Gui::~Gui() delete mGuiFont; delete boldFont; + delete monoFont; delete mInfoParticleFont; delete getTop(); |