speed up monospace fonts

This commit is contained in:
MihailRis 2026-06-10 01:28:23 +03:00
parent 4a11dd28ec
commit 4cc6a83872
4 changed files with 19 additions and 1 deletions

View file

@ -30,6 +30,7 @@ namespace {
public:
FTFontFile(FT_Face face, util::Buffer<ubyte> buffer)
: face(std::move(face)), buffer(std::move(buffer)) {
monospace = this->face->face_flags & FT_FACE_FLAG_FIXED_WIDTH;
}
~FTFontFile() {

View file

@ -19,6 +19,12 @@ namespace vector_fonts {
virtual std::unique_ptr<Texture> renderPage(
int pageid, std::vector<Glyph>& glyphs, int size
) = 0;
bool isMonospace() const {
return monospace;
}
protected:
bool monospace = true;
};
void initialize();