From 9579d49820af61f457f5fbf7097247059f5bd21b Mon Sep 17 00:00:00 2001 From: RedMser Date: Sat, 8 Oct 2022 15:56:21 +0200 Subject: [PATCH] Add warning for missing characters in label font --- scene/gui/label.cpp | 32 ++++++++++++++++++++++++++++++++ scene/gui/label.h | 1 + 2 files changed, 33 insertions(+) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index bf7c59d1cdc..d7d00b674e8 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -288,6 +288,36 @@ void Label::_update_theme_item_cache() { theme_cache.font_shadow_outline_size = get_theme_constant(SNAME("shadow_outline_size")); } +PackedStringArray Label::get_configuration_warnings() const { + PackedStringArray warnings = Control::get_configuration_warnings(); + + // Ensure that the font can render all of the required glyphs. + Ref font; + if (settings.is_valid()) { + font = settings->get_font(); + } + if (font.is_null()) { + font = theme_cache.font; + } + + if (font.is_valid()) { + if (dirty || font_dirty || lines_dirty) { + const_cast