Merge pull request #32432 from rodolforg/fix_32154-dynamic_font_crashes
fix #32154 dynamic font crash if no available font size
This commit is contained in:
commit
ab28c6b6dd
|
@ -192,7 +192,7 @@ Error DynamicFontAtSize::_load() {
|
||||||
ERR_FAIL_V_MSG(ERR_FILE_CANT_OPEN, "Error loading font.");
|
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 best_match = 0;
|
||||||
int diff = ABS(id.size - ((int64_t)face->available_sizes[0].width));
|
int diff = ABS(id.size - ((int64_t)face->available_sizes[0].width));
|
||||||
scale_color_font = float(id.size) / face->available_sizes[0].width;
|
scale_color_font = float(id.size) / face->available_sizes[0].width;
|
||||||
|
|
Loading…
Reference in a new issue