Implement texture atlas for fonts

This commit is contained in:
Dynamitos committed 2026-10-21 21:21:49 +02:00
1 parent 17dc1e4d88
commit 22a90fe07c
14 files changed
+388 -50

No files matched your search

+3 -4
View File
@@ -79,7 +79,7 @@ class Text : public Element {
.level = level,
.element = this,
});
// text: one render quad per shaped glyph, carrying its atlas rect
// text: one quad per shaped glyph, carrying its rect in the font's per-size atlas
if (style.fontFamily != nullptr) {
for (auto& g : glyphs) {
result.add(UIRender{
@@ -90,9 +90,8 @@ class Text : public Element {
.z = style.z,
.level = level,
.element = this,
.isGlyph = true,
.uvOffset = Vector2(0),
.uvSize = Vector2(1),
.uvOffset = g.uvOffset,
.uvSize = g.uvSize,
});
}
}