From 3ea6a3ea2fae3f07c045a17da693bc8f7e100c26 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 12 Feb 2018 21:35:02 +0100 Subject: [PATCH] Implement optional full font hinting for scrolling text (banners). --- src/openrct2/drawing/ScrollingText.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 03a3bcd484..2a63c9a3dc 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -1595,8 +1595,17 @@ static void scrolling_text_set_bitmap_for_ttf(utf8 *text, sint32 scroll, uint8 * for (sint32 y = min_vpos; y < max_vpos; y++) { - if (src[y * pitch + x] > 92 || (src[y * pitch + x] != 0 && !use_hinting)) + uint8 src_pixel = src[y * pitch + x]; + if ((!use_hinting && src_pixel != 0) || src_pixel > 140) + { + // Centre of the glyph: use full colour. *dst = colour; + } + else if (use_hinting && src_pixel > fontDesc->hinting_threshold) + { + // Simulate font hinting by shading the background colour instead. + *dst = blendColours(colour, *dst); + } // Jump to next row dst += 64;