Beispiel #1
0
def fix_osx_10_9_private_font():
    """Temporary fix for QTBUG-32789."""
    from PyQt5.QtCore import QSysInfo, QT_VERSION
    if sys.platform == "darwin":
        try:
            QFont.insertSubstitution(".Helvetica Neue DeskInterface",
                                     "Helvetica Neue")
            if QSysInfo.MacintoshVersion > QSysInfo.MV_10_8 and \
                            QT_VERSION < 0x40806:
                QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande")
        except AttributeError:
            pass
Beispiel #2
0
def fix_osx_private_font():
    """Temporary fixes for QTBUG-32789 an QTBUG-40833"""
    if sys.platform == "darwin":
        try:
            if QSysInfo.MacintoshVersion > 11 and \
                    QT_VERSION < 0x40807:
                # Fix for Yosemite
                QFont.insertSubstitution(".Helvetica Neue DeskInterface",
                                         "Helvetica Neue")
            if QSysInfo.MacintoshVersion > QSysInfo.MV_10_8 and \
                    QT_VERSION < 0x40806:
                # Fix for Mavericks
                QFont.insertSubstitution(".Lucida Grande UI", "Lucida Grande")
        except AttributeError:
            pass
Beispiel #3
0
import math

cellGridColor = QColor(130, 130, 130)
cellHeaderBaseColor = QColor(230, 230, 230)
cellHeaderLineColor = QColor(220, 220, 220)
cellHeaderHighlightLineColor = QColor(240, 240, 240)
cellSelectionColor = QColor.fromRgbF(.2, .3, .7, .15)

GlyphCellBufferHeight = .2
GlyphCellHeaderHeight = 14

# TODO: consider extracting each platform-specific thing (fonts, shortcuts) in a
# purposed folder
headerFont = QFont()
headerFont.setFamily('Lucida Sans Unicode')
headerFont.insertSubstitution('Lucida Sans Unicode', 'Lucida Grande')
headerFont.insertSubstitution('Lucida Sans Unicode', 'Luxi Sans')
headerFont.setPointSize(8)
voidFont = QFont(headerFont)
voidFont.setPointSize(24)
metrics = QFontMetrics(headerFont)

def proceedWithDeletion(self):
    closeDialog = QMessageBox(QMessageBox.Question, "", "Delete glyphs",
      QMessageBox.Yes | QMessageBox.No, self)
    closeDialog.setInformativeText("Are you sure you want to delete them?")
    closeDialog.setModal(True)
    ret = closeDialog.exec_()
    if ret == QMessageBox.Yes:
        return True
    return False
Beispiel #4
0
import math
import time
import unicodedata

cellGridColor = QColor(130, 130, 130)
cellHeaderBaseColor = QColor(230, 230, 230)
cellHeaderLineColor = QColor(220, 220, 220)
cellHeaderHighlightLineColor = QColor(240, 240, 240)
cellSelectionColor = QColor.fromRgbF(0.2, 0.3, 0.7, 0.15)

GlyphCellBufferHeight = 0.2
GlyphCellHeaderHeight = 14

headerFont = QFont()
headerFont.setFamily("Lucida Sans Unicode")
headerFont.insertSubstitution("Lucida Sans Unicode", "Lucida Grande")
headerFont.insertSubstitution("Lucida Sans Unicode", "Luxi Sans")
headerFont.setPointSize(platformSpecific.headerPointSize)
voidFont = QFont(headerFont)
voidFont.setPointSize(24)
metrics = QFontMetrics(headerFont)

arrowKeys = (Qt.Key_Up, Qt.Key_Down, Qt.Key_Left, Qt.Key_Right)


def proceedWithDeletion(self):
    closeDialog = QMessageBox(QMessageBox.Question, "", "Delete glyphs", QMessageBox.Yes | QMessageBox.No, self)
    closeDialog.setInformativeText("Are you sure you want to delete them?")
    closeDialog.setModal(True)
    ret = closeDialog.exec_()
    if ret == QMessageBox.Yes:
import math
import time
import unicodedata

cellGridColor = QColor(130, 130, 130)
cellHeaderBaseColor = QColor(230, 230, 230)
cellHeaderLineColor = QColor(220, 220, 220)
cellHeaderHighlightLineColor = QColor(240, 240, 240)
cellSelectionColor = QColor.fromRgbF(.2, .3, .7, .15)

GlyphCellBufferHeight = .2
GlyphCellHeaderHeight = 14

headerFont = QFont()
headerFont.setFamily('Lucida Sans Unicode')
headerFont.insertSubstitution('Lucida Sans Unicode', 'Lucida Grande')
headerFont.insertSubstitution('Lucida Sans Unicode', 'Luxi Sans')
headerFont.setPointSize(platformSpecific.headerPointSize)
voidFont = QFont(headerFont)
voidFont.setPointSize(24)
metrics = QFontMetrics(headerFont)

arrowKeys = (Qt.Key_Up, Qt.Key_Down, Qt.Key_Left, Qt.Key_Right)


class GlyphCollectionWidget(QWidget):
    """
    A widget that presents a list of glyphs in cells.
    """
    def __init__(self, parent=None):
        super(GlyphCollectionWidget, self).__init__(parent)