Fix mangled fonts in script editors

Don't override default font letter spacing or stretch -- it's not
safe to do because the results are very dependent on the individual
font's appearance and rendering hints.

Fixes #20349
This commit is contained in:
Nyall Dawson 2018-11-05 08:39:53 +10:00
parent 18d4059546
commit ea9d5bb363
3 changed files with 2 additions and 8 deletions

View File

@ -107,8 +107,6 @@ class SqlEdit(QsciScintilla):
self.defaultFont.setFixedPitch(True)
self.defaultFont.setPointSize(fontSize)
self.defaultFont.setStyleHint(QFont.TypeWriter)
self.defaultFont.setStretch(QFont.SemiCondensed)
self.defaultFont.setLetterSpacing(QFont.PercentageSpacing, 87.0)
self.defaultFont.setBold(False)
self.boldFont = QFont(self.defaultFont)

View File

@ -62,7 +62,7 @@ class ScriptEdit(QsciScintilla):
FOLD_COLOR = "#efefef"
def __init__(self, parent=None):
QsciScintilla.__init__(self, parent)
super().__init__(parent)
self.lexer = None
self.api = None
@ -128,7 +128,7 @@ class ScriptEdit(QsciScintilla):
self.setTabWidth(4)
self.setIndentationGuides(True)
# Autocomletion
# Autocompletion
self.setAutoCompletionThreshold(2)
self.setAutoCompletionSource(QsciScintilla.AcsAPIs)
@ -145,8 +145,6 @@ class ScriptEdit(QsciScintilla):
self.defaultFont.setFixedPitch(True)
self.defaultFont.setPointSize(fontSize)
self.defaultFont.setStyleHint(QFont.TypeWriter)
self.defaultFont.setStretch(QFont.SemiCondensed)
self.defaultFont.setLetterSpacing(QFont.PercentageSpacing, 87.0)
self.defaultFont.setBold(False)
self.boldFont = QFont(self.defaultFont)

View File

@ -178,8 +178,6 @@ QFont QgsCodeEditor::getMonospaceFont()
font.setFixedPitch( true );
font.setPointSize( fontSize );
font.setStyleHint( QFont::TypeWriter );
font.setStretch( QFont::SemiCondensed );
font.setLetterSpacing( QFont::PercentageSpacing, 87.0 );
font.setBold( false );
return font;
}