feat: rendering pages on demand

This commit is contained in:
MihailRis 2026-02-16 01:42:48 +03:00
parent 381cb77d08
commit 47809b4024
9 changed files with 106 additions and 39 deletions

View file

@ -2,8 +2,12 @@
#include <memory>
#include <string>
#include <vector>
class Font;
struct Glyph;
class Texture;
namespace vector_fonts {
class FontFile {
@ -11,10 +15,14 @@ namespace vector_fonts {
virtual ~FontFile() {}
virtual std::unique_ptr<Font> createInstance(int size) = 0;
virtual std::unique_ptr<Texture> renderPage(
int pageid, std::vector<Glyph>& glyphs, int size
) = 0;
};
void initialize();
void finalize();
std::unique_ptr<vector_fonts::FontFile> load_font(const std::string& filename);
std::shared_ptr<vector_fonts::FontFile> load_font(const std::string& filename);
}