From 688918dd3a70182ca71469110978cdaea8ae3d09 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 9 Dec 2021 09:42:30 -0500 Subject: graphics: font: Fix Y-coordinates of bitmap font characters. Fixes a regression introduced in the last release. Oopsies. --- chickadee/graphics/font.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chickadee/graphics/font.scm b/chickadee/graphics/font.scm index a3ed823..c818ff8 100644 --- a/chickadee/graphics/font.scm +++ b/chickadee/graphics/font.scm @@ -385,7 +385,10 @@ extension must be either .xml or .fnt." (width (attr node 'width string->number)) (height (attr node 'height string->number)) (x (attr node 'x string->number)) - (y (attr node 'y string->number)) + ;; Invert the y axis. Our origin is the + ;; bottom-left corner, not top-left. + (y (- image-height height + (attr node 'y string->number))) (x-offset (attr node 'xoffset string->number)) (y-offset (- line-height height (attr node 'yoffset string->number))) -- cgit v1.2.3