Utility/SimpleTextDrawer: Add character spacing offset

This commit is contained in:
Lynix
2020-01-26 16:18:28 +01:00
parent 5dd37ed3d8
commit 11d51872fa
3 changed files with 26 additions and 4 deletions

View File

@@ -206,16 +206,16 @@ namespace Nz
m_previousCharacter = character;
bool whitespace = true;
float advance = 0.f;
float advance = m_characterSpacingOffset;
switch (character)
{
case ' ':
case '\n':
advance = float(sizeInfo.spaceAdvance);
advance += float(sizeInfo.spaceAdvance);
break;
case '\t':
advance = float(sizeInfo.spaceAdvance) * 4.f;
advance += float(sizeInfo.spaceAdvance) * 4.f;
break;
default:
@@ -230,7 +230,7 @@ namespace Nz
if (!GenerateGlyph(glyph, character, 0.f, true, m_color, 0, &iAdvance))
continue; // Glyph failed to load, just skip it (can't do much)
advance = float(iAdvance);
advance += float(iAdvance);
if (m_outlineThickness > 0.f)
{