Commits

Anonymous committed aa6bc84

qtapp: font placement is wrong with OSX 10.9

This fixes an issue with fonts placed to high on Mac OSX 10.9 and QT 4.8.5.
This is a known Qt bug and is fixed in 4.8.6
see https://bugreports.qt-project.org/browse/QTBUG-32789

  • Participants
  • Parent commits 72f2e7a
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/qtapp.py

 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2, incorporated herein by reference.
 
-import gc, os, sys, traceback
+import gc, os, platform, sys, traceback
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import QApplication, QFont
 
         QSettings.setDefaultFormat(QSettings.IniFormat)
 
+        # fixes font placement on OSX 10.9 with QT <= 4.8.5
+        # see QTBUG-32789 (https://bugreports.qt-project.org/browse/QTBUG-32789)
+        if sys.platform == 'darwin' and QT_VERSION <= 0x040805:
+            version, versionInfo, machine = platform.mac_ver()
+            version = '.'.join(version.split('.')[:2])
+            if version == '10.9':
+                QFont.insertSubstitution('.Lucida Grande UI', 'Lucida Grande')
+
         self._ui = ui
         self._mainapp = QApplication(sys.argv)
         self._exccatcher = ExceptionCatcher(ui, self._mainapp, self)