File tree Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -131,25 +131,16 @@ bool QgsCodeEditor::isFixedPitch( const QFont& font )
131
131
132
132
QFont QgsCodeEditor::getMonospaceFont ()
133
133
{
134
- QFont font ( " monospace" );
135
- if ( isFixedPitch ( font ) )
136
- {
137
- return font;
138
- }
139
- font.setStyleHint ( QFont::Monospace );
140
- if ( isFixedPitch ( font ) )
141
- {
142
- return font;
143
- }
134
+ QSettings settings;
135
+ QString loadFont = settings.value ( " pythonConsole/fontfamilytextEditor" , " Monospace" ).toString ();
136
+ int fontSize = settings.value ( " pythonConsole/fontsizeEditor" , 10 ).toInt ();
137
+
138
+ QFont font ( loadFont );
139
+ font.setFixedPitch ( true );
140
+ font.setPointSize ( fontSize );
144
141
font.setStyleHint ( QFont::TypeWriter );
145
- if ( isFixedPitch ( font ) )
146
- {
147
- return font;
148
- }
149
- font.setFamily ( " courier" );
150
- if ( isFixedPitch ( font ) )
151
- {
152
- return font;
153
- }
142
+ font.setStretch ( QFont::SemiCondensed );
143
+ font.setLetterSpacing ( QFont::PercentageSpacing, 87.0 );
144
+ font.setBold ( false );
154
145
return font;
155
146
}
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ void QgsCodeEditorPython::setSciLexerPython()
52
52
setWhitespaceVisibility ( QsciScintilla::WsVisibleAfterIndent );
53
53
54
54
QFont font = getMonospaceFont ();
55
- font.setPointSize ( 10 );
56
55
57
56
QsciLexerPython* pyLexer = new QsciLexerPython ();
58
57
pyLexer->setDefaultFont ( font );
You can’t perform that action at this time.
0 commit comments