increasing the advance with every character

This commit is contained in:
devZoGok
2026-05-19 19:41:10 +03:00
parent 02c0c3b3fc
commit e990fb41e5
+3 -2
View File
@@ -98,11 +98,12 @@ namespace vb01{
Glyph glyph = *glyphPtr; Glyph glyph = *glyphPtr;
prepareGlyphs(glyph, glyphTexId, advanceOffset); prepareGlyphs(glyph, glyphTexId, advanceOffset);
Vector2 size = glyph.size, bearing = glyph.bearing; Vector2 size = glyph.size, bearing = glyph.bearing;
int numShifts = 6;
if(horizontal) if(horizontal)
advanceOffset.x += node->getScale().x * (size.x + bearing.x); advanceOffset.x += node->getScale().x * (glyph.advance >> numShifts);
else else
advanceOffset.y += node->getScale().y * size.y; advanceOffset.y += node->getScale().y * (glyph.advance >> numShifts);
} }
} }