Python Forum
[PyQt] PyQT Problems with multiple fonts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] PyQT Problems with multiple fonts
#2
I have worked around the issue for now with an ugly hack

    def removeMultipleFonts(self):
        html = self.editor.document().toHtml()
        htmlTransformed = re.sub(r"(font-family:)('.+'),('.+')", r'\1\3', html)
        self.editor.document().setHtml(htmlTransformed)
Is seems to resolve the issue. I invoke this on changing font and saving the file.
Reply


Messages In This Thread
PyQT Problems with multiple fonts - by DrakeSoft - Feb-10-2023, 02:21 PM
RE: PyQT Problems with multiple fonts - by DrakeSoft - Feb-12-2023, 06:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] proportional fonts DPaul 3 1,467 Aug-18-2022, 05:43 AM
Last Post: DPaul
  [Tkinter] Custom Fonts GalaxyCoyote 1 4,895 Dec-25-2019, 06:56 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020