From f7970c30a4a2ace45dc98f2d4d0cd3be1114ba65 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 7 Jan 2020 18:53:46 +0100 Subject: GRAPHICS: FONTS: Fix BDF font scaling --- graphics/fonts/bdf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/fonts/bdf.cpp') diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp index 4374c36ff4..d901d1bb8c 100644 --- a/graphics/fonts/bdf.cpp +++ b/graphics/fonts/bdf.cpp @@ -767,17 +767,17 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) { byte b = 0; for (int x = 0; x < box.width; x++) { + b <<= 1; + int sx = (int)((float)x / scale); if (srcd[sx / 8] & (0x80 >> (sx % 8))) b |= 1; - if (!(x % 8) && x) { + if (x % 8 == 7) { *dst++ = b; b = 0; } - - b <<= 1; } if (((box.width - 1) % 8)) { -- cgit v1.2.3