Skip to content

Commit d719fc7

Browse files
committed
Editor font: do not embolden the Main Font if it's variable
1 parent 149a4b4 commit d719fc7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

editor/themes/editor_fonts.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
286286
custom_font->set_fallbacks(fallback_custom);
287287
}
288288
bold_fc->set_base_font(custom_font);
289-
bold_fc->set_variation_embolden(embolden_strength);
289+
if (!custom_font->get_supported_variation_list().has(TS->name_to_tag("wght"))) {
290+
bold_fc->set_variation_embolden(embolden_strength);
291+
}
290292
} else {
291293
EditorSettings::get_singleton()->set_manually("interface/editor/main_font_bold", "");
292294
bold_fc->set_base_font(default_font_bold);
@@ -313,7 +315,9 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
313315
custom_font->set_fallbacks(fallback_custom);
314316
}
315317
bold_fc_msdf->set_base_font(custom_font);
316-
bold_fc_msdf->set_variation_embolden(embolden_strength);
318+
if (!custom_font->get_supported_variation_list().has(TS->name_to_tag("wght"))) {
319+
bold_fc_msdf->set_variation_embolden(embolden_strength);
320+
}
317321
} else {
318322
EditorSettings::get_singleton()->set_manually("interface/editor/main_font_bold", "");
319323
bold_fc_msdf->set_base_font(default_font_bold_msdf);

0 commit comments

Comments
 (0)