From da8bfeca5ec68550c49863e8ed4390337a48c0c9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 7 Jan 2020 22:46:24 +0100 Subject: GRAPHICS: FONTS: Improved visuals for generated bold fonts --- graphics/fonts/macfont.cpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'graphics') diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp index e8a52d10b2..a32fac710f 100644 --- a/graphics/fonts/macfont.cpp +++ b/graphics/fonts/macfont.cpp @@ -643,9 +643,6 @@ static void magnifyGray(Surface *src, int *dstGray, int width, int height, float } } -static const bool bdir = true; -static const bool pile = false; - static void makeBold(Surface *src, int *dstGray, MacGlyph *glyph, int height) { glyph->width++; @@ -658,28 +655,11 @@ static void makeBold(Surface *src, int *dstGray, MacGlyph *glyph, int height) { bool center = *srcPtr == 1; bool right = x > glyph->width - 1 ? false : *(srcPtr + 1) == 1; - bool tmp, bold; - - bool res; - - if (bdir) { - /* left shifted image */ - bold = left; - } else { - /* right shifted image */ - bold = right; - } - if (pile) { - /* left edge */ - tmp = left; - res = (!tmp && center) || bold; - } else { - /* right edge */ - tmp = right; - res = (!tmp && bold) || center; - } + bool edge, bold, res; - res = center || left; + bold = center || left; + edge = !center && right; + res = (bold && !edge); *dst = res ? 1 : 0; } -- cgit v1.2.3