def fix_osx_10_9_private_font(): # Fix fonts on Os X (QTBUG 47206, 40833, 32789) if sys.platform == "darwin": import platform try: version = platform.mac_ver()[0] version = float(version[:version.rfind(".")]) if version >= 10.11: # El Capitan QFont.insertSubstitution(".SF NS Text", "Helvetica Neue") elif version >= 10.10: # Yosemite QFont.insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue") elif version >= 10.9: QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande") except AttributeError: pass
def fix_osx_10_9_private_font(): # Fix fonts on Os X (QTBUG 47206, 40833, 32789) if sys.platform == "darwin": import platform try: version = platform.mac_ver()[0] version = float(version[:version.rfind(".")]) if version >= 10.11: # El Capitan QFont.insertSubstitution(".SF NS Text", "Helvetica Neue") elif version >= 10.10: # Yosemite QFont.insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue") elif version >= 10.9: QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande") except AttributeError: pass
def fix_osx_private_font(): """Temporary fixes for QTBUG-32789, QTBUG-40833 and QTBUG-47206""" if sys.platform == "darwin" and QT_VERSION < 0x50000: release = platform.mac_ver()[0] if not release: return release = release.split(".")[:2] osx_release = (int(release[0]), int(release[1])) if osx_release >= (10, 11): # El Capitan (or later?) QFont.insertSubstitution(".SF NS Text", "Helvetica Neue") elif osx_release == (10, 10) and QT_VERSION < 0x40807: # Yosemite QFont.insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue") elif osx_release == (10, 9) and QT_VERSION < 0x40806: # Mavericks QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande")