src/GUIFont.cpp

Go to the documentation of this file.
00001 #include "glwx.h"
00002 
00003 bool GUIFont::build()
00004 {
00005   if(!getName().size())
00006     return Logger::writeErrorLog("Null font path");
00007   
00008   return font.load(getName().c_str());
00009 }
00010 
00011 bool GUIFont::loadXMLSettings(const TiXmlElement *element)
00012 {
00013   if(!XMLArbiter::inspectElementInfo(element, "Font"))
00014     return Logger::writeErrorLog("Need a Font node in the xml file");
00015 
00016   std::string path = element->Attribute("path");
00017 
00018   std::string fontpath = MediaPathManager::lookUpMediaPath(path);
00019 
00020   if(!fontpath.size())
00021     return Logger::writeErrorLog(std::string("Couldn't locate the font path at <") + path + "> even with a look up");
00022 
00023   setName(fontpath);
00024 
00025   return true;
00026 }
00027 
00028 CFont *GUIFont::getFontObject()
00029 {
00030   return &font;
00031 }
00032 
00033 bool  GUIFont::operator ==(const GUIFont &compare)
00034 {
00035   return (name   == compare.getName());  
00036 }
00037 
00038 bool  GUIFont::operator !=(const GUIFont &compare)
00039 {
00040   return !operator ==(compare);  
00041 }
00042 
00043 GUIFont::~GUIFont()
00044 {
00045 
00046 }

Generated on Wed Dec 5 20:32:03 2007 for GLWX by  doxygen 1.5.3