From d247b5fa5f7918665890952918c857fe20333b1c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 16 Dec 2020 20:17:16 -0500 Subject: graphics: font: Fix artifacts when scaling fonts. --- chickadee/graphics/font.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chickadee/graphics/font.scm b/chickadee/graphics/font.scm index f41b89a..d022e86 100644 --- a/chickadee/graphics/font.scm +++ b/chickadee/graphics/font.scm @@ -136,8 +136,10 @@ display it at POINT-SIZE. By default, the ASCII character is used." (x-loop (+ column 1)))) (y-loop (+ row 1)))) (let ((spec (list char x y width height left top advance))) - (set! x (+ x width)) - (set! next-y (max next-y (+ y height))) + ;; 1 pixel of padding to avoid artifacts when texture is + ;; scaled up. + (set! x (+ x width 1)) + (set! next-y (max next-y (+ y height 1))) spec)) ;; Render individual glyph bitmaps and compose them into larger ;; images to be used as textures. -- cgit v1.2.3