From 318b5e53aaf2afc6e77ceed826b52a98c382b4c9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 1 Feb 2018 10:34:13 +0100 Subject: [PATCH] FIRE-20818: User-selectable font and size for script editor --- indra/llrender/llfontgl.cpp | 4 ++ indra/newview/app_settings/settings.xml | 22 +++++++++ indra/newview/llpreviewscript.cpp | 8 ++++ .../xui/de/panel_preferences_firestorm.xml | 14 ++++++ .../xui/en/panel_preferences_firestorm.xml | 46 +++++++++++++++++-- 5 files changed, 90 insertions(+), 4 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 76096f3385..1f9a6664e1 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -1135,6 +1135,10 @@ LLFontGL* LLFontGL::getFontByName(const std::string& name) { return getFontScripting(); } + else if (name == "Monospace") + { + return getFontMonospace(); + } // else { diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c34c169fdb..744c1265d3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24532,6 +24532,28 @@ Change of this parameter will affect the layout of buttons in notification toast Value 3 + FSScriptingFontName + + Comment + The name of the font used for the LSL script editor + Persist + 1 + Type + String + Value + Scripting + + FSScriptingFontSize + + Comment + The size of the font used for the LSL script editor + Persist + 1 + Type + String + Value + Scripting + diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index ab6b9635fb..9a88e5c818 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -551,6 +551,14 @@ BOOL LLScriptEdCore::postBuild() mEditor = getChild("Script Editor"); + // FIRE-20818: User-selectable font and size for script editor + LLFontGL* font = LLFontGL::getFont(LLFontDescriptor(gSavedSettings.getString("FSScriptingFontName"), gSavedSettings.getString("FSScriptingFontSize"), LLFontGL::NORMAL)); + if (font) + { + mEditor->setFont(font); + } + // + // NaCl - LSL Preprocessor mCurrentEditor = mEditor; if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor")) diff --git a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml index 2cffcba418..68ac057f7d 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml @@ -199,6 +199,20 @@ + + Script Editor Font: + + + + + + + + + + + + +