<div dir="ltr"><div><div>Greetings,<br><br></div><div>Hopefully I'm using the correct mailing list :)<br><br></div><div>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.<br><br>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 <a href="https://github.com/paralect/robomongo/issues/649">https://github.com/paralect/robomongo/issues/649</a>, which includes a screenshot. The Infinality patches (which I have) appear to be a common denominator, but I'm not sure that's 100%. <br></div><div><br></div><div>There is a repro script below my sig - on my computer running <br><br><div style="margin-left:40px"><span style="font-family:monospace,monospace">python3 demo.py "Courier New"<br></span></div><br></div><div>Shows the issue, but a different monospaced font is fine. For instance, <br><br><div style="margin-left:40px"><span style="font-family:monospace,monospace">python3 demo.py <span class="">"Andale Mono"</span></span><br></div><div style="margin-left:40px"><span class=""></span></div><span class=""><br></span></div><div><span class="">works just fine<br></span></div><div><br></div>Thanks so much for any help you can provide,<br></div>Craig<br><br><br><pre><span class=""><span class="">"""</span></span>
<span class="">demo.py</span>
<span class=""></span>
<span class="">Adapted from qsci_simple_pythoneditor.pyw by Eli Bendersky (<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>)</span>
<span class="">(originally released into the public domain)</span>
<span class=""></span>
<span class="">This code is in the public domain.</span>
<span class=""></span>
<span class="">Tested with Python3 and Qt5 on Debian Testing (Debian 8.0/Jessie)</span>
<span class=""></span>
<span class="">Demonstrates the error:</span>
<span class=""></span>
<span class=""> python3 demo.py</span>
<span class=""> python3 demo.py "Courier New"</span>
<span class=""></span>
<span class="">Works as expected:</span>
<span class=""></span>
<span class=""> python3 demo.py Courier</span>
<span class=""> python3 demo.py "Liberation Mono"</span>
<span class=""> python3 demo.py "Andale Mono"</span>
<span class=""> python3 demo.py Tahoma</span>
<span class=""> python3 demo.py Inconsolata</span>
<span class=""><span class="">"""</span></span>
<span class="">import</span> sys
<span class="">from</span> PyQt5.QtWidgets <span class="">import</span> QApplication
<span class="">from</span> PyQt5.Qsci <span class="">import</span> QsciScintilla, QsciLexerPython
<span class="">from</span> PyQt5.QtGui <span class="">import</span> QFont
<span class="">class</span> <span class="">SimplePythonEditor</span>(<span class="">QsciScintilla</span>):
<span class="">def</span> <span class=""><span class="">__init__</span></span>(<span class="">self</span>, <span class="">parent</span><span class="">=</span><span class="">None</span>):
<span class="">super</span>(SimplePythonEditor, <span class="">self</span>).__init__(parent)
fontFamily <span class="">=</span> sys.argv[<span class="">1</span>] <span class="">if</span> <span class="">len</span>(sys.argv) <span class="">></span> <span class="">1</span> <span class="">else</span> <span class=""><span class="">"</span>Courier New<span class="">"</span></span>
<span class="">print</span>(<span class=""><span class="">"</span>Using font<span class="">"</span></span>, fontFamily)
font <span class="">=</span> QFont(fontFamily, <span class="">10</span>)
font.setFixedPitch(<span class="">True</span>)
lexer <span class="">=</span> QsciLexerPython()
lexer.setFont(font)
<span class="">self</span>.setLexer(lexer)
<span class="">if</span> <span class="">__name__</span> <span class="">==</span> <span class=""><span class="">"</span>__main__<span class="">"</span></span>:
app <span class="">=</span> QApplication(sys.argv)
editor <span class="">=</span> SimplePythonEditor()
editor.show()
editor.setText(<span class="">open</span>(sys.argv[<span class="">0</span>]).read())
app.exec_()</pre><br></div>