From 346cfdf13520f2e726dd9312bd9542076cff8ad2 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 24 Sep 2017 01:34:21 +0200 Subject: [PATCH] Account for colour intensity as well as outlined texts. --- src/openrct2/drawing/string.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/openrct2/drawing/string.c b/src/openrct2/drawing/string.c index 9f84374f8e..a66f2dc4f8 100644 --- a/src/openrct2/drawing/string.c +++ b/src/openrct2/drawing/string.c @@ -808,9 +808,19 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo *dpi, const utf8 *text, te else if (*src > 70) { // Simulate font hinting by shading the background colour instead. - // uint8 hinting = floor(*src / 12); - // *dst = *dst - (*dst % 12) + hinting; - *dst = *dst + 2; + if (info->flags & TEXT_DRAW_FLAG_OUTLINE) + { + // As outlines are black, these texts should always use a darker shade + // of the foreground colour for font hinting. + *dst = colour - 4; + } + else + { + // For other texts, hinting direction depends on the intensity of the + // foreground colour. + bool intensive = colour % 12 > 4 && colour % 12 < 10; + *dst += intensive ? 2 : -3; + } } } src++;