1
0
forked from mirrors/0ad

Fix blurry text by aligning glyph positions

Text rendering appeared blurry due to subpixel positioning when using
LINEAR filtering. Replaced glyph position calculation with std::ceilf()
to ensure integer-aligned drawing coordinates and crisper text.
This commit is contained in:
trompetin17
2025-05-27 16:47:27 -05:00
parent b772ebc262
commit e024f5c88b
+2 -2
View File
@@ -279,8 +279,8 @@ void CTextRenderer::Render(
for (std::list<SBatchRun>::iterator runit = batch.runs.begin(); runit != batch.runs.end(); ++runit)
{
SBatchRun& run = *runit;
float x{run.x};
float y{run.y};
float x{std::ceil(run.x)};
float y{std::ceil(run.y)};
for (size_t i = 0; i < run.text->size(); ++i)
{
const CFont::GlyphData* g = batch.font->GetGlyph((*run.text)[i]);