mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 16:20:53 +00:00
fix dynamic font crash if no available font size
This commit is contained in:
parent
3b532aa7eb
commit
20b493f790
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user