changeset 630:edef2a176c94

On non Windows systems replace the font Courier by the font Monospace. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@889 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Fri, 07 Nov 2008 15:25:03 +0000
parents 22e2378b62e0
children 2788a402c3ac
files src/UiguiHighlighter.cpp
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/UiguiHighlighter.cpp	Mon Nov 03 10:04:38 2008 +0000
+++ b/src/UiguiHighlighter.cpp	Fri Nov 07 15:25:03 2008 +0000
@@ -136,8 +136,13 @@
 void UiguiHighlighter::turnHighlightOff() {
     highlightningIsOn = false;
     qsciEditorParent->setLexer();
+#ifdef Q_OS_WIN
     qsciEditorParent->setFont( QFont("Courier", 10, QFont::Normal) );
     qsciEditorParent->setMarginsFont( QFont("Courier", 10, QFont::Normal) );
+#else
+    qsciEditorParent->setFont( QFont("Monospace", 10, QFont::Normal) );
+    qsciEditorParent->setMarginsFont( QFont("Monospace", 10, QFont::Normal) );
+#endif
 }
 
 
@@ -155,12 +160,6 @@
     fontForStyles.clear();
     colorForStyles.clear();
 
-// Somehow I get crashes when using default libqscintilla2-3 and libqscintilla2-dev packages.
-// Do not know currently where they come from, but to avoid these return here.
-#if ( QSCINTILLA_VERSION < 0x020300 )
-    return false;
-#endif
-
     // Read the styles.
     for (int i = 0; i < 128; ++i)
     {
@@ -199,7 +198,14 @@
         {
             QFont f;
 
+#ifdef Q_OS_WIN
             f.setFamily(fdesc[0]);
+#else
+            if ( fdesc[0].contains("courier", Qt::CaseInsensitive) )
+                f.setFamily("Monospace");
+            else
+                f.setFamily(fdesc[0]);
+#endif
             f.setPointSize(fdesc[1].toInt());
             f.setBold(fdesc[2].toInt());
             f.setItalic(fdesc[3].toInt());