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 )
131131
132132QFont QgsCodeEditor::getMonospaceFont ()
133133{
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 );
144141 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 );
154145 return font;
155146}
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ void QgsCodeEditorPython::setSciLexerPython()
5252 setWhitespaceVisibility ( QsciScintilla::WsVisibleAfterIndent );
5353
5454 QFont font = getMonospaceFont ();
55- font.setPointSize ( 10 );
5655
5756 QsciLexerPython* pyLexer = new QsciLexerPython ();
5857 pyLexer->setDefaultFont ( font );
You can’t perform that action at this time.
0 commit comments