From e3f75109781b720ad5f9d9e4a0ed7688da47055c Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 13 Mar 2022 17:42:20 +0200 Subject: [PATCH] Add simulated bold variant to the editor CJK fonts. --- editor/editor_fonts.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 853278c5fc6..cd9298a1223 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -64,8 +64,8 @@ m_name->add_data(FontTamilBold); \ m_name->add_data(FontTeluguBold); \ m_name->add_data(FontThaiBold); \ - m_name->add_data(FontJapanese); \ - m_name->add_data(FontFallback); + m_name->add_data(FontJapaneseBold); \ + m_name->add_data(FontFallbackBold); #define MAKE_DEFAULT_FONT(m_name, m_variations) \ Ref m_name; \ @@ -268,6 +268,13 @@ void editor_register_fonts(Ref p_theme) { Ref FontFallback = load_cached_internal_font(_font_DroidSansFallback, _font_DroidSansFallback_size, font_hinting, font_antialiased, true, font_subpixel_positioning); Ref FontJapanese = load_cached_internal_font(_font_DroidSansJapanese, _font_DroidSansJapanese_size, font_hinting, font_antialiased, true, font_subpixel_positioning); + const float embolden_strength = 0.6; + + Ref FontFallbackBold = FontFallback->duplicate(); + FontFallbackBold->set_embolden(embolden_strength); + Ref FontJapaneseBold = FontJapanese->duplicate(); + FontJapaneseBold->set_embolden(embolden_strength); + /* Hack */ Ref dfmono = load_cached_internal_font(_font_JetBrainsMono_Regular, _font_JetBrainsMono_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning);