From 581206ab0fecbb3afc7afebedac541be51097cf5 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 24 Jan 2009 19:43:26 +0100 Subject: Use standard GUI font also for speech and names The speech bitmap font can't handle unicode, so it has now been replaced by the standard GUI font, drawn with a shadow for chat and with a full outline for names. --- src/gui/gui.cpp | 67 ++++++--------------------------------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 99883151..5314b9ba 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -42,14 +42,14 @@ #include "../resources/resourcemanager.h" // Guichan stuff -Gui *gui; -Viewport *viewport; /**< Viewport on the map. */ -SDLInput *guiInput; +Gui *gui = 0; +Viewport *viewport = 0; /**< Viewport on the map. */ +SDLInput *guiInput = 0; // Fonts used in showing hits -gcn::Font *hitRedFont; -gcn::Font *hitBlueFont; -gcn::Font *hitYellowFont; +gcn::Font *hitRedFont = 0; +gcn::Font *hitBlueFont = 0; +gcn::Font *hitYellowFont = 0; // Font used to display speech and player names gcn::Font *speechFont; @@ -122,60 +122,6 @@ Gui::Gui(Graphics *graphics): + e.getMessage()); } - // Set speech font - try { - speechFont = new gcn::ImageFont("graphics/gui/rpgfont_wider.png", - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßøèÈåÅ" - ); - } - catch (gcn::Exception e) - { - logger->error(std::string("Unable to load rpgfont_wider.png: ") - + e.getMessage()); - } - - // Set npc name font - try { - npcNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-blue.png", - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßøèÈåÅ" - ); - } - catch (gcn::Exception e) - { - logger->error("Unable to load rpgfont_wider-blue.png!"); - } - - // Set monster name font - try { - mobNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-orange.png", - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßøèÈåÅ" - ); - } - catch (gcn::Exception e) - { - logger->error("Unable to load rpgfont_wider-orange.png!"); - } - - // Set GM name font - try { - gmNameFont = new gcn::ImageFont("graphics/gui/rpgfont_wider-green.png", - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßøèÈåÅ" - ); - } - catch (gcn::Exception e) - { - logger->error("Unable to load rpgfont_wider-green.png!"); - } - - gcn::Widget::setGlobalFont(mGuiFont); // Load hits' colourful fonts @@ -219,7 +165,6 @@ Gui::~Gui() mMouseCursors->decRef(); delete mGuiFont; - delete speechFont; delete viewport; delete getTop(); -- cgit v1.2.3-70-g09d2