Finalized DynamicFont implementation

-DynamicFont uses Freetype by default
-Editor fonts are now scalable thanks to this
-Cleaned up documentation browser and added fonts for this
This commit is contained in:
Juan Linietsky 2016-05-29 11:37:26 -03:00
parent a5777994cb
commit 3e8eb396d7
511 changed files with 3798 additions and 210 deletions

View file

@ -544,7 +544,7 @@ void CodeTextEditor::set_error(const String& p_error) {
}
void CodeTextEditor::_on_settings_change() {
void CodeTextEditor::_update_font() {
// FONTS
String editor_font = EDITOR_DEF("text_editor/font", "");
@ -557,7 +557,12 @@ void CodeTextEditor::_on_settings_change() {
}
}
if(!font_overrode)
text_editor->add_font_override("font",get_font("source","Fonts"));
text_editor->add_font_override("font",get_font("source","EditorFonts"));
}
void CodeTextEditor::_on_settings_change() {
_update_font();
// AUTO BRACE COMPLETION
text_editor->set_auto_brace_completion(
@ -588,6 +593,9 @@ void CodeTextEditor::_notification(int p_what) {
if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED)
_load_theme_settings();
if (p_what==NOTIFICATION_ENTER_TREE) {
_update_font();
}
}
void CodeTextEditor::_bind_methods() {
@ -607,19 +615,6 @@ CodeTextEditor::CodeTextEditor() {
text_editor->set_area_as_parent_rect();
text_editor->set_margin(MARGIN_BOTTOM,20);
String editor_font = EDITOR_DEF("text_editor/font", "");
bool font_overrode = false;
if (editor_font!="") {
Ref<Font> fnt = ResourceLoader::load(editor_font);
if (fnt.is_valid()) {
text_editor->add_font_override("font",fnt);
font_overrode = true;
}
}
if (!font_overrode)
text_editor->add_font_override("font",get_font("source","Fonts"));
text_editor->set_show_line_numbers(true);
text_editor->set_brace_matching(true);
text_editor->set_auto_indent(true);