diff --git a/static/panes/ast-view.js b/static/panes/ast-view.js index 92cd947a5..394d0494b 100644 --- a/static/panes/ast-view.js +++ b/static/panes/ast-view.js @@ -184,7 +184,8 @@ Ast.prototype.onSettingsChange = function (newSettings) { contextmenu: newSettings.useCustomContextMenu, minimap: { enabled: newSettings.showMinimap - } + }, + fontFamily: newSettings.editorsFFont }); }; diff --git a/static/panes/compiler.js b/static/panes/compiler.js index a01c73407..cc83e6b19 100644 --- a/static/panes/compiler.js +++ b/static/panes/compiler.js @@ -105,7 +105,7 @@ function Compiler(hub, container, state) { scrollBeyondLastLine: false, readOnly: true, language: 'asm', - fontFamily: 'Consolas, "Liberation Mono", Courier, monospace', + fontFamily: this.settings.editorsFFont, glyphMargin: !options.embedded, fixedOverflowWidgets: true, minimap: { @@ -1295,7 +1295,8 @@ Compiler.prototype.onSettingsChange = function (newSettings) { contextmenu: this.settings.useCustomContextMenu, minimap: { enabled: this.settings.showMinimap && !options.embedded - } + }, + fontFamily: this.settings.editorsFFont }); }; diff --git a/static/panes/diff.js b/static/panes/diff.js index 1771a3ca2..80c82c1b6 100644 --- a/static/panes/diff.js +++ b/static/panes/diff.js @@ -239,7 +239,8 @@ Diff.prototype.onSettingsChange = function (newSettings) { this.outputEditor.updateOptions({ minimap: { enabled: newSettings.showMinimap - } + }, + fontFamily: newSettings.editorsFFont }); }; diff --git a/static/panes/editor.js b/static/panes/editor.js index 825d6b9c2..1005d51df 100644 --- a/static/panes/editor.js +++ b/static/panes/editor.js @@ -88,7 +88,7 @@ function Editor(hub, state, container) { this.editor = monaco.editor.create(root[0], { scrollBeyondLastLine: false, language: this.currentLanguage.monaco, - fontFamily: 'Consolas, "Liberation Mono", Courier, monospace', + fontFamily: this.settings.editorsFFont, readOnly: !!options.readOnly || legacyReadOnly, glyphMargin: !options.embedded, quickSuggestions: false, @@ -538,6 +538,7 @@ Editor.prototype.onSettingsChange = function (newSettings) { minimap: { enabled: this.settings.showMinimap && !options.embedded }, + fontFamily: this.settings.editorsFFont, wordWrap: this.settings.wordWrap ? 'bounded' : 'off', wordWrapColumn: this.editor.getLayoutInfo().viewportColumn // Ensure the column count is up to date }); diff --git a/static/panes/gccdump-view.js b/static/panes/gccdump-view.js index dd0a2ce93..638b7502d 100644 --- a/static/panes/gccdump-view.js +++ b/static/panes/gccdump-view.js @@ -297,7 +297,8 @@ GccDump.prototype.onSettingsChange = function (newSettings) { contextmenu: newSettings.useCustomContextMenu, minimap: { enabled: newSettings.showMinimap - } + }, + fontFamily: newSettings.editorsFFont }); }; diff --git a/static/panes/opt-view.js b/static/panes/opt-view.js index 6ce301bd1..41b1186ef 100644 --- a/static/panes/opt-view.js +++ b/static/panes/opt-view.js @@ -224,7 +224,8 @@ Opt.prototype.onSettingsChange = function (newSettings) { contextmenu: newSettings.useCustomContextMenu, minimap: { enabled: newSettings.showMinimap - } + }, + fontFamily: newSettings.editorsFFont }); }; diff --git a/static/settings.js b/static/settings.js index a8b6cce6c..3c964267d 100644 --- a/static/settings.js +++ b/static/settings.js @@ -78,6 +78,18 @@ Slider.prototype.putUi = function (elem, value) { elem.slider('setValue', value); }; +function Textbox() { +} + +Textbox.prototype.getUi = function (elem) { + return elem.val(); +}; + +Textbox.prototype.putUi = function (elem, value) { + elem.val(value); +}; + + function setupSettings(root, settings, onChange, langId) { settings = settings || {}; // Ensure the default language is not "null" but undefined. Temporary patch for a previous bug :( @@ -206,6 +218,7 @@ function setupSettings(root, settings, onChange, langId) { }) ); add(root.find('.enableCtrlS'), 'enableCtrlS', true, Checkbox); + add(root.find('.editorsFFont'), 'editorsFFont', 'Consolas, "Liberation Mono", Courier, monospace', Textbox); setSettings(settings); handleThemes(); diff --git a/views/popups.pug b/views/popups.pug index 0371ac707..336172497 100644 --- a/views/popups.pug +++ b/views/popups.pug @@ -100,6 +100,10 @@ .card-title h4 Editor .form-group(role="group") + div + label + | Desired Font Family in editors + input.editorsFFont(type="text" style="width:100%") .checkbox label input.autoCloseBrackets(type="checkbox")