diff options
author | volzhs <volzhs@gmail.com> | 2016-05-31 15:06:40 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2016-05-31 15:06:40 +0900 |
commit | c761333ce412c18dc57890305253fd5991bac2c2 (patch) | |
tree | 04fda0f11e95d7d005229b7aaba75b0c371775c4 /tools/editor | |
parent | 4f596e1924386500fa723317c68584e1b22f4b91 (diff) |
Supports to use non-latin characters in script editor
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_fonts.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index ff2267daf1..7ec22a4068 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -66,19 +66,19 @@ static Ref<BitmapFont> make_font(int p_height,int p_ascent, int p_valign, int p_ return font; } - - -#define MAKE_DROID_SANS(m_name,m_size) \ - Ref<DynamicFont> m_name;\ - m_name.instance();\ - m_name->set_size(m_size);\ - m_name->set_font_data(DroidSans);\ +#define MAKE_FALLBACKS(m_name)\ m_name->add_fallback(DroidSansFallback);\ m_name->add_fallback(DroidSansJapanese);\ m_name->add_fallback(DroidSansArabic);\ m_name->add_fallback(DroidSansHebrew);\ m_name->add_fallback(DroidSansThai); +#define MAKE_DROID_SANS(m_name,m_size) \ + Ref<DynamicFont> m_name;\ + m_name.instance();\ + m_name->set_size(m_size);\ + m_name->set_font_data(DroidSans);\ + MAKE_FALLBACKS(m_name); void editor_register_fonts(Ref<Theme> p_theme) { @@ -144,6 +144,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { df_code.instance(); df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))*EDSCALE); df_code->set_font_data(dfmono); + MAKE_FALLBACKS(df_code); p_theme->set_font("source","EditorFonts",df_code); @@ -151,6 +152,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { df_doc_code.instance(); df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))*EDSCALE); df_doc_code->set_font_data(dfmono); + MAKE_FALLBACKS(df_doc_code); p_theme->set_font("doc_source","EditorFonts",df_doc_code); |