39 lines
992 B
C++
39 lines
992 B
C++
#pragma once
|
|
#include "../misc/pixel.h"
|
|
#include "misc/mapped_file.h"
|
|
#include <unordered_map>
|
|
|
|
class renderer_texture_array;
|
|
|
|
class aorii_text {
|
|
public:
|
|
aorii_text();
|
|
|
|
~aorii_text();
|
|
|
|
static bool init_freetype();
|
|
|
|
static void destroy_freetype();
|
|
|
|
// 预缓存一组字符
|
|
bool precache_characters(const std::u32string &characters) {
|
|
return false;
|
|
}
|
|
|
|
// 预缓存常用字符集
|
|
void precache_common_characters() {
|
|
precache_characters(COMMON_ASCII);
|
|
precache_characters(COMMON_PUNCTUATION);
|
|
precache_characters(COMMON_NUMBERS);
|
|
precache_characters(COMMON_CHINESE);
|
|
}
|
|
private:
|
|
renderer_texture_array *texture_array;
|
|
|
|
// 常用字符集定义
|
|
static const std::u32string COMMON_ASCII; // ASCII字符
|
|
static const std::u32string COMMON_PUNCTUATION; // 常用标点符号
|
|
static const std::u32string COMMON_NUMBERS; // 数字
|
|
static const std::u32string COMMON_CHINESE; // 常用汉字
|
|
};
|