Indic Text is broken in Edit Verse window

Hi,

While trying to edit songs in Indic text, the Edit Verse window is displaying the text with a lot of dotted circles (0x25CC). Compare the same text in Notepad in the image below. The Thai Text is (apparently) displayed correctly. Could you please look into this issue?
image

Comments

  • This is the font set by your operating system. You'll notice the font in Notepad is different to OpenLP. Change the display font for your operating system.
  • edited December 2017
    Raoul,
    Thanks for the quick reply :smile:
    Is it really a display font issue. Please see font in other windows of OpenLP. It is broken only in the Edit Verse window. It looks to me like a rendering issue. I downloaded the source code and will try to see if I could throw any further light to it. In the mean time can you please check if the widget/tool that display text on Edit Verse window is any different from the tool you use in other places. Thanks in advance,

  • ...hmm.
    On my linux box Indic text appears correctly. So it's could be a display font issue. 
  • It's not different. We leave the font entirely up to the operating system.
  • edited December 2017

    I tried on another Windows machine and the text is broken there as well (This time the display font is different). So I'm inclined to believe that it's a rendering related issue there's something that can be addressed. OpenLP uses ICU5.x for rendering right? I'm looking into the code and will get back to you if I see anything interesting.
  • OpenLP uses Qt. Qt implements the platform's native rendering.
  • Thank you and I've noticed that OpenLP is using Qt. I never worked on Qt before. But going through the code, I had a feeling that it has to do something with Qt's QPlainTextEdit widget. So I tried making a quick text editor (by adapting an example script I found online) and ran the same from the same venv as openlp's and found that the text is rendered correctly. I couldn't run OpenLP from the source as it was throwing an ImportError: cannot import name 'QtWebKit'. I didn't bother to dig into it to solve that issue.

    Here's the code that I tried,
    import sys
    from PyQt5.QtWidgets import QPlainTextEdit, QApplication, QTextEdit, QWidget, QPushButton, QVBoxLayout
    
    class Notepad(QWidget):
        def __init__(self):
            super(Notepad, self).__init__()
            self.text = QPlainTextEdit(self)
            self.clr_btn = QPushButton('clear')
    
            self.init_ui()
    
        def init_ui(self):
            layout = QVBoxLayout()
            layout.addWidget(self.text)
            layout.addWidget(self.clr_btn)
    
            self.setLayout(layout)
            self.setWindowTitle("QPlainTextEditor")
    
            self.show()
    
    app = QApplication(sys.argv)
    writer = Notepad()
    sys.exit(app.exec_())
    
Sign In or Register to comment.