diff options
| author | sanikoyes | 2014-04-06 21:52:47 +0800 |
|---|---|---|
| committer | sanikoyes | 2014-04-06 21:52:47 +0800 |
| commit | 77a840e350668a9c80b1e63b9b73aac44221c53b (patch) | |
| tree | 40d2115e639bdc72a61811ac4f2fb0f04ec8eb7f /tools/editor/code_editor.cpp | |
| parent | 14bbdcb139b35e6d206df1ab3176d34245b72329 (diff) | |
| parent | ded365031ede27b7a6efef59bc886343f58d310b (diff) | |
| download | godot-77a840e350668a9c80b1e63b9b73aac44221c53b.tar.gz godot-77a840e350668a9c80b1e63b9b73aac44221c53b.tar.zst godot-77a840e350668a9c80b1e63b9b73aac44221c53b.zip | |
Merge branch 'master' into hotfix-android-unicode-ime-input
Diffstat (limited to 'tools/editor/code_editor.cpp')
| -rw-r--r-- | tools/editor/code_editor.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index ca1e769ff..ea87ac625 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -510,6 +510,20 @@ void CodeTextEditor::set_error(const String& p_error) { } +void CodeTextEditor::_update_font() { + + String editor_font = EditorSettings::get_singleton()->get("text_editor/font"); + if (editor_font!="") { + Ref<Font> fnt = ResourceLoader::load(editor_font); + if (fnt.is_valid()) { + text_editor->add_font_override("font",fnt); + return; + } + } + + text_editor->add_font_override("font",get_font("source","Fonts")); +} + void CodeTextEditor::_text_changed_idle_timeout() { @@ -527,8 +541,9 @@ void CodeTextEditor::_bind_methods() { ObjectTypeDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed); ObjectTypeDB::bind_method("_text_changed",&CodeTextEditor::_text_changed); + ObjectTypeDB::bind_method("_update_font",&CodeTextEditor::_update_font); ObjectTypeDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout); - ObjectTypeDB::bind_method("_complete_request",&CodeTextEditor::_complete_request); + ObjectTypeDB::bind_method("_complete_request",&CodeTextEditor::_complete_request); } CodeTextEditor::CodeTextEditor() { @@ -571,4 +586,5 @@ CodeTextEditor::CodeTextEditor() { text_editor->set_completion(true,cs); idle->connect("timeout", this,"_text_changed_idle_timeout"); + EditorSettings::get_singleton()->connect("settings_changed",this,"_update_font"); } |
