diff options
author | volzhs <volzhs@gmail.com> | 2018-01-08 04:07:47 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2018-01-08 05:12:39 +0900 |
commit | 797147bd4b25744ca75711e16243d053ca38f323 (patch) | |
tree | 5e40afc1538ff6964c70177e9ac017eec7cfbfb2 /editor/code_editor.cpp | |
parent | 8e8240450edc48f4fb379e593a4ef7f54ab656b7 (diff) | |
download | redot-engine-797147bd4b25744ca75711e16243d053ca38f323.tar.gz |
Set source code font with ttf, otf
renamed interface/editor/custom_font to interface/editor/main_font
moved text_editor/theme/font to interface/editor/code_font
renamed interface/editor/font_size to interface/editor/main_font_size
renamed interface/editor/source_code_size to interface/editor/code_font_size
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index feb5bf2a8f..3e079cb3ca 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1034,7 +1034,7 @@ void CodeTextEditor::_reset_zoom() { Ref<DynamicFont> font = text_editor->get_font("font"); // reset source font size to default if (font.is_valid()) { - EditorSettings::get_singleton()->set("interface/editor/source_font_size", 14); + EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14); font->set_size(14); } } @@ -1098,7 +1098,7 @@ bool CodeTextEditor::_add_font_size(int p_delta) { if (font.is_valid()) { int new_size = CLAMP(font->get_size() + p_delta, 8 * EDSCALE, 96 * EDSCALE); if (new_size != font->get_size()) { - EditorSettings::get_singleton()->set("interface/editor/source_font_size", new_size / EDSCALE); + EditorSettings::get_singleton()->set("interface/editor/code_font_size", new_size / EDSCALE); font->set_size(new_size); } @@ -1140,20 +1140,7 @@ void CodeTextEditor::set_error(const String &p_error) { void CodeTextEditor::_update_font() { - // FONTS - String editor_font = EDITOR_DEF("text_editor/theme/font", ""); - bool font_overridden = false; - if (editor_font != "") { - Ref<Font> fnt = ResourceLoader::load(editor_font); - if (fnt.is_valid()) { - text_editor->add_font_override("font", fnt); - font_overridden = true; - } - } - if (!font_overridden) { - - text_editor->add_font_override("font", get_font("source", "EditorFonts")); - } + text_editor->add_font_override("font", get_font("source", "EditorFonts")); } void CodeTextEditor::_on_settings_change() { |