From 43220fde1c6f31b8aae4848ac332e4664332e252 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 21 Jul 2023 06:59:30 +0300 Subject: [PATCH 24/24] sdl2: Unhardcode info label font size Respect changes to base font size. See osdn #48427 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/mapview.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/client/gui-sdl2/mapview.c b/client/gui-sdl2/mapview.c index f190c89b18..d880541896 100644 --- a/client/gui-sdl2/mapview.c +++ b/client/gui-sdl2/mapview.c @@ -395,7 +395,7 @@ void overview_size_changed(void) /**********************************************************************//** Typically an info box is provided to tell the player about the state - of their civilization. This function is called when the label is + of their civilization. This function is called when the label is changed. **************************************************************************/ void update_info_label(void) @@ -414,13 +414,9 @@ void update_info_label(void) return; } -#ifdef GUI_SDL2_SMALL_SCREEN - ptext = create_utf8_str(NULL, 0, 8); -#else - ptext = create_utf8_str(NULL, 0, 10); -#endif + ptext = create_utf8_str_fonto(NULL, 0, FONTO_DEFAULT); - /* set text settings */ + /* Set text settings */ ptext->style |= TTF_STYLE_BOLD; ptext->fgcol = *get_theme_color(COLOR_THEME_MAPVIEW_INFO_TEXT); ptext->bgcol = (SDL_Color) {0, 0, 0, 0}; @@ -446,7 +442,8 @@ void update_info_label(void) client.conn.playing->economic.luxury, client.conn.playing->economic.science); #endif /* GUI_SDL2_SMALL_SCREEN */ - /* convert to utf8_str and create text surface */ + + /* Convert to utf8_str and create text surface */ copy_chars_to_utf8_str(ptext, buffer); tmp = create_text_surf_from_utf8(ptext); @@ -466,7 +463,7 @@ void update_info_label(void) area.y + area.h - 1, get_theme_color(COLOR_THEME_MAPVIEW_INFO_FRAME)); - /* vertical lines */ + /* Vertical lines */ create_line(main_data.gui->surface, area.x + area.w - 1, area.y + 1, area.x + area.w - 1, area.y + area.h - 2, @@ -475,7 +472,7 @@ void update_info_label(void) area.x, area.y + 1, area.x, area.y + area.h - 2, get_theme_color(COLOR_THEME_MAPVIEW_INFO_FRAME)); - /* blit text to screen */ + /* Blit text to screen */ blit_entire_src(tmp, main_data.gui->surface, area.x + adj_size(5), area.y + adj_size(2)); -- 2.40.1