From e024f5c88bb307691a1029c36b05dc549e66c29f Mon Sep 17 00:00:00 2001 From: trompetin17 Date: Tue, 27 May 2025 16:47:27 -0500 Subject: [PATCH] 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. --- source/graphics/TextRenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/graphics/TextRenderer.cpp b/source/graphics/TextRenderer.cpp index 0eb333db83..d7cbe879f2 100644 --- a/source/graphics/TextRenderer.cpp +++ b/source/graphics/TextRenderer.cpp @@ -279,8 +279,8 @@ void CTextRenderer::Render( for (std::list::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]);