From d4f2b3f2b00209a4fbdda9d26ac862159b265bc1 Mon Sep 17 00:00:00 2001 From: Ulf Wiger Date: Sun, 30 Mar 2025 22:15:02 +0200 Subject: [PATCH] Set monospace font --- src/gd_sophia_editor.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gd_sophia_editor.erl b/src/gd_sophia_editor.erl index dff5e3e..99f73a7 100644 --- a/src/gd_sophia_editor.erl +++ b/src/gd_sophia_editor.erl @@ -9,7 +9,18 @@ new(Parent, Id, Opts) -> %% Set up the container lexer wxStyledTextCtrl:setLexer(STC, ?wxSTC_LEX_CONTAINER), - + + FontSize = 13, + Mono = wxFont:new(FontSize, ?wxFONTFAMILY_TELETYPE, ?wxFONTSTYLE_NORMAL, + ?wxFONTWEIGHT_NORMAL, [{face, "Monospace"}]), + lists:foreach( + fun(Style) -> + wxStyledTextCtrl:styleSetFont(STC, Style, Mono) + end, + lists:seq(0, 6) + ), + %% + wxStyledTextCtrl:styleSetFont(STC, ?wxSTC_STYLE_DEFAULT, Mono), %% Define styles set_colors(STC), %% Connect the styling event