Fix harfbuzz issues by setting QT_HARFBUZZ=old
This commit is contained in:
parent
a0e16ca7db
commit
143dba4461
1
TODO
1
TODO
@ -38,7 +38,6 @@ proper exception handling with saving pages
|
|||||||
Minor features/bugs
|
Minor features/bugs
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Mayhaps set QT_HARFBUZZ=old -- this doesn't seem to be possible the easy way (os.environ)
|
|
||||||
progress bar is often red
|
progress bar is often red
|
||||||
titles are still weird (and not attached to tab obj)
|
titles are still weird (and not attached to tab obj)
|
||||||
Hiding scrollbars
|
Hiding scrollbars
|
||||||
|
@ -6,6 +6,12 @@ import faulthandler
|
|||||||
from signal import signal, SIGINT
|
from signal import signal, SIGINT
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
# This is a really old place to do this, but we have to do this before
|
||||||
|
# importing PyQt or it won't work.
|
||||||
|
# See https://bugreports.qt-project.org/browse/QTBUG-36099
|
||||||
|
import qutebrowser.utils.harfbuzz as harfbuzz
|
||||||
|
harfbuzz.fix()
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
from PyQt5.QtCore import QUrl, QTimer
|
from PyQt5.QtCore import QUrl, QTimer
|
||||||
|
|
||||||
|
22
qutebrowser/utils/harfbuzz.py
Normal file
22
qutebrowser/utils/harfbuzz.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"""Fixer to set QT_HARFBUZZ variable.
|
||||||
|
|
||||||
|
In its own file so it doesn't include any Qt stuff, because if it did, it
|
||||||
|
wouldn't work.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def fix():
|
||||||
|
"""Fix harfbuzz issues.
|
||||||
|
|
||||||
|
This switches to an older (but more stable) harfbuzz font rendering engine
|
||||||
|
instead of using the system wide one.
|
||||||
|
|
||||||
|
This fixes crashes on various sites.
|
||||||
|
See https://bugreports.qt-project.org/browse/QTBUG-36099
|
||||||
|
"""
|
||||||
|
if sys.platform.startswith('linux'):
|
||||||
|
# Switch to old but stable font rendering engine
|
||||||
|
os.environ['QT_HARFBUZZ'] = 'old'
|
Loading…
Reference in New Issue
Block a user