Changed font_config to font_loader

Apparently linter doesn't like files with `config` in its name
1008-fix
tomangelo2 2018-07-25 00:44:06 +02:00
parent d84be03a83
commit 3383532752
4 changed files with 20 additions and 20 deletions

View File

@ -106,8 +106,8 @@ set(BASE_SOURCES
common/error.h common/error.h
common/event.cpp common/event.cpp
common/event.h common/event.h
common/font_config.h common/font_loader.h
common/font_config.cpp common/font_loader.cpp
common/global.h common/global.h
common/image.cpp common/image.cpp
common/image.h common/image.h

View File

@ -17,7 +17,7 @@
* along with this program. If not, see http://gnu.org/licenses * along with this program. If not, see http://gnu.org/licenses
*/ */
#include "common/font_config.h" #include "common/font_loader.h"
#include "common/logger.h" #include "common/logger.h"
#include "common/make_unique.h" #include "common/make_unique.h"
@ -64,15 +64,15 @@ const std::map<Gfx::FontType, std::string> FONT_TYPE =
{ Gfx::FONT_SATCOM_ITALIC, "FontSatComItalic" }, { Gfx::FONT_SATCOM_ITALIC, "FontSatComItalic" },
}; };
CFontConfig::CFontConfig() CFontLoader::CFontLoader()
{ {
} }
CFontConfig::~CFontConfig() CFontLoader::~CFontLoader()
{ {
} }
bool CFontConfig::Init() bool CFontLoader::Init()
{ {
try try
{ {
@ -99,17 +99,17 @@ bool CFontConfig::Init()
return true; return true;
} }
std::string CFontConfig::GetFont(Gfx::FontType type) std::string CFontLoader::GetFont(Gfx::FontType type)
{ {
return std::string("/fonts/") + m_propertyTree.get<std::string>(GetFontType(type), GetDefaultFont(type)); return std::string("/fonts/") + m_propertyTree.get<std::string>(GetFontType(type), GetDefaultFont(type));
} }
std::string CFontConfig::GetDefaultFont(Gfx::FontType type) const std::string CFontLoader::GetDefaultFont(Gfx::FontType type) const
{ {
return DEFAULT_FONT.at(type); return DEFAULT_FONT.at(type);
} }
std::string CFontConfig::GetFontType(Gfx::FontType type) const std::string CFontLoader::GetFontType(Gfx::FontType type) const
{ {
return FONT_TYPE.at(type); return FONT_TYPE.at(type);
} }

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file common/font_config.h * \file common/font_loader.h
* \brief Class for loading fonts from /data/fonts/fonts.ini * \brief Class for loading fonts from /data/fonts/fonts.ini
*/ */
@ -33,17 +33,17 @@
#include <string> #include <string>
/** /**
* \class CFontConfig * \class CFontLoader
* *
* \brief Class for loading config file * \brief Class for loading config file
* *
*/ */
class CFontConfig class CFontLoader
{ {
public: public:
CFontConfig(); CFontLoader();
virtual ~CFontConfig(); virtual ~CFontLoader();
/** Loads fonts.ini /** Loads fonts.ini
* \return return true on success * \return return true on success

View File

@ -22,7 +22,7 @@
#include "app/app.h" #include "app/app.h"
#include "common/font_config.h" #include "common/font_loader.h"
#include "common/image.h" #include "common/image.h"
#include "common/logger.h" #include "common/logger.h"
#include "common/stringutils.h" #include "common/stringutils.h"
@ -117,8 +117,8 @@ CText::~CText()
bool CText::Create() bool CText::Create()
{ {
CFontConfig fontConfig; CFontLoader fontLoader;
if (!fontConfig.Init()) if (!fontLoader.Init())
{ {
GetLogger()->Warn("Error on parsing fonts config file: failed to open file\n"); GetLogger()->Warn("Error on parsing fonts config file: failed to open file\n");
} }
@ -130,9 +130,9 @@ bool CText::Create()
for (auto type : {FONT_COMMON, FONT_STUDIO, FONT_SATCOM}) for (auto type : {FONT_COMMON, FONT_STUDIO, FONT_SATCOM})
{ {
m_fonts[static_cast<Gfx::FontType>(type)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(type)); m_fonts[static_cast<Gfx::FontType>(type)] = MakeUnique<MultisizeFont>(fontLoader.GetFont(type));
m_fonts[static_cast<Gfx::FontType>(type|FONT_BOLD)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(static_cast<Gfx::FontType>(type|FONT_BOLD))); m_fonts[static_cast<Gfx::FontType>(type|FONT_BOLD)] = MakeUnique<MultisizeFont>(fontLoader.GetFont(static_cast<Gfx::FontType>(type|FONT_BOLD)));
m_fonts[static_cast<Gfx::FontType>(type|FONT_ITALIC)] = MakeUnique<MultisizeFont>(fontConfig.GetFont(static_cast<Gfx::FontType>(type|FONT_ITALIC))); m_fonts[static_cast<Gfx::FontType>(type|FONT_ITALIC)] = MakeUnique<MultisizeFont>(fontLoader.GetFont(static_cast<Gfx::FontType>(type|FONT_ITALIC)));
} }
for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it) for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it)