From 2de6db84e45c4db51ae693d43bd05aed10db63a6 Mon Sep 17 00:00:00 2001 From: thomasv Date: Tue, 12 Mar 2013 17:37:19 +0100 Subject: [PATCH] monospace font in console --- gui/qt_console.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/qt_console.py b/gui/qt_console.py index ff579f09a..49d4148ad 100644 --- a/gui/qt_console.py +++ b/gui/qt_console.py @@ -1,12 +1,19 @@ # source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget import sys, os, re -import traceback +import traceback, platform from PyQt4 import QtCore from PyQt4 import QtGui from electrum import util +if platform.system() == 'Windows': + MONOSPACE_FONT = 'Lucida Console' +elif platform.system() == 'Darwin': + MONOSPACE_FONT = 'Monaco' +else: + MONOSPACE_FONT = 'monospace' + class Console(QtGui.QPlainTextEdit): def __init__(self, prompt='>> ', startup_message='', parent=None): @@ -20,7 +27,7 @@ class Console(QtGui.QPlainTextEdit): self.setGeometry(50, 75, 600, 400) self.setWordWrapMode(QtGui.QTextOption.WrapAnywhere) self.setUndoRedoEnabled(False) - self.document().setDefaultFont(QtGui.QFont("monospace", 10, QtGui.QFont.Normal)) + self.document().setDefaultFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal)) self.showMessage(startup_message) self.updateNamespace({'run':self.run_script})