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

@ -15,7 +15,6 @@ namespace gui {
};
struct LabelCache {
ptrdiff_t fontId = 0;
FontMetrics metrics;
std::vector<LineScheme> lines;
@ -24,7 +23,7 @@ namespace gui {
size_t wrapWidth = -1;
int multilineWidth = 0;
void prepare(std::ptrdiff_t fontId, FontMetrics metrics, size_t wrapWidth);
void prepare(const std::shared_ptr<Font>& font, FontMetrics metrics, size_t wrapWidth);
void update(std::wstring_view text, bool multiline, bool wrap);
size_t getTextLineOffset(size_t line) const;