diff --git a/src/gui/gui_element_types.cpp b/src/gui/gui_element_types.cpp index fdb079744..1a5c5dbaf 100644 --- a/src/gui/gui_element_types.cpp +++ b/src/gui/gui_element_types.cpp @@ -757,30 +757,11 @@ void simple_text_element_base::format_text(sys::state& state) { void simple_text_element_base::on_reset_text(sys::state& state) noexcept { if(base_data.get_element_type() == element_type::button) { black_text = text::is_black_from_font_id(base_data.data.button.font_handle); - cached_text = text::produce_simple_string(state, base_data.data.button.txt); - internal_layout.contents.clear(); - internal_layout.number_of_lines = 0; - - auto al = text::to_text_alignment(base_data.data.button.get_alignment()); - text::single_line_layout sl{ internal_layout, text::layout_parameters{ 0, 0, static_cast(base_data.size.x), static_cast(base_data.size.y), - base_data.data.button.font_handle, 0, al, black_text ? text::text_color::black : text::text_color::white, true, true }, - state.world.locale_get_native_rtl(state.font_collection.get_current_locale()) ? text::layout_base::rtl_status::rtl : text::layout_base::rtl_status::ltr }; - - sl.add_text(state, cached_text); + set_text(state, text::produce_simple_string(state, base_data.data.button.txt)); } else if(base_data.get_element_type() == element_type::text) { black_text = text::is_black_from_font_id(base_data.data.text.font_handle); - cached_text = text::produce_simple_string(state, base_data.data.text.txt); - internal_layout.contents.clear(); - internal_layout.number_of_lines = 0; - - auto al = text::to_text_alignment(base_data.data.text.get_alignment()); - text::single_line_layout sl{ internal_layout, text::layout_parameters{ 0, 0, static_cast(base_data.size.x - base_data.data.text.border_size.x * 2), static_cast(base_data.size.y), - base_data.data.text.font_handle, 0, al, black_text ? text::text_color::black : text::text_color::white, true, true }, - state.world.locale_get_native_rtl(state.font_collection.get_current_locale()) ? text::layout_base::rtl_status::rtl : text::layout_base::rtl_status::ltr }; - - sl.add_text(state, cached_text); + set_text(state, text::produce_simple_string(state, base_data.data.text.txt)); } - format_text(state); } void simple_text_element_base::on_create(sys::state& state) noexcept { on_reset_text(state); diff --git a/src/text/bmfont.cpp b/src/text/bmfont.cpp index a1c9f635a..c25f654d2 100644 --- a/src/text/bmfont.cpp +++ b/src/text/bmfont.cpp @@ -171,6 +171,22 @@ bm_font const& get_bm_font(sys::state& state, uint16_t font_handle) { return std::string("garamond_14"); if(sv == "Main_14_plain") return std::string("garamond_14"); + if(sv == "Main_14_grey") + return std::string("garamond_14_bold"); + if(sv == "Main_14_black") + return std::string("garamond_14_bold"); + if(sv == "Main_14_red") + return std::string("garamond_14_bold"); + if(sv == "Main_14_bold") + return std::string("garamond_14_bold"); + if(sv == "Main_14_orange") + return std::string("garamond_14_bold"); + if(sv == "Main_14_eu") + return std::string("garamond_14"); + if(sv == "tahoma_60") + return std::string("mapfont_56"); + if(sv == "mapfont_56_small") + return std::string("vic_22_bl"); if(sv == "ToolTip_Font") return std::string("garamond_16"); if(sv == "FPS_Font")