From 20b493f7905e0a66b3a80d071f52fa3ecad87793 Mon Sep 17 00:00:00 2001 From: Rodolfo Ribeiro Gomes Date: Sun, 29 Sep 2019 12:05:11 -0300 Subject: [PATCH] fix dynamic font crash if no available font size --- scene/resources/dynamic_font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 5704212831f..99a2881d581 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -192,7 +192,7 @@ Error DynamicFontAtSize::_load() { ERR_FAIL_V_MSG(ERR_FILE_CANT_OPEN, "Error loading font."); } - if (FT_HAS_COLOR(face)) { + if (FT_HAS_COLOR(face) && face->num_fixed_sizes > 0) { int best_match = 0; int diff = ABS(id.size - ((int64_t)face->available_sizes[0].width)); scale_color_font = float(id.size) / face->available_sizes[0].width;