You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-25 15:37:42 +00:00
Check for valid DynamicFontData before duplicate
(cherry picked from commit ae2bc66eae)
This commit is contained in:
@@ -841,7 +841,9 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c
|
|||||||
sampled_font.instance();
|
sampled_font.instance();
|
||||||
if (res->is_class("DynamicFont")) {
|
if (res->is_class("DynamicFont")) {
|
||||||
Ref<DynamicFont> font = res;
|
Ref<DynamicFont> font = res;
|
||||||
|
if (font->get_font_data().is_valid()) {
|
||||||
sampled_font->set_font_data(font->get_font_data()->duplicate());
|
sampled_font->set_font_data(font->get_font_data()->duplicate());
|
||||||
|
}
|
||||||
for (int i = 0; i < font->get_fallback_count(); i++) {
|
for (int i = 0; i < font->get_fallback_count(); i++) {
|
||||||
sampled_font->add_fallback(font->get_fallback(i)->duplicate());
|
sampled_font->add_fallback(font->get_fallback(i)->duplicate());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user