mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
feat: non-monospaced fonts support
This commit is contained in:
parent
93dbf34d15
commit
ae54ac9975
8 changed files with 90 additions and 46 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue