<commit_before>#if !defined(_FEI_FONTCACHE_H_)
#define _FEI_FONTCACHE_H_

#include "base/basedef.h"
#include "render/Texture.h"
#include "font/Font.h"

namespace fei
{

class FontCache
{
public:
	FontCache();
	~FontCache();

	void loadFont(const char* fontFile, int fontSize = 16);
	void unloadFont();
	void updateCache(const std::vector<unsigned long>& str);
	void updateCache(const char* str);
	void deleteCache();

	int getRemainingSpace();

	const Image queryCharactor(unsigned long c);
	int queryKerning(unsigned long left, unsigned long right);
	int queryAdvance(unsigned long c);

	const Texture getCacheTexture();

private:
	void updateCache(unsigned long* str, int strSize);

	Texture cacheTexture;

	FT_Face face;

	int gridSize;
	int gridNum;
	int curRow;
	int curCol;

	std::map<unsigned long, Image> charImageMap;<commit_msg>virtual ~FontCache<commit_after>#if !defined(_FEI_FONTCACHE_H_)
#define _FEI_FONTCACHE_H_

#include "base/basedef.h"
#include "render/Texture.h"
#include "font/Font.h"

namespace fei
{

class FontCache
{
public:
	FontCache();
	virtual ~FontCache();

	void loadFont(const char* fontFile, int fontSize = 16);
	void unloadFont();
	void updateCache(const std::vector<unsigned long>& str);
	void updateCache(const char* str);
	void deleteCache();

	int getRemainingSpace();

	const Image queryCharactor(unsigned long c);
	int queryKerning(unsigned long left, unsigned long right);
	int queryAdvance(unsigned long c);

	const Texture getCacheTexture();

private:
	void updateCache(unsigned long* str, int strSize);

	Texture cacheTexture;

	FT_Face face;

	int gridSize;
	int gridNum;
	int curRow;
	int curCol;

	std::map<unsigned long, Image> charImageMap;
{'fraction_non_alphanumeric': 0.108348134991119, 'fraction_numerical': 0.002368265245707519, 'mean_word_length': 5.8979591836734695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2851391', 'n_tokens_mistral': 589, 'n_tokens_neox': 569, 'n_words': 163}