diff --git a/src/AcDream.App/UI/UiRenderContext.cs b/src/AcDream.App/UI/UiRenderContext.cs index 39727a0d..db23174d 100644 --- a/src/AcDream.App/UI/UiRenderContext.cs +++ b/src/AcDream.App/UI/UiRenderContext.cs @@ -97,8 +97,13 @@ public sealed class UiRenderContext if (!font.TryGetGlyph(text[i], out var g)) continue; - float gx = pen + g.HorizontalOffsetBefore; - float gy = originY + g.VerticalOffsetBefore; + // Pixel-snap each glyph's destination to whole pixels so the atlas samples + // texel-aligned. Without this, a fractional bar width after resize puts the + // centered number on a sub-pixel x and linear filtering smears the glyphs + // (the "unsharp at certain sizes" artifact). The pen keeps its true + // fractional advance, so only the per-glyph dest is snapped. + float gx = System.MathF.Round(pen + g.HorizontalOffsetBefore); + float gy = System.MathF.Round(originY + g.VerticalOffsetBefore); float gw = g.Width; float gh = g.Height;