Moves internal_font functionality into the data_manager
parent
b42b0c69a0
commit
25efe7411d
@ -1,47 +0,0 @@
|
||||
/******************************************************************************
|
||||
* File - Internal_font.h
|
||||
* Author - Joey Pollack
|
||||
* Date - 2020/01/08 (y/m/d)
|
||||
* Mod Date - 2021/09/07 (y/m/d)
|
||||
* Description - Generates a font file (from OpenSans-Regular.ttf)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include "internal_font.h"
|
||||
#include "data_headers/open_font.h"
|
||||
#include "data_headers/roboto_font.h"
|
||||
#include <utils/logger.h>
|
||||
#include <fstream>
|
||||
|
||||
namespace lunarium
|
||||
{
|
||||
bool GenerateFontFileAt(Font font, const char * filename)
|
||||
{
|
||||
std::ofstream ofs(filename, std::ios_base::binary);
|
||||
|
||||
if (!ofs.is_open())
|
||||
{
|
||||
Logger::Warn(LogCategory::GRAPHICS, "Could not generate the default font file at: %s", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
switch (font)
|
||||
{
|
||||
case Font::F_OPEN:
|
||||
ofs.write((const char*)OpenFontData, OpenDataSize);
|
||||
break;
|
||||
|
||||
|
||||
case Font::F_ROBOTO:
|
||||
ofs.write((const char*)RobotoFontData, RobotoDataSize);
|
||||
break;
|
||||
}
|
||||
|
||||
ofs.close();
|
||||
ofs.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
/******************************************************************************
|
||||
* File - internal_font.h
|
||||
* Author - Joey Pollack
|
||||
* Date - 2020/01/08 (y/m/d)
|
||||
* Mod Date - 2020/01/08 (y/m/d)
|
||||
* Description - Generates a font file (from OpenSans-Regular.ttf)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef INTERNAL_FONT_H_
|
||||
#define INTERNAL_FONT_H_
|
||||
|
||||
namespace lunarium
|
||||
{
|
||||
enum Font
|
||||
{
|
||||
F_OPEN,
|
||||
F_ROBOTO,
|
||||
};
|
||||
bool GenerateFontFileAt(Font font, const char* filename);
|
||||
}
|
||||
|
||||
#endif // INTERNAL_FONT_H_
|
||||
Loading…
Reference in New Issue