feat: non-monospaced fonts support

This commit is contained in:
MihailRis 2026-02-15 23:48:10 +03:00
parent 93dbf34d15
commit ae54ac9975
8 changed files with 90 additions and 46 deletions

View file

@ -1,11 +1,19 @@
#pragma once
#include <memory>
#include <string>
#include <optional>
class Font;
struct FontMetrics {
std::optional<std::weak_ptr<Font>> font;
int lineHeight;
int yoffset;
int _glyphInterval = 8;
~FontMetrics();
int calcWidth(std::wstring_view text, size_t offset=0, size_t length=-1) const;
};