fix dynamic font crash if no available font size

This commit is contained in:
Rodolfo Ribeiro Gomes 2019-09-29 12:05:11 -03:00
parent 3b532aa7eb
commit 20b493f790

View file

@ -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;