diff --git a/src/display.cpp b/src/display.cpp index 831505da1bb..d2e348809a8 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -1442,13 +1442,24 @@ static void draw_panel(CVideo &video, const theme::panel& panel, std::vector(font_size * get_zoom_factor()); - font::pango_text text_renderer; - text_renderer.set_font_size(font_sz); - text_renderer.set_text(text, false); - text_renderer.set_add_outline(true); - text_renderer.set_foreground_color(color); - - surface text_surf = make_neutral_surface(text_renderer.render()); - - const int x = get_location_x(loc) - text_surf->w / 2 + static_cast(x_in_hex * hex_size()); - const int y = get_location_y(loc) - text_surf->h / 2 + static_cast(y_in_hex * hex_size()); - + surface text_surf = font::get_rendered_text(text, font_sz, color); + surface back_surf = font::get_rendered_text(text, font_sz, font::BLACK_COLOR); + const int x = get_location_x(loc) - text_surf->w/2 + + static_cast(x_in_hex* hex_size()); + const int y = get_location_y(loc) - text_surf->h/2 + + static_cast(y_in_hex* hex_size()); + for (int dy=-1; dy <= 1; ++dy) { + for (int dx=-1; dx <= 1; ++dx) { + if (dx!=0 || dy!=0) { + drawing_buffer_add(layer, loc, x + dx, y + dy, back_surf); + } + } + } drawing_buffer_add(layer, loc, x, y, text_surf); } @@ -2680,16 +2684,10 @@ void display::draw_hex(const map_location& loc) { } if (on_map) { - font::pango_text text_renderer; - text_renderer.set_font_size(font::SIZE_SMALL); - if (draw_coordinates_) { int off_x = xpos + hex_size()/2; int off_y = ypos + hex_size()/2; - - text_renderer.set_text(lexical_cast(loc), false); - surface text = make_neutral_surface(text_renderer.render()); - + surface text = font::get_rendered_text(lexical_cast(loc), font::SIZE_SMALL, font::NORMAL_COLOR); surface bg = create_neutral_surface(text->w, text->h); SDL_Rect bg_rect {0, 0, text->w, text->h}; sdl::fill_surface_rect(bg, &bg_rect, 0xaa000000); @@ -2707,10 +2705,7 @@ void display::draw_hex(const map_location& loc) { if (draw_terrain_codes_ && (game_config::debug || !shrouded(loc))) { int off_x = xpos + hex_size()/2; int off_y = ypos + hex_size()/2; - - text_renderer.set_text(lexical_cast(get_map().get_terrain(loc)), false); - surface text = make_neutral_surface(text_renderer.render()); - + surface text = font::get_rendered_text(lexical_cast(get_map().get_terrain(loc)), font::SIZE_SMALL, font::NORMAL_COLOR); surface bg = create_neutral_surface(text->w, text->h); SDL_Rect bg_rect {0, 0, text->w, text->h}; sdl::fill_surface_rect(bg, &bg_rect, 0xaa000000); @@ -2727,10 +2722,7 @@ void display::draw_hex(const map_location& loc) { if (draw_num_of_bitmaps_) { int off_x = xpos + hex_size()/2; int off_y = ypos + hex_size()/2; - - text_renderer.set_text(lexical_cast(num_images_bg + num_images_fg), false); - surface text = make_neutral_surface(text_renderer.render()); - + surface text = font::get_rendered_text(lexical_cast(num_images_bg + num_images_fg), font::SIZE_SMALL, font::NORMAL_COLOR); surface bg = create_neutral_surface(text->w, text->h); SDL_Rect bg_rect {0, 0, text->w, text->h}; sdl::fill_surface_rect(bg, &bg_rect, 0xaa000000);