FreeType: LCD subpixel

This commit is contained in:
rtw1x1
2026-02-04 12:30:14 +00:00
parent ba514d2e9a
commit 87cfa1540f
4 changed files with 72 additions and 21 deletions

View File

@@ -91,7 +91,7 @@ void CTextBar::GetTextExtent(const char* c_szText, SIZE* p_size)
}
if (FT_Load_Glyph(m_ftFace, glyphIndex, FT_LOAD_DEFAULT) == 0)
totalAdvance += (int)ceilf((float)(m_ftFace->glyph->advance.x) / 64.0f);
totalAdvance += (int)ceilf((float)(m_ftFace->glyph->advance.x) / 64.0f) + 1; // +1px letter spacing
prevIndex = glyphIndex;
}
@@ -174,7 +174,7 @@ void CTextBar::TextOut(int ix, int iy, const char * c_szText)
}
}
penX += (int)ceilf((float)(slot->advance.x) / 64.0f);
penX += (int)ceilf((float)(slot->advance.x) / 64.0f) + 1; // +1px letter spacing
prevIndex = glyphIndex;
}