From f6cef9ea4a34962fab521f9d782c4d812b04a715 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 17 May 2017 15:55:42 +0100 Subject: [PATCH] Don't setFont(Consolas) - it's windows only. Fix monospace for scintilla --- qrenderdoc/Code/ScintillaSyntax.cpp | 1 - qrenderdoc/Windows/PythonShell.cpp | 3 ++- qrenderdoc/Windows/ShaderViewer.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Code/ScintillaSyntax.cpp b/qrenderdoc/Code/ScintillaSyntax.cpp index 81abe23f9..b04c31e23 100644 --- a/qrenderdoc/Code/ScintillaSyntax.cpp +++ b/qrenderdoc/Code/ScintillaSyntax.cpp @@ -242,7 +242,6 @@ void ConfigureSyntax(ScintillaEdit *scintilla, int language) } scintilla->setLexer(language); - scintilla->styleSetFont(STYLE_DEFAULT, "Consolas"); scintilla->styleSetSize(STYLE_DEFAULT, 10); if(language == SCLEX_CPP) diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 43104a138..81d91f5a2 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -45,7 +45,8 @@ PythonShell::PythonShell(ICaptureContext &ctx, QWidget *parent) scriptEditor = new ScintillaEdit(this); - scriptEditor->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); + scriptEditor->styleSetFont( + STYLE_DEFAULT, QFontDatabase::systemFont(QFontDatabase::FixedFont).family().toUtf8().data()); scriptEditor->setMarginLeft(4); scriptEditor->setMarginWidthN(0, 32); diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 2d1d65b92..1dca86eda 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -569,7 +569,8 @@ ScintillaEdit *ShaderViewer::MakeEditor(const QString &name, const QString &text ret->setMarginWidthN(2, 16); ret->setObjectName(name); - ret->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); + ret->styleSetFont(STYLE_DEFAULT, + QFontDatabase::systemFont(QFontDatabase::FixedFont).family().toUtf8().data()); // C# DarkGreen ret->indicSetFore(INDICATOR_REGHIGHLIGHT, SCINTILLA_COLOUR(0, 100, 0));