From e99772f489818c9afbec36fee1b9347d72643fe5 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 30 Dec 2024 19:06:43 +0100 Subject: [PATCH] changed code to use narrow request font (no functional change) --- src/tools.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tools.c b/src/tools.c index 35debe27..7af966c9 100644 --- a/src/tools.c +++ b/src/tools.c @@ -3192,6 +3192,7 @@ static void DrawEnvelopeRequestText(int sx, int sy, char *text) int text_width = line_length * font_width; int sx_offset = border_size; int sy_offset = border_size; + boolean use_narrow_font = FALSE; // force DOOR font inside door area SetFontStatus(GAME_MODE_PSEUDO_DOOR); @@ -3204,11 +3205,7 @@ static void DrawEnvelopeRequestText(int sx, int sy, char *text) char *src_text_ptr, *dst_text_ptr; if (maxWordLengthInRequestString(text) > line_length) - { - font_nr = FONT_REQUEST_NARROW; - font_width = getFontWidth(font_nr); - line_length = max_text_width / font_width; - } + use_narrow_font = TRUE; text_door_style = checked_malloc(2 * strlen(text) + 1); @@ -3233,6 +3230,13 @@ static void DrawEnvelopeRequestText(int sx, int sy, char *text) text_final = text_door_style; } + if (use_narrow_font) + { + font_nr = FONT_REQUEST_NARROW; + font_width = getFontWidth(font_nr); + line_length = max_text_width / font_width; + } + DrawTextBuffer(sx + sx_offset, sy + sy_offset, text_final, font_nr, line_length, -1, max_lines, -1, -1, -1, line_spacing, mask_mode, menu.request.autowrap, menu.request.centered, FALSE); -- 2.34.1