/******************************************************************************
*	File		-	InternalFont.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 "internalFont.h"
#include "internalFontData.h"
#include <utils/logger.h>
#include <fstream>

namespace lunarium
{
	bool GenerateFontFileAt(const char * filename)
	{
		std::ofstream ofs(filename, std::ios_base::binary);

		if (!ofs.is_open())
		{
			Logger::Log(LogCategory::GRAPHICS, LogLevel::WARNING, "Could not generate the default font file at: %s", filename);
			return false;
		}


		ofs.write((const char*)FontData, DataSize);

		ofs.close();
		ofs.clear();

		return true;
	}
}

