[QScintilla] QScintilla and Courier New on Linux with Infinality

Craig Kelly craig.n.kelly at gmail.com
Thu Mar 26 20:58:55 GMT 2015


Greetings,

Hopefully I'm using the correct mailing list :)

I believe I might have found an issue with QScintilla under Qt5 on Linux
systems. When displaying Courier New, the line height appears to be too
low, so the text is being cut off on every line.

I'm seeing it with Gnome on Debian Testing, but others have reported a
similar issue on other distros. I first noticed this as I was one of the
people affected by a product (Robomongo) using QScintilla. You can see
various people having this issue at
https://github.com/paralect/robomongo/issues/649, which includes a
screenshot. The Infinality patches (which I have) appear to be a common
denominator, but I'm not sure that's 100%.

There is a repro script below my sig - on my computer running

python3 demo.py "Courier New"

Shows the issue, but a different monospaced font is fine. For instance,

python3 demo.py "Andale Mono"

works just fine

Thanks so much for any help you can provide,
Craig


"""demo.pyAdapted from qsci_simple_pythoneditor.pyw by Eli Bendersky
(eliben at gmail.com)(originally released into the public domain)This
code is in the public domain.Tested with Python3 and Qt5 on Debian
Testing (Debian 8.0/Jessie)Demonstrates the error:    python3 demo.py
  python3 demo.py "Courier New"Works as expected:    python3 demo.py
Courier    python3 demo.py "Liberation Mono"    python3 demo.py
"Andale Mono"    python3 demo.py Tahoma    python3 demo.py
Inconsolata"""
import sys
from PyQt5.QtWidgets import QApplicationfrom PyQt5.Qsci import
QsciScintilla, QsciLexerPythonfrom PyQt5.QtGui import QFont

class SimplePythonEditor(QsciScintilla):
    def __init__(self, parent=None):
        super(SimplePythonEditor, self).__init__(parent)

        fontFamily = sys.argv[1] if len(sys.argv) > 1 else "Courier New"
        print("Using font", fontFamily)

        font = QFont(fontFamily, 10)
        font.setFixedPitch(True)

        lexer = QsciLexerPython()
        lexer.setFont(font)
        self.setLexer(lexer)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    editor = SimplePythonEditor()
    editor.show()
    editor.setText(open(sys.argv[0]).read())
    app.exec_()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20150326/a7569af0/attachment.html>


More information about the QScintilla mailing list