Fix harfbuzz issues by setting QT_HARFBUZZ=old

This commit is contained in:
Florian Bruhin 2014-01-30 04:56:16 +01:00
parent a0e16ca7db
commit 143dba4461
3 changed files with 28 additions and 1 deletions

1
TODO
View File

@ -38,7 +38,6 @@ proper exception handling with saving pages
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
titles are still weird (and not attached to tab obj)
Hiding scrollbars

View File

@ -6,6 +6,12 @@ import faulthandler
from signal import signal, SIGINT
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.QtCore import QUrl, QTimer

View 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'