Exemple #1
0
    def __init__(self, aux):
        super(TRNewLayerBlend, self).__init__()

        # - Init
        self.aux = aux
        self.process_array = []

        # - Interface
        self.lay_buttons = QtGui.QGridLayout()

        self.chk_setAxis = QtGui.QPushButton('Set Axis')
        self.chk_swapAxis = QtGui.QPushButton('Swap')

        self.chk_setAxis.setCheckable(True)
        self.chk_swapAxis.setCheckable(True)

        self.chk_setAxis.clicked.connect(lambda: self.prepare_lerp())

        # -- Blend active layer to single selected layer
        self.mixer_dx = TRSliderCtrl('1', '1000', '0', 1)
        self.mixer_dx.sld_axis.valueChanged.connect(
            lambda: self.process_lerp())

        self.lay_buttons.addWidget(self.chk_setAxis, 0, 0, 1, 1)
        self.lay_buttons.addWidget(self.chk_swapAxis, 0, 1, 1, 1)

        self.addLayout(self.lay_buttons)
        self.addLayout(self.mixer_dx)
Exemple #2
0
    def __init__(self):
        super(typerig_Manager, self).__init__()

        #self.setStyleSheet(ss_Toolbox_none)

        # - Tabs --------------------------
        # -- Dynamically load all tabs
        self.tabs = TRHTabWidget()

        # --- Load all tabs from this directory as modules. Check __init__.py
        # --- <dirName>.modules tabs/modules manifest in list format
        for toolName in Manager.modules:
            if ignorePanel not in toolName:
                self.tabs.addTab(eval('Manager.%s.tool_tab()' % toolName),
                                 toolName)

        # - Layouts -------------------------------
        layoutV = QtGui.QVBoxLayout()
        layoutV.setContentsMargins(0, 0, 0, 0)

        self.lay_layers = QtGui.QGridLayout()
        self.lay_layers.setContentsMargins(15, 5, 5, 3)

        # -- Build layouts -------------------------------
        layoutV.addWidget(self.tabs)

        # - Set Widget -------------------------------
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s' % (app_name, app_version))
        self.setGeometry(300, 300, 900, 440)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!
        #self.setMinimumWidth(300)
        self.show()
Exemple #3
0
    def __init__(self, parentWidget):
        super(WFontZones, self).__init__()

        # - Init
        self.grid = QtGui.QGridLayout()
        self.upperWidget = parentWidget
        self.activeFont = pFont()
        self.zoneData = {
            master: self.activeFont.zonesToTuples(master)
            for master in self.activeFont.masters()
        }

        # - Interface
        self.btn_apply = QtGui.QPushButton('Apply Changes')
        self.btn_reset = QtGui.QPushButton('Reset')
        self.btn_open = QtGui.QPushButton('Open')
        self.btn_save = QtGui.QPushButton('Save')
        self.btn_new = QtGui.QPushButton('Add New')
        self.btn_del = QtGui.QPushButton('Delete')

        self.cmb_layer = QtGui.QComboBox()
        self.cmb_layer.addItems(['All Layers'] + self.activeFont.masters())

        self.edt_pos = TRZLineEdit()
        self.edt_width = QtGui.QLineEdit()
        self.edt_name = QtGui.QLineEdit()

        self.edt_name.setPlaceholderText('Name')
        self.edt_pos.setPlaceholderText('Position')
        self.edt_width.setPlaceholderText('Width')

        self.btn_apply.clicked.connect(self.applyChanges)
        self.btn_reset.clicked.connect(self.resetChanges)
        self.btn_save.clicked.connect(self.exportZones)
        self.btn_open.clicked.connect(self.importZones)
        self.btn_new.clicked.connect(self.addZone)
        self.btn_del.clicked.connect(self.delZone)

        self.tree_fontZones = WTreeWidget(self.zoneData)

        # - Build
        lbl_name = QtGui.QLabel('Font Zones (Local)')
        lbl_name.setMaximumHeight(20)
        self.grid.addWidget(lbl_name, 0, 0, 1, 24)
        self.grid.addWidget(self.tree_fontZones, 1, 0, 15, 21)

        self.grid.addWidget(self.cmb_layer, 1, 21, 1, 3)
        self.grid.addWidget(self.edt_name, 2, 21, 1, 3)
        self.grid.addWidget(self.edt_pos, 3, 21, 1, 3)
        self.grid.addWidget(self.edt_width, 4, 21, 1, 3)
        self.grid.addWidget(self.btn_new, 5, 21, 1, 3)
        self.grid.addWidget(self.btn_del, 6, 21, 1, 3)

        self.grid.addWidget(self.btn_save, 12, 21, 1, 3)
        self.grid.addWidget(self.btn_open, 13, 21, 1, 3)
        self.grid.addWidget(self.btn_reset, 14, 21, 1, 3)
        self.grid.addWidget(self.btn_apply, 15, 21, 1, 3)
        self.setLayout(self.grid)
Exemple #4
0
	def __init__(self):
		super(dlg_cornerTool, self).__init__()
	
		# - Init
		self.active_font = pFont()
		self.pMode = 0
		
		# - Basic Widgets
		self.cmb_preset = QtGui.QComboBox()
		self.cmb_preset.addItems(presets.keys())

		self.btn_corner_in = QtGui.QPushButton('Inner Corner')
		self.btn_corner_in2 = QtGui.QPushButton('2 node Inner')
		self.btn_corner_revIn = QtGui.QPushButton('Inner Swap')
		self.btn_corner_revIn2 = QtGui.QPushButton('2 node Inner Swap')
		self.btn_corner_getIn = QtGui.QPushButton('Get User Inner')
		self.btn_corner_out = QtGui.QPushButton('Outer Corner')
		self.btn_corner_revOut = QtGui.QPushButton('Outer Swap')
		self.btn_corner_getOut = QtGui.QPushButton('Get User Outer')
		self.btn_setStart = QtGui.QPushButton('Set Start Point')
		self.btn_measure = QtGui.QPushButton('Measure Corner')

		self.btn_corner_in.clicked.connect(lambda: self.in_corner(False))
		self.btn_corner_in2.clicked.connect(lambda: self.out_corner(False, 1))
		self.btn_corner_out.clicked.connect(lambda: self.out_corner(False))
		self.btn_corner_revIn.clicked.connect(lambda: self.in_corner(True))
		self.btn_corner_revIn2.clicked.connect(lambda: self.out_corner(True, 1))
		self.btn_corner_revOut.clicked.connect(lambda: self.out_corner(True))
		self.btn_corner_getOut.clicked.connect(lambda: self.get_measurment(0))
		self.btn_corner_getIn.clicked.connect(lambda: self.get_measurment(1))
		self.btn_measure.clicked.connect(lambda: self.get_measurment(-1))
		self.btn_setStart.clicked.connect(self.set_start)
						
		# - Build layouts 
		layoutV = QtGui.QGridLayout() 
		layoutV.addWidget(QtGui.QLabel('Preset:'),			0, 0, 1, 8, QtCore.Qt.AlignBottom)
		layoutV.addWidget(self.cmb_preset,					1, 0, 1, 8)
		layoutV.addWidget(self.btn_corner_getOut,			2, 0, 1, 4)
		layoutV.addWidget(self.btn_corner_getIn,			2, 4, 1, 4)
		layoutV.addWidget(QtGui.QLabel('Outer Corner:'),	3, 0, 1, 8, QtCore.Qt.AlignBottom)
		layoutV.addWidget(self.btn_corner_out,				4, 0, 1, 4)
		layoutV.addWidget(self.btn_corner_revOut,			4, 4, 1, 4)
		layoutV.addWidget(QtGui.QLabel('Inner Corner:'),	6, 0, 1, 8, QtCore.Qt.AlignBottom)
		layoutV.addWidget(self.btn_corner_in,				7, 0, 1, 4)
		layoutV.addWidget(self.btn_corner_revIn,			7, 4, 1, 4)
		layoutV.addWidget(self.btn_corner_in2,				8, 0, 1, 4)
		layoutV.addWidget(self.btn_corner_revIn2,			8, 4, 1, 4)
		layoutV.addWidget(QtGui.QLabel('Utils:'),			9, 0, 1, 8, QtCore.Qt.AlignBottom)
		layoutV.addWidget(self.btn_setStart,				10, 0, 1, 4)
		layoutV.addWidget(self.btn_measure,					10, 4, 1, 4)

		# - Set Widget
		self.setLayout(layoutV)
		self.setWindowTitle('%s %s' %(app_name, app_version))
		self.setGeometry(300, 300, 300, 200)
		self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!!
		self.show()
Exemple #5
0
    def __init__(self, parent, mode):
        super(dlg_LayerSelect, self).__init__()

        # - Init
        self.parent_widget = parent

        # - Basic Widgets
        self.tab_masters = TRTableView(table_dict)
        self.table_populate(mode)
        self.tab_masters.cellChanged.connect(
            lambda: self.parent_widget.layers_refresh())

        # -- Buttons
        self.btn_tableCheck = QtGui.QPushButton('Select All')
        self.btn_tableCheckMasters = QtGui.QPushButton('Masters')
        self.btn_tableCheckMasks = QtGui.QPushButton('Masks')
        self.btn_tableCheckServices = QtGui.QPushButton('Services')

        self.btn_tableCheck.setToolTip(
            'Click check all.\n<ALT> + Click uncheck all.')
        self.btn_tableCheckMasters.setToolTip(
            'Click check all.\n<ALT> + Click uncheck all.')
        self.btn_tableCheckMasks.setToolTip(
            'Click check all.\n<ALT> + Click uncheck all.')
        self.btn_tableCheckServices.setToolTip(
            'Click check all.\n<ALT> + Click uncheck all.')

        if mode != 0:
            self.btn_tableCheckMasters.setEnabled(False)
            self.btn_tableCheckMasks.setEnabled(False)
            self.btn_tableCheckServices.setEnabled(False)

        self.btn_tableCheck.clicked.connect(lambda: self.table_check_all())
        self.btn_tableCheckMasters.clicked.connect(
            lambda: self.table_check_all('Master'))
        self.btn_tableCheckMasks.clicked.connect(
            lambda: self.table_check_all('Mask'))
        self.btn_tableCheckServices.clicked.connect(
            lambda: self.table_check_all('Service'))

        # - Build layout
        layoutV = QtGui.QGridLayout()
        layoutV.addWidget(self.btn_tableCheck, 0, 0, 1, 2)
        layoutV.addWidget(self.btn_tableCheckMasters, 0, 2, 1, 2)
        layoutV.addWidget(self.btn_tableCheckMasks, 1, 0, 1, 2)
        layoutV.addWidget(self.btn_tableCheckServices, 1, 2, 1, 2)
        layoutV.addWidget(self.tab_masters, 2, 0, 20, 4)

        # - Set Widget
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s | Select Layers' % (app_name, app_version))
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!
        self.setGeometry(500, 200, 300, 600)
Exemple #6
0
    def __init__(self):
        super(TRContourSelect, self).__init__()

        # -- Init
        self.table_dict = {0: {0: None}}  # Empty table
        self.layer_names = []  # Empty layer list
        #self.table_columns = 'N,Shape,Contour,X,Y,Type,Relative'.split(',')
        self.table_columns = 'N,Sh,Cn,X,Y,Type,Rel'.split(',')

        # -- Widgets
        self.lay_head = QtGui.QGridLayout()

        self.edt_glyphName = QtGui.QLineEdit()
        self.cmb_layer = QtGui.QComboBox()

        self.btn_refresh = QtGui.QPushButton('&Refresh')
        self.btn_apply = QtGui.QPushButton('&Apply')
        self.btn_apply.setEnabled(False)

        # -- Build Layout
        self.lay_head.addWidget(QtGui.QLabel('G:'), 0, 0, 1, 1)
        self.lay_head.addWidget(self.edt_glyphName, 0, 1, 1, 5)
        self.lay_head.addWidget(self.btn_refresh, 0, 6, 1, 2)
        self.lay_head.addWidget(QtGui.QLabel('L:'), 1, 0, 1, 1)
        self.lay_head.addWidget(self.cmb_layer, 1, 1, 1, 5)
        self.lay_head.addWidget(self.btn_apply, 1, 6, 1, 2)
        self.addLayout(self.lay_head)

        # -- Node List Table
        self.tab_nodes = TRTableView(self.table_dict)

        self.addWidget(self.tab_nodes)
        #self.refresh() # Build Table

        self.btn_refresh.clicked.connect(lambda: self.refresh())
        self.cmb_layer.currentIndexChanged.connect(lambda: self.changeLayer())

        # -- Table Styling
        self.tab_nodes.horizontalHeader().setStretchLastSection(False)
        self.tab_nodes.setSortingEnabled(True)
        self.tab_nodes.horizontalHeader().sortIndicatorChanged.connect(
            lambda: self.tab_nodes.resizeColumnsToContents())
        self.tab_nodes.verticalHeader().hide()
        self.tab_nodes.resizeColumnsToContents()
        self.tab_nodes.selectionModel().selectionChanged.connect(
            self.selectionChanged)
        self.tab_nodes.itemChanged.connect(self.valueChanged)
Exemple #7
0
    def __init__(self):
        super(shapeMovement, self).__init__()

        # - Init
        self.methodList = ['Shift', 'Scale', 'Shear']

        # - Methods
        self.cmb_methodSelector = QtGui.QComboBox()
        self.cmb_methodSelector.addItems(self.methodList)
        self.cmb_methodSelector.setToolTip('Select transformation method')

        # - Arrow buttons
        self.btn_up = QtGui.QPushButton('Up')
        self.btn_down = QtGui.QPushButton('Down')
        self.btn_left = QtGui.QPushButton('Left')
        self.btn_right = QtGui.QPushButton('Right')

        self.btn_up.setMinimumWidth(80)
        self.btn_down.setMinimumWidth(80)
        self.btn_left.setMinimumWidth(80)
        self.btn_right.setMinimumWidth(80)

        self.btn_up.clicked.connect(self.onUp)
        self.btn_down.clicked.connect(self.onDown)
        self.btn_left.clicked.connect(self.onLeft)
        self.btn_right.clicked.connect(self.onRight)

        self.edt_offX = QtGui.QLineEdit('1.0')
        self.edt_offY = QtGui.QLineEdit('1.0')
        self.edt_offX.setToolTip('X offset')
        self.edt_offY.setToolTip('Y offset')

        # - Layout
        self.lay_btn = QtGui.QGridLayout()

        self.lay_btn.addWidget(self.cmb_methodSelector, 0, 0, 1, 6)
        self.lay_btn.addWidget(QtGui.QLabel('X:'), 1, 0, 1, 1)
        self.lay_btn.addWidget(self.edt_offX, 1, 1, 1, 1)
        self.lay_btn.addWidget(self.btn_up, 1, 2, 1, 2)
        self.lay_btn.addWidget(QtGui.QLabel('Y:'), 1, 4, 1, 1)
        self.lay_btn.addWidget(self.edt_offY, 1, 5, 1, 1)
        self.lay_btn.addWidget(self.btn_left, 2, 0, 1, 2)
        self.lay_btn.addWidget(self.btn_down, 2, 2, 1, 2)
        self.lay_btn.addWidget(self.btn_right, 2, 4, 1, 2)

        self.addLayout(self.lay_btn)
Exemple #8
0
    def __init__(self, aux):
        super(TRLayerBasic, self).__init__()

        # - Init
        self.aux = aux

        # -- Basic Tool buttons
        self.lay_buttons = QtGui.QGridLayout()
        self.btn_add = QtGui.QPushButton('Add')
        self.btn_del = QtGui.QPushButton('Remove')
        self.btn_dup = QtGui.QPushButton('Duplicate')
        self.btn_setServ = QtGui.QPushButton('Service')
        self.btn_setMask = QtGui.QPushButton('Mask')
        self.btn_setWire = QtGui.QPushButton('Wireframe')

        self.btn_add.setToolTip('Add new layer with name')
        self.btn_dup.setToolTip('Duplicate selected with suffix')
        self.btn_del.setToolTip('Delete selected layers')
        self.btn_setServ.setToolTip('Set selected layers as Service')
        self.btn_setWire.setToolTip('Set selected layers as Wireframe')

        self.edt_name = QtGui.QLineEdit('New')
        self.edt_name.setToolTip('Name or suffix')

        self.btn_add.clicked.connect(self.addLayer)
        self.btn_dup.clicked.connect(self.duplicateLayers)
        self.btn_del.clicked.connect(self.deleteLayers)
        self.btn_setMask.clicked.connect(self.addMaskLayers)

        self.btn_setServ.clicked.connect(lambda: self.setLayer('Service'))
        self.btn_setWire.clicked.connect(lambda: self.setLayer('Wireframe'))

        self.lay_buttons.addWidget(QtGui.QLabel('Suffix/Name:'), 0, 0, 1, 1)
        self.lay_buttons.addWidget(self.edt_name, 0, 1, 1, 2)
        self.lay_buttons.addWidget(self.btn_add, 1, 0, 1, 1)
        self.lay_buttons.addWidget(self.btn_del, 1, 1, 1, 1)
        self.lay_buttons.addWidget(self.btn_dup, 1, 2, 1, 1)
        self.lay_buttons.addWidget(self.btn_setServ, 2, 0, 1, 1)
        self.lay_buttons.addWidget(self.btn_setMask, 2, 1, 1, 1)
        self.lay_buttons.addWidget(self.btn_setWire, 2, 2, 1, 1)

        self.addLayout(self.lay_buttons)
Exemple #9
0
    def __init__(self, parentWidget):
        super(WFontMetrics, self).__init__()

        # - Init
        self.grid = QtGui.QGridLayout()
        self.upperWidget = parentWidget
        self.activeFont = pFont()
        self.metricData = {
            layer: self.activeFont.fontMetrics().asDict(layer)
            for layer in self.activeFont.masters()
        }

        # - Interface
        self.btn_apply = QtGui.QPushButton('Apply Changes')
        self.btn_reset = QtGui.QPushButton('Reset')
        self.btn_open = QtGui.QPushButton('Open')
        self.btn_save = QtGui.QPushButton('Save')

        self.btn_apply.clicked.connect(self.applyChanges)
        self.btn_reset.clicked.connect(self.resetChanges)
        self.btn_save.clicked.connect(self.exportMetrics)
        self.btn_open.clicked.connect(self.importMetrics)

        self.tab_fontMetrics = TRTableView(self.metricData)

        # - Build
        lbl_name = QtGui.QLabel('Font Metrics (All Masters)')
        lbl_name.setMaximumHeight(20)
        self.grid.addWidget(lbl_name, 0, 0, 1, 24)
        self.grid.addWidget(self.tab_fontMetrics, 1, 0, 5, 21)
        self.grid.addWidget(self.btn_save, 1, 21, 1, 3)
        self.grid.addWidget(self.btn_open, 2, 21, 1, 3)
        self.grid.addWidget(self.btn_reset, 4, 21, 1, 3)
        self.grid.addWidget(self.btn_apply, 5, 21, 1, 3)

        for i in range(1, 6):
            self.grid.setRowStretch(i, 2)

        self.setLayout(self.grid)
Exemple #10
0
    def __init__(self, aux):
        super(TRAnchorBasic, self).__init__()

        # - Init
        self.aux = aux
        self.types = 'Anchor PinPoint'.split(' ')
        self.posY = 'Coord, Keep, Shift, Above, Below, Center, Baseline, Center of mass'.split(
            ', ')
        self.posX = 'Coord, Keep, Shift, Left, Right, Center, Highest, Highest Left, Highest Right, Lowest, Lowest Left, Lowest Right, Center of mass'.split(
            ', ')
        posYvals = (None, 'S', 'S', 'T', 'B', 'C', None, 'W')
        posXvals = (None, 'S', 'S', 'L', 'R', 'C', 'AT', 'ATL', 'ATR', 'A',
                    'AL', 'AR', 'M')
        self.posYctrl = dict(zip(self.posY, posYvals))
        self.posXctrl = dict(zip(self.posX, posXvals))

        # -- Basic Tool buttons
        self.btn_anchorCopy = QtGui.QPushButton('Copy')
        self.btn_anchorPaste = QtGui.QPushButton('Paste')
        self.btn_clearSel = QtGui.QPushButton('Remove')
        self.btn_clearAll = QtGui.QPushButton('Remove All')
        self.btn_anchorAdd = QtGui.QPushButton('Add')
        self.btn_anchorMov = QtGui.QPushButton('Move')
        self.btn_anchorRename = QtGui.QPushButton('Rename')
        self.btn_anchorSuffix = QtGui.QPushButton('Suffix')
        self.btn_anchorCopy.setToolTip(
            'Copy selected Anchors from layers chosen.')
        self.btn_anchorPaste.setToolTip('Paste Anchors at layers chosen.')
        self.btn_anchorRename.setToolTip('Rename selected anchors.')
        self.btn_anchorSuffix.setToolTip(
            'Extend the name of selected Anchors.')

        self.chk_italic = QtGui.QCheckBox('Use Italic Angle')

        # -- Edit fields
        self.edt_anchorName = ALineEdit()
        self.edt_simpleX = QtGui.QLineEdit()
        self.edt_simpleY = QtGui.QLineEdit()
        self.edt_autoT = QtGui.QLineEdit()

        self.edt_anchorName.setPlaceholderText('New Anchor')
        self.edt_simpleX.setText('0')
        self.edt_simpleY.setText('0')
        self.edt_autoT.setText('5')

        # -- Combo box
        self.cmb_posX = QtGui.QComboBox()
        self.cmb_posY = QtGui.QComboBox()
        self.cmb_type = QtGui.QComboBox()

        self.cmb_posX.addItems(self.posX)
        self.cmb_posY.addItems(self.posY)
        self.cmb_type.addItems(self.types)
        self.cmb_type.setEnabled(False)

        # -- Constrains
        self.btn_clearSel.setMinimumWidth(90)
        self.btn_clearAll.setMinimumWidth(90)
        self.edt_anchorName.setMinimumWidth(50)
        self.edt_simpleX.setMinimumWidth(30)
        self.edt_simpleY.setMinimumWidth(30)

        # -- Link functions
        self.btn_clearAll.clicked.connect(lambda: self.clearAnchors(True))
        self.btn_clearSel.clicked.connect(lambda: self.clearAnchors(False))
        self.btn_anchorAdd.clicked.connect(lambda: self.addAnchors(False))
        self.btn_anchorMov.clicked.connect(lambda: self.addAnchors(True))
        self.btn_anchorCopy.clicked.connect(lambda: self.copyAnchors(False))
        self.btn_anchorPaste.clicked.connect(lambda: self.copyAnchors(True))
        self.btn_anchorSuffix.clicked.connect(
            lambda: self.renameAnchors(False))
        self.btn_anchorRename.clicked.connect(lambda: self.renameAnchors(True))
        self.aux.tree_anchors.itemChanged.connect(self.processChange)

        # - Build layout
        self.lay_grid = QtGui.QGridLayout()
        self.lay_grid.addWidget(QtGui.QLabel('Anchor tree actions:'), 0, 0, 1,
                                4)
        self.lay_grid.addWidget(self.btn_anchorCopy, 1, 0, 1, 4)
        self.lay_grid.addWidget(self.btn_anchorPaste, 1, 4, 1, 4)
        self.lay_grid.addWidget(self.btn_clearSel, 2, 0, 1, 4)
        self.lay_grid.addWidget(self.btn_clearAll, 2, 4, 1, 4)
        self.lay_grid.addWidget(QtGui.QLabel('\nAdd/move anchor:'), 3, 0, 1, 4)
        self.lay_grid.addWidget(QtGui.QLabel('N:'), 4, 0, 1, 1)
        self.lay_grid.addWidget(self.edt_anchorName, 4, 1, 1, 3)
        self.lay_grid.addWidget(self.cmb_type, 4, 4, 1, 4)
        self.lay_grid.addWidget(QtGui.QLabel('X:'), 5, 0, 1, 1)
        self.lay_grid.addWidget(self.cmb_posX, 5, 1, 1, 3)
        self.lay_grid.addWidget(self.edt_simpleX, 5, 4, 1, 4)
        self.lay_grid.addWidget(QtGui.QLabel('Y:'), 6, 0, 1, 1)
        self.lay_grid.addWidget(self.cmb_posY, 6, 1, 1, 3)
        self.lay_grid.addWidget(self.edt_simpleY, 6, 4, 1, 4)
        self.lay_grid.addWidget(QtGui.QLabel('Tolerance:'), 7, 1, 1, 2)
        self.lay_grid.addWidget(self.edt_autoT, 7, 3, 1, 1)
        self.lay_grid.addWidget(self.chk_italic, 7, 4, 1, 1)
        self.lay_grid.addWidget(self.btn_anchorAdd, 8, 0, 1, 4)
        self.lay_grid.addWidget(self.btn_anchorMov, 8, 4, 1, 4)
        self.lay_grid.addWidget(self.btn_anchorRename, 9, 0, 1, 4)
        self.lay_grid.addWidget(self.btn_anchorSuffix, 9, 4, 1, 4)

        # - Build
        self.addLayout(self.lay_grid)
    def __init__(self):
        super(dlg_CopyLayer, self).__init__()

        # - Init
        self.active_font = pFont()
        self.pMode = 0

        # - Basic Widgets
        self.tab_masters = WTableView(table_dict)
        self.table_populate()

        self.edt_checkStr = QtGui.QLineEdit()
        self.edt_checkStr.setPlaceholderText('DST string')
        self.edt_checkStr.setToolTip(
            'Enter search criteria for selectively selecting destination masters.'
        )
        self.btn_refresh = QtGui.QPushButton('Clear')
        self.btn_checkOn = QtGui.QPushButton('Select')
        self.btn_execute = QtGui.QPushButton('Execute Selection')
        self.btn_preset_contrast = QtGui.QPushButton(
            'Copy to Contrast Masters')
        self.btn_preset_width = QtGui.QPushButton('Copy to Width Masters')
        self.btn_preset_weight = QtGui.QPushButton('Copy to Weight Masters')
        self.btn_preset_ctrlt = QtGui.QPushButton(
            'Copy to Light Contrast Masters')
        self.btn_preset_ctrlts = QtGui.QPushButton(
            'Copy to Light Contrast Masters (incl. Slant)')
        self.btn_preset_slant = QtGui.QPushButton('Copy to Slant Masters')

        self.btn_refresh.clicked.connect(self.table_populate)
        self.btn_checkOn.clicked.connect(lambda: self.table_populate(True))
        self.btn_execute.clicked.connect(self.execute_table)
        self.btn_preset_contrast.clicked.connect(
            lambda: self.execute_preset(copy_presets['contrast']))
        self.btn_preset_width.clicked.connect(
            lambda: self.execute_preset(copy_presets['width']))
        self.btn_preset_weight.clicked.connect(
            lambda: self.execute_preset(copy_presets['weight']))
        self.btn_preset_ctrlt.clicked.connect(
            lambda: self.execute_preset(copy_presets['ctr_light']))
        self.btn_preset_ctrlts.clicked.connect(
            lambda: self.execute_preset(copy_presets['ctr_light_s']))
        self.btn_preset_slant.clicked.connect(
            lambda: self.execute_preset(copy_presets['slant']))

        self.rad_glyph = QtGui.QRadioButton('Glyph')
        self.rad_window = QtGui.QRadioButton('Window')
        self.rad_selection = QtGui.QRadioButton('Selection')
        self.rad_font = QtGui.QRadioButton('Font')
        self.chk_outline = QtGui.QCheckBox('Outline')
        self.chk_guides = QtGui.QCheckBox('Guides')
        self.chk_anchors = QtGui.QCheckBox('Anchors')
        self.chk_lsb = QtGui.QCheckBox('LSB')
        self.chk_adv = QtGui.QCheckBox('Advance')
        self.chk_rsb = QtGui.QCheckBox('RSB')
        self.chk_lnk = QtGui.QCheckBox('Metric Links')
        self.chk_crlayer = QtGui.QCheckBox('Add layers')

        # -- Set States
        self.chk_outline.setCheckState(QtCore.Qt.Checked)
        self.chk_adv.setCheckState(QtCore.Qt.Checked)
        self.chk_lsb.setCheckState(QtCore.Qt.Checked)
        self.chk_anchors.setCheckState(QtCore.Qt.Checked)
        self.chk_lnk.setCheckState(QtCore.Qt.Checked)
        self.chk_crlayer.setCheckState(QtCore.Qt.Checked)
        self.chk_guides.setEnabled(False)

        self.rad_glyph.setChecked(True)
        self.rad_glyph.setEnabled(True)
        self.rad_window.setEnabled(True)
        self.rad_selection.setEnabled(True)
        self.rad_font.setEnabled(False)

        self.rad_glyph.toggled.connect(self.refreshMode)
        self.rad_window.toggled.connect(self.refreshMode)
        self.rad_selection.toggled.connect(self.refreshMode)
        self.rad_font.toggled.connect(self.refreshMode)

        # - Build layouts
        layoutV = QtGui.QGridLayout()
        layoutV.addWidget(QtGui.QLabel('Process Mode:'), 0, 0, 1, 8,
                          QtCore.Qt.AlignBottom)
        layoutV.addWidget(self.rad_glyph, 1, 0, 1, 2)
        layoutV.addWidget(self.rad_window, 1, 2, 1, 2)
        layoutV.addWidget(self.rad_selection, 1, 4, 1, 2)
        layoutV.addWidget(self.rad_font, 1, 6, 1, 2)
        layoutV.addWidget(QtGui.QLabel('Copy Options:'), 2, 0, 1, 8,
                          QtCore.Qt.AlignBottom)
        layoutV.addWidget(self.chk_outline, 3, 0, 1, 2)
        layoutV.addWidget(self.chk_guides, 3, 2, 1, 2)
        layoutV.addWidget(self.chk_anchors, 3, 4, 1, 2)
        layoutV.addWidget(self.chk_crlayer, 3, 6, 1, 2)
        layoutV.addWidget(self.chk_lsb, 4, 0, 1, 2)
        layoutV.addWidget(self.chk_adv, 4, 2, 1, 2)
        layoutV.addWidget(self.chk_rsb, 4, 4, 1, 2)
        layoutV.addWidget(self.chk_lnk, 4, 6, 1, 2)
        layoutV.addWidget(
            QtGui.QLabel(
                'Master Layers: Single source to multiple destinations'), 5, 0,
            1, 8, QtCore.Qt.AlignBottom)
        layoutV.addWidget(QtGui.QLabel('Search:'), 6, 0, 1, 1)
        layoutV.addWidget(self.edt_checkStr, 6, 1, 1, 3)
        layoutV.addWidget(self.btn_checkOn, 6, 4, 1, 2)
        layoutV.addWidget(self.btn_refresh, 6, 6, 1, 2)
        layoutV.addWidget(self.tab_masters, 7, 0, 15, 8)
        layoutV.addWidget(self.btn_execute, 22, 0, 1, 8)
        layoutV.addWidget(QtGui.QLabel('Master Layers: Copy Presets'), 23, 0,
                          1, 8, QtCore.Qt.AlignBottom)
        layoutV.addWidget(self.btn_preset_weight, 24, 0, 1, 8)
        layoutV.addWidget(self.btn_preset_width, 25, 0, 1, 8)
        layoutV.addWidget(self.btn_preset_contrast, 26, 0, 1, 8)
        layoutV.addWidget(self.btn_preset_ctrlt, 27, 0, 1, 8)
        layoutV.addWidget(self.btn_preset_ctrlts, 28, 0, 1, 8)
        layoutV.addWidget(self.btn_preset_slant, 29, 0, 1, 8)

        # - Set Widget
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s' % (app_name, app_version))
        self.setGeometry(300, 300, 300, 600)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!
        self.show()
Exemple #12
0
    def __init__(self, aux, upperWidget):
        super(TRTextBlockBasic, self).__init__()

        # - Init
        self.aux = aux
        #self.activeFont = pFont()
        self.upperWidget = upperWidget
        '''
		self.active_workspace = pWorkspace()
		self.active_canvas = self.active_workspace.getCanvas() 
		self.active_textBlock = pTextBlock(self.active_workspace.getTextBlockList()[0])
		'''

        # - Widgets
        self.chk_page = QtGui.QCheckBox('Page size:')
        self.chk_size = QtGui.QCheckBox('Width/Height:')
        self.chk_pos = QtGui.QCheckBox('Position X/Y:')
        self.chk_align = QtGui.QCheckBox('Text alignment:')
        self.chk_kegel = QtGui.QCheckBox('Font Size:')

        self.chk_page.setCheckState(QtCore.Qt.Checked)
        self.chk_size.setCheckState(QtCore.Qt.Checked)
        #self.chk_pos.setCheckState(QtCore.Qt.Checked)
        #self.chk_align.setCheckState(QtCore.Qt.Checked)
        self.chk_kegel.setCheckState(QtCore.Qt.Checked)

        self.cmb_pageSizes = QtGui.QComboBox()
        self.cmb_text_align = QtGui.QComboBox()

        self.cmb_pageSizes.addItems(sorted(page_sizes.keys()))
        self.cmb_text_align.addItems(text_align)

        self.cmb_pageSizes.currentTextChanged.connect(self.page_changed)
        self.cmb_text_align.currentTextChanged.connect(self.algn_changed)

        self.spb_font_size = QtGui.QSpinBox()
        self.spb_font_size.setSuffix(' pt')
        self.spb_font_size.setValue(12)

        self.spb_size_w = QtGui.QSpinBox()
        self.spb_size_h = QtGui.QSpinBox()
        self.spb_pos_x = QtGui.QSpinBox()
        self.spb_pos_y = QtGui.QSpinBox()

        self.spb_size_w.setMaximum(9999)
        self.spb_size_h.setMaximum(9999)
        self.spb_pos_x.setMaximum(9999)
        self.spb_pos_y.setMaximum(9999)
        self.spb_pos_x.setMinimum(-9999)
        self.spb_pos_y.setMinimum(-9999)

        self.spb_size_w.setValue(page_sizes[self.cmb_pageSizes.currentText][0])
        self.spb_size_h.setValue(page_sizes[self.cmb_pageSizes.currentText][1])

        self.btn_apply = QtGui.QPushButton('Set Text Block(s)')
        self.btn_clone = QtGui.QPushButton('Clone')
        self.btn_lock = QtGui.QPushButton('Lock')
        self.btn_reformat = QtGui.QPushButton('Reformat')
        self.btn_remove = QtGui.QPushButton('Remove')
        self.btn_stack_v = QtGui.QPushButton('Stack Vertically')
        self.btn_stack_h = QtGui.QPushButton('Stack Horizontally')
        #self.btn_save = QtGui.QPushButton('Save Layout')
        #self.btn_load = QtGui.QPushButton('Load Layout')

        self.btn_apply.clicked.connect(lambda: self.block_action('format'))
        self.btn_clone.clicked.connect(lambda: self.block_action('clone'))
        self.btn_remove.clicked.connect(lambda: self.block_action('remove'))
        self.btn_lock.clicked.connect(lambda: self.block_action('lock'))
        self.btn_reformat.clicked.connect(
            lambda: self.block_action('reformat'))
        self.btn_stack_v.clicked.connect(lambda: self.block_action('stack_v'))
        self.btn_stack_h.clicked.connect(lambda: self.block_action('stack_h'))
        #self.btn_save.clicked.connect(self.save)
        #self.btn_load.clicked.connect(self.load)

        # - Disable for now
        self.cmb_text_align.setEnabled(False)
        self.chk_align.setEnabled(False)

        # - Build layouts
        layoutV = QtGui.QGridLayout()
        layoutV.addWidget(QtGui.QLabel('Text Block: Formatting'), 0, 0, 1, 4)
        layoutV.addWidget(self.chk_page, 1, 0, 1, 2)
        layoutV.addWidget(self.cmb_pageSizes, 1, 2, 1, 2)
        layoutV.addWidget(self.chk_size, 2, 0, 1, 2)
        layoutV.addWidget(self.spb_size_w, 2, 2, 1, 1)
        layoutV.addWidget(self.spb_size_h, 2, 3, 1, 1)
        layoutV.addWidget(self.chk_pos, 3, 0, 1, 2)
        layoutV.addWidget(self.spb_pos_x, 3, 2, 1, 1)
        layoutV.addWidget(self.spb_pos_y, 3, 3, 1, 1)
        layoutV.addWidget(self.chk_align, 4, 0, 1, 2)
        layoutV.addWidget(self.cmb_text_align, 4, 2, 1, 2)
        layoutV.addWidget(self.chk_kegel, 5, 0, 1, 2)
        layoutV.addWidget(self.spb_font_size, 5, 2, 1, 2)
        layoutV.addWidget(self.btn_apply, 6, 0, 1, 4)
        layoutV.addWidget(QtGui.QLabel('Text Block: Tools'), 7, 0, 1, 4)
        layoutV.addWidget(self.btn_clone, 8, 0, 1, 2)
        layoutV.addWidget(self.btn_remove, 8, 2, 1, 2)
        layoutV.addWidget(self.btn_lock, 9, 0, 1, 2)
        layoutV.addWidget(self.btn_reformat, 9, 2, 1, 2)
        layoutV.addWidget(QtGui.QLabel('Text Block: Alignment'), 10, 0, 1, 4)
        layoutV.addWidget(self.btn_stack_h, 11, 0, 1, 2)
        layoutV.addWidget(self.btn_stack_v, 11, 2, 1, 2)
        '''
		layoutV.addWidget(QtGui.QLabel('Text Block: Layout'),		12, 0, 1, 4)
		layoutV.addWidget(self.btn_save, 		13, 0, 1, 2)
		layoutV.addWidget(self.btn_load, 		13, 2, 1, 2)
		'''

        # - Set Widget
        self.addLayout(layoutV)
Exemple #13
0
    def __init__(self):
        super(TRGlyphInfo, self).__init__()

        # -- Init
        self.table_dict = {0: {0: None}}  # Empty table

        # -- Widgets
        self.lay_head = QtGui.QGridLayout()

        self.edt_glyphName = QtGui.QLineEdit()
        self.edt_glyphsSeq = QtGui.QLineEdit()
        self.edt_glyphName.setToolTip('Current Glyph Name.')
        self.edt_glyphsSeq.setToolTip(
            'Manual entry for Glyph names to populate stats info. Separated by SPACE'
        )

        self.cmb_query = QtGui.QComboBox()
        self.cmb_charset = QtGui.QComboBox()
        self.cmb_query.setToolTip('Select query type.')
        self.cmb_charset.setToolTip('Select character set to compare with.')

        # --- Add queries
        self.query_list = [
            '(BBox) Bounding Box Width', '(BBox) Bounding Box Height',
            '(Metrics) Advance Width', '(Metrics) Left Side-bearing',
            '(Metrics) Right Side-bearing'
        ]

        self.cmb_query.addItems(self.query_list)

        self.btn_refresh = QtGui.QPushButton('&Refresh')
        self.btn_populate = QtGui.QPushButton('&Populate')
        self.btn_get = QtGui.QPushButton('&Window')
        self.btn_probe = QtGui.QPushButton('Glyph')
        self.btn_units = QtGui.QPushButton('Percent')

        self.btn_refresh.setToolTip('Refresh active glyph and table.')
        self.btn_populate.setToolTip(
            'Populate character set selector from current font.')
        self.btn_get.setToolTip('Get current string from active Glyph Window.')
        self.btn_probe.setToolTip(
            'Toggle between Row (Glyph) or Column (Layer) based comparison.')
        self.btn_units.setToolTip(
            'Toggle the results beeing shown as (Units) or (Percent).')

        self.btn_probe.setCheckable(True)
        self.btn_units.setCheckable(True)
        self.btn_probe.setChecked(False)
        self.btn_units.setChecked(False)

        # !!! Disable for now
        self.cmb_charset.setEnabled(False)
        self.btn_populate.setEnabled(False)

        # -- Build Layout
        self.lay_head.addWidget(QtGui.QLabel('G:'), 0, 0, 1, 1)
        self.lay_head.addWidget(self.edt_glyphName, 0, 1, 1, 5)
        self.lay_head.addWidget(self.btn_refresh, 0, 6, 1, 2)
        #self.lay_head.addWidget(QtGui.QLabel('C:'),	1,0,1,1)
        #self.lay_head.addWidget(self.cmb_charset,	1,1,1,5)
        #self.lay_head.addWidget(self.btn_populate,	1,6,1,2)
        self.lay_head.addWidget(QtGui.QLabel('C:'), 2, 0, 1, 1)
        self.lay_head.addWidget(self.edt_glyphsSeq, 2, 1, 1, 5)
        self.lay_head.addWidget(self.btn_get, 2, 6, 1, 2)
        self.lay_head.addWidget(QtGui.QLabel('Q:'), 3, 0, 1, 1)
        self.lay_head.addWidget(self.cmb_query, 3, 1, 1, 5)
        self.lay_head.addWidget(self.btn_probe, 3, 6, 1, 2)
        self.addLayout(self.lay_head)

        # -- Table
        self.tab_stats = TRTableView(self.table_dict)
        #self.refresh()

        # -- Note/Descriotion
        self.addWidget(self.tab_stats)
        self.addWidget(self.btn_units)

        # -- Addons
        self.btn_refresh.clicked.connect(self.refresh)
        self.btn_populate.clicked.connect(self.populate)
        self.btn_get.clicked.connect(self.get_string)
        self.btn_probe.clicked.connect(self.toggle_query)
        self.btn_units.clicked.connect(self.toggle_units)
        self.cmb_query.currentIndexChanged.connect(self.refresh)

        # -- Table Styling
        self.tab_stats.horizontalHeader().setStretchLastSection(False)
        self.tab_stats.resizeColumnsToContents()
        self.tab_stats.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.tab_stats.selectionModel().selectionChanged.connect(
            self.change_selection)
Exemple #14
0
    def __init__(self, aux):
        super(TRLayerMultiEdit, self).__init__()

        # - Init
        self.aux = aux
        self.backup = {}
        self.contourClipboard = {}

        # -- Edit fileds
        self.edt_shift = QtGui.QLineEdit('0.0, 0.0')
        self.edt_scale = QtGui.QLineEdit('100, 100')
        self.edt_slant = QtGui.QLineEdit('0.0')
        self.edt_rotate = QtGui.QLineEdit('0.0')

        self.edt_shift.setToolTip('Translate Layer by X, Y (comma separated)')
        self.edt_scale.setToolTip(
            'Scale Layer by X percent, Y percent(comma separated)')
        self.edt_slant.setToolTip('Slant/Shear degrees')
        self.edt_rotate.setToolTip('Rotate degrees')

        # -- Quick Tool buttons
        self.lay_buttons = QtGui.QGridLayout()
        self.btn_unfold = QtGui.QPushButton('Unfold Layers')
        self.btn_restore = QtGui.QPushButton('Fold Layers')
        self.btn_copy = QtGui.QPushButton('Copy Outline')
        self.btn_paste = QtGui.QPushButton('Paste Outline')
        self.btn_transform = QtGui.QPushButton('Transform Layer')
        self.btn_transform_shape = QtGui.QPushButton('Transform Elements')

        self.btn_restore.setEnabled(False)
        self.btn_paste.setEnabled(False)

        self.btn_unfold.setToolTip(
            'Reposition selected layers side by side. Selection order does matter!'
        )
        self.btn_restore.setToolTip('Restore Layer Metrics.')
        self.btn_copy.setToolTip(
            'Copy selected outline to cliboard for each of selected layers.')
        self.btn_paste.setToolTip(
            'Paste outline from cliboard layer by layer (by name).\nNon existing layers are discarded!\nClick: New Element is created upon Paste.\nSHIFT+Click: Paste inside currently selected Element.'
        )
        self.btn_transform.setToolTip('Affine transform selected layers.')

        self.btn_unfold.clicked.connect(self.layers_unfold)
        self.btn_restore.clicked.connect(self.layers_restore)
        self.btn_copy.clicked.connect(self.outline_copy)
        self.btn_paste.clicked.connect(self.outline_paste)
        self.btn_transform.clicked.connect(lambda: self.layer_transform(False))
        self.btn_transform_shape.clicked.connect(
            lambda: self.layer_transform(True))

        self.lay_buttons.addWidget(self.btn_unfold, 0, 0, 1, 4)
        self.lay_buttons.addWidget(self.btn_restore, 0, 4, 1, 4)
        self.lay_buttons.addWidget(self.btn_copy, 1, 0, 1, 4)
        self.lay_buttons.addWidget(self.btn_paste, 1, 4, 1, 4)
        self.lay_buttons.addWidget(QtGui.QLabel('Translate:'), 2, 0, 1, 2)
        self.lay_buttons.addWidget(QtGui.QLabel('Scale:'), 2, 2, 1, 2)
        self.lay_buttons.addWidget(QtGui.QLabel('Shear:'), 2, 4, 1, 2)
        self.lay_buttons.addWidget(QtGui.QLabel('Rotate:'), 2, 6, 1, 2)
        self.lay_buttons.addWidget(self.edt_shift, 3, 0, 1, 2)
        self.lay_buttons.addWidget(self.edt_scale, 3, 2, 1, 2)
        self.lay_buttons.addWidget(self.edt_slant, 3, 4, 1, 2)
        self.lay_buttons.addWidget(self.edt_rotate, 3, 6, 1, 2)
        self.lay_buttons.addWidget(self.btn_transform, 4, 0, 1, 4)
        self.lay_buttons.addWidget(self.btn_transform_shape, 4, 4, 1, 4)

        self.addLayout(self.lay_buttons)
Exemple #15
0
    def __init__(self, aux):
        super(TRLayerTools, self).__init__()

        # - Init
        self.aux = aux

        # -- Mode checks
        self.lay_checks = QtGui.QGridLayout()
        self.chk_outline = QtGui.QCheckBox('Outline')
        self.chk_guides = QtGui.QCheckBox('Guides')
        self.chk_anchors = QtGui.QCheckBox('Anchors')
        self.chk_lsb = QtGui.QCheckBox('LSB')
        self.chk_adv = QtGui.QCheckBox('Advance')
        self.chk_rsb = QtGui.QCheckBox('RSB')

        # -- Set States
        self.chk_outline.setCheckState(QtCore.Qt.Checked)
        self.chk_adv.setCheckState(QtCore.Qt.Checked)

        # -- Build
        self.lay_checks.addWidget(self.chk_outline, 0, 0)
        self.lay_checks.addWidget(self.chk_guides, 0, 1)
        self.lay_checks.addWidget(self.chk_anchors, 0, 2)
        self.lay_checks.addWidget(self.chk_lsb, 1, 0)
        self.lay_checks.addWidget(self.chk_adv, 1, 1)
        self.lay_checks.addWidget(self.chk_rsb, 1, 2)

        self.addLayout(self.lay_checks)

        # -- Quick Tool buttons
        self.lay_buttons = QtGui.QGridLayout()
        self.btn_swap = QtGui.QPushButton('Swap')
        self.btn_copy = QtGui.QPushButton('Copy')
        self.btn_paste = QtGui.QPushButton('Paste')
        self.btn_clean = QtGui.QPushButton('Empty')
        self.btn_unlock = QtGui.QPushButton('Unlock')
        self.btn_expand = QtGui.QPushButton('Expand')

        #self.btn_unlock.setEnabled(False)
        self.btn_expand.setEnabled(False)

        self.btn_swap.setToolTip('Swap Selected Layer with Active Layer')
        self.btn_copy.setToolTip('Copy Active Layer to Selected Layer')
        self.btn_paste.setToolTip('Paste Selected Layer to Active Layer')
        self.btn_clean.setToolTip('Remove contents from selected layers')
        self.btn_unlock.setToolTip(
            'Unlock all locked references.\nSHIFT+Click will lock all references.'
        )
        self.btn_expand.setToolTip(
            'Expand transformations for selected layers')

        self.btn_swap.clicked.connect(self.layer_swap)
        self.btn_copy.clicked.connect(self.layer_copy)
        self.btn_paste.clicked.connect(self.layer_paste)
        self.btn_clean.clicked.connect(self.layer_clean)
        self.btn_unlock.clicked.connect(self.layer_unlock)
        #self.btn_expand.clicked.connect(self.expand)

        self.lay_buttons.addWidget(self.btn_swap, 0, 0, 1, 1)
        self.lay_buttons.addWidget(self.btn_copy, 0, 1, 1, 1)
        self.lay_buttons.addWidget(self.btn_paste, 0, 2, 1, 1)
        self.lay_buttons.addWidget(self.btn_clean, 1, 0, 1, 1)
        self.lay_buttons.addWidget(self.btn_unlock, 1, 1, 1, 1)
        self.lay_buttons.addWidget(self.btn_expand, 1, 2, 1, 1)

        self.addLayout(self.lay_buttons)
Exemple #16
0
    def __init__(self):
        super(dlg_DeltaMachine, self).__init__()

        # - Init
        #self.setStyleSheet(ss_controls)

        self.pMode = 0
        self.active_font = pFont()
        #self.data_glyphs = getProcessGlyphs(self.pMode)
        self.data_PointArrays = {}
        self.data_stems = {}
        self.ratio_source = {}
        self.ratio_target = {}
        self.italic_angle = 0

        # - Basic Widgets
        # -- Master table
        self.tab_masters = WTableView(table_dict)
        self.table_populate()
        self.tab_masters.selectionModel().selectionChanged.connect(
            self.set_sliders)

        # -- Combos
        self.cmb_infoArrays = QtGui.QComboBox()

        # -- Buttons
        self.btn_execute = QtGui.QPushButton('Execute transformation')
        self.btn_tableRefresh = QtGui.QPushButton('Reset')
        self.chk_tableLock = QtGui.QPushButton('Lock')
        self.btn_tableSave = QtGui.QPushButton('Save')
        self.btn_tableLoad = QtGui.QPushButton('Load')
        self.btn_getVstems = QtGui.QPushButton('Get V-stems')
        self.btn_getHstems = QtGui.QPushButton('Get H-stems')
        self.btn_tableCheck = QtGui.QPushButton('Check All')
        self.btn_resetT = QtGui.QPushButton('Reset dX dY')
        self.btn_getTx = QtGui.QPushButton('Get V[dX]')
        self.btn_getTy = QtGui.QPushButton('Get H[dY]')
        self.btn_getArrays = QtGui.QPushButton('Get Master Sources')

        self.btn_getPart = QtGui.QPushButton('Get Part')
        self.btn_getWhole = QtGui.QPushButton('Get Whole')
        self.btn_pushWidthPW = QtGui.QPushButton('Eval Width')
        self.btn_pushHeightPW = QtGui.QPushButton('Eval Height')
        self.btn_pushWidth = QtGui.QPushButton('Set Width Ratio')
        self.btn_pushHeight = QtGui.QPushButton('Set Height Ratio')

        self.btn_tableCheck.clicked.connect(self.table_check_all)
        self.btn_tableRefresh.clicked.connect(self.table_populate)
        self.btn_tableSave.clicked.connect(self.file_save_deltas)
        self.btn_tableLoad.clicked.connect(self.file_load_deltas)
        self.btn_execute.clicked.connect(self.table_execute)
        self.chk_tableLock.clicked.connect(
            lambda: self.tab_masters.lockTable())

        self.btn_getPart.clicked.connect(lambda: self.get_ratio(True))
        self.btn_getWhole.clicked.connect(lambda: self.get_ratio(False))
        self.btn_pushWidthPW.clicked.connect(
            lambda: self.push_ratio(False, True))
        self.btn_pushHeightPW.clicked.connect(
            lambda: self.push_ratio(True, True))
        self.btn_pushWidth.clicked.connect(
            lambda: self.push_ratio(False, False))
        self.btn_pushHeight.clicked.connect(
            lambda: self.push_ratio(True, False))

        self.btn_getArrays.clicked.connect(lambda: self.get_PointArrays(None))
        self.btn_getVstems.clicked.connect(lambda: self.get_Stems(True))
        self.btn_getHstems.clicked.connect(lambda: self.get_Stems(False))
        self.btn_getTx.clicked.connect(lambda: self.get_Stems(True, False))
        self.btn_getTy.clicked.connect(lambda: self.get_Stems(False, False))

        # -- Check buttons
        self.chk_italic = QtGui.QPushButton('Italic')
        self.chk_single = QtGui.QPushButton('Anisotropic')
        self.chk_preview = QtGui.QPushButton('Live Preview')
        self.chk_boundry = QtGui.QPushButton('Fix Boundry')
        self.chk_single.setToolTip(
            'Active: Use X and Y to control interpolation.')
        self.chk_tableLock.setCheckable(True)
        self.chk_single.setCheckable(True)
        self.chk_italic.setCheckable(True)
        self.chk_preview.setCheckable(True)
        self.chk_boundry.setCheckable(True)
        self.chk_single.setChecked(False)
        self.chk_italic.setChecked(False)
        self.chk_preview.setChecked(False)
        self.chk_boundry.setChecked(True)

        # -- Radio
        self.rad_glyph = QtGui.QRadioButton('Glyph')
        self.rad_window = QtGui.QRadioButton('Window')
        self.rad_selection = QtGui.QRadioButton('Selection')
        self.rad_font = QtGui.QRadioButton('Font')

        self.rad_glyph.setChecked(True)
        self.rad_glyph.setEnabled(True)
        self.rad_window.setEnabled(True)
        self.rad_selection.setEnabled(True)
        self.rad_font.setEnabled(True)

        self.rad_glyph.toggled.connect(self.table_refresh)
        self.rad_window.toggled.connect(self.table_refresh)
        self.rad_selection.toggled.connect(self.table_refresh)
        self.rad_font.toggled.connect(self.table_refresh)

        # -- Sliders
        self.mixer_dx = TRSliderCtrl('1', '1000', '0', 1)
        self.mixer_dy = TRSliderCtrl('1', '1000', '0', 1)
        self.scaler_dx = TRSliderCtrl('1', '200', '100', 1)
        self.scaler_dy = TRSliderCtrl('1', '200', '100', 1)

        self.mixer_dx.sld_axis.valueChanged.connect(lambda: self.process_scale(
            eGlyph(),
            anisotropic=self.chk_single.isChecked(),
            live_update=self.chk_preview.isChecked()))
        self.mixer_dy.sld_axis.valueChanged.connect(lambda: self.process_scale(
            eGlyph(),
            anisotropic=self.chk_single.isChecked(),
            live_update=self.chk_preview.isChecked()))
        self.scaler_dx.sld_axis.valueChanged.connect(
            lambda: self.process_scale(eGlyph(),
                                       anisotropic=self.chk_single.isChecked(),
                                       live_update=self.chk_preview.isChecked(
                                       )))
        self.scaler_dy.sld_axis.valueChanged.connect(
            lambda: self.process_scale(eGlyph(),
                                       anisotropic=self.chk_single.isChecked(),
                                       live_update=self.chk_preview.isChecked(
                                       )))

        # - Build layout
        layoutV = QtGui.QGridLayout()
        layoutV.addWidget(QtGui.QLabel('Preferences:'), 0, 0, 1, 1)
        layoutV.addWidget(self.btn_tableCheck, 0, 1, 1, 2)
        layoutV.addWidget(self.chk_tableLock, 0, 3, 1, 2)
        layoutV.addWidget(self.btn_tableSave, 0, 5, 1, 1)
        layoutV.addWidget(self.btn_tableLoad, 0, 6, 1, 2)
        layoutV.addWidget(self.btn_tableRefresh, 0, 8, 1, 1)
        layoutV.addWidget(QtGui.QLabel('Source:'), 0, 10, 1, 1,
                          QtCore.Qt.AlignRight)
        layoutV.addWidget(self.btn_getVstems, 0, 11, 1, 2)
        layoutV.addWidget(self.btn_getHstems, 0, 13, 1, 2)
        layoutV.addWidget(QtGui.QLabel('Ratio BBOX:'), 0, 15, 1, 1,
                          QtCore.Qt.AlignRight)
        layoutV.addWidget(self.btn_getPart, 0, 16, 1, 1)
        layoutV.addWidget(self.btn_getWhole, 0, 17, 1, 1)
        layoutV.addWidget(self.btn_pushWidthPW, 0, 18, 1, 1)
        layoutV.addWidget(self.btn_pushHeightPW, 0, 19, 1, 1)

        layoutV.addWidget(QtGui.QLabel('Master data:'), 1, 0, 1, 1)
        layoutV.addWidget(self.cmb_infoArrays, 1, 1, 1, 4)
        layoutV.addWidget(self.btn_getArrays, 1, 5, 1, 4)
        layoutV.addWidget(QtGui.QLabel('Target:'), 1, 10, 1, 1,
                          QtCore.Qt.AlignRight)
        layoutV.addWidget(self.btn_getTx, 1, 11, 1, 2)
        layoutV.addWidget(self.btn_getTy, 1, 13, 1, 2)
        layoutV.addWidget(QtGui.QLabel('Populate:'), 1, 15, 1, 1,
                          QtCore.Qt.AlignRight)
        layoutV.addWidget(self.btn_pushWidth, 1, 16, 1, 2)
        layoutV.addWidget(self.btn_pushHeight, 1, 18, 1, 2)

        layoutV.addWidget(self.tab_masters, 2, 0, 15, 20)

        layoutV.addWidget(QtGui.QLabel('LERP [dX]:'), 23, 0, 1, 1,
                          QtCore.Qt.AlignTop)
        layoutV.addLayout(self.mixer_dx, 23, 1, 1, 4)
        layoutV.addWidget(QtGui.QLabel('[dY]:'), 23, 5, 1, 1,
                          QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
        layoutV.addLayout(self.mixer_dy, 23, 6, 1, 4)
        layoutV.addWidget(QtGui.QLabel('Width:'), 23, 10, 1, 1,
                          QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
        layoutV.addLayout(self.scaler_dx, 23, 11, 1, 4)
        layoutV.addWidget(QtGui.QLabel('Height:'), 23, 15, 1, 1,
                          QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
        layoutV.addLayout(self.scaler_dy, 23, 16, 1, 4)

        layoutV.addWidget(QtGui.QLabel('Process:'), 25, 0, 1, 1)
        layoutV.addWidget(self.rad_glyph, 25, 1, 1, 1)
        layoutV.addWidget(self.rad_window, 25, 2, 1, 1)
        layoutV.addWidget(self.rad_selection, 25, 3, 1, 1)
        layoutV.addWidget(self.rad_font, 25, 4, 1, 1)
        layoutV.addWidget(QtGui.QLabel('Mode:'), 25, 5, 1, 1)
        layoutV.addWidget(self.chk_single, 25, 6, 1, 2)
        layoutV.addWidget(self.chk_italic, 25, 8, 1, 2)
        layoutV.addWidget(self.chk_boundry, 25, 10, 1, 2)
        layoutV.addWidget(self.chk_preview, 25, 12, 1, 3)
        layoutV.addWidget(self.btn_execute, 25, 15, 1, 5)

        # - Set Widget
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s' % (app_name, app_version))
        self.setGeometry(300, 300, 1150, 700)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!

        # !!! Hotfix FL7 7355
        self.setMinimumSize(980, self.sizeHint.height())

        self.show()
Exemple #17
0
	def __init__(self, parentWidget):
		super(TRSmartCorner, self).__init__()
		self.upper_widget = parentWidget

		# -- Init
		self.active_font = pFont()
		self.builder = None
		self.font_masters = self.active_font.masters()
		self.empty_preset = lambda row: OrderedDict([(row, OrderedDict([('Preset', 'Preset %s' %row)] + [(master, '0') for master in self.font_masters]))])
		self.table_dict = self.empty_preset(0)
		self.last_preset = 0

		# -- Widgets
		self.lay_head = QtGui.QGridLayout()

		self.edt_glyphName = QtGui.QLineEdit()
		self.edt_glyphName.setPlaceholderText('Glyph name')

		# -- Buttons
		self.btn_getBuilder = QtGui.QPushButton('Set &Builder')
		self.btn_findBuilder = QtGui.QPushButton('&From Font')
		self.btn_addPreset = QtGui.QPushButton('Add')
		self.btn_delPreset = QtGui.QPushButton('Remove')
		self.btn_resetPreset = QtGui.QPushButton('Reset')
		self.btn_loadPreset = QtGui.QPushButton('&Load Presets')
		self.btn_savePreset = QtGui.QPushButton('&Save Presets')
		self.btn_apply_smartCorner = QtGui.QPushButton('&Apply Smart Corner')
		self.btn_remove_smartCorner = QtGui.QPushButton('R&emove Smart Corner')
		self.btn_remove_presetCorner = QtGui.QPushButton('&Find and Remove')

		self.btn_apply_smartCorner.setToolTip('Apply Smart Corner preset on SELECTED nodes.')
		self.btn_remove_smartCorner.setToolTip('Remove Smart Corner on SELECTED nodes.')
		self.btn_remove_presetCorner.setToolTip('Find and remove all Smart Corners that equal the currently selected preset.')


		self.btn_apply_round = QtGui.QPushButton('&Round')
		self.btn_apply_mitre = QtGui.QPushButton('&Mitre')
		self.btn_apply_overlap = QtGui.QPushButton('&Overlap')
		self.btn_apply_trap = QtGui.QPushButton('&Trap')
		self.btn_rebuild = QtGui.QPushButton('Rebuild corner')

		self.btn_getBuilder.setMinimumWidth(70)
		self.btn_findBuilder.setMinimumWidth(70)
		self.btn_apply_round.setMinimumWidth(70)
		self.btn_apply_mitre.setMinimumWidth(70)
		self.btn_apply_overlap.setMinimumWidth(70)
		self.btn_apply_trap.setMinimumWidth(70)
		self.btn_rebuild.setMinimumWidth(70)

		self.btn_addPreset.setMinimumWidth(70)
		self.btn_delPreset.setMinimumWidth(70)
		self.btn_loadPreset.setMinimumWidth(140)
		self.btn_savePreset.setMinimumWidth(140)
		self.btn_apply_smartCorner.setMinimumWidth(140)
		self.btn_remove_smartCorner.setMinimumWidth(140)
		self.btn_remove_presetCorner.setMinimumWidth(140)

		self.btn_getBuilder.setCheckable(True)
		self.btn_getBuilder.setChecked(False)
		self.btn_findBuilder.setEnabled(False)
		self.btn_apply_round.setEnabled(False)

		self.btn_getBuilder.clicked.connect(lambda: self.getBuilder())
		self.btn_addPreset.clicked.connect(lambda: self.preset_modify(False))
		self.btn_delPreset.clicked.connect(lambda: self.preset_modify(True))
		self.btn_resetPreset.clicked.connect(lambda: self.preset_reset())
		self.btn_loadPreset.clicked.connect(lambda: self.preset_load())
		self.btn_savePreset.clicked.connect(lambda: self.preset_save())

		self.btn_apply_smartCorner.clicked.connect(lambda: self.apply_SmartCorner(False))
		self.btn_remove_smartCorner.clicked.connect(lambda: self.apply_SmartCorner(True))
		self.btn_remove_presetCorner.clicked.connect(lambda: self.remove_SmartCorner())
		
		#self.btn_apply_round.clicked.connect(lambda: self.apply_round())
		self.btn_apply_mitre.clicked.connect(lambda: self.apply_mitre(False))
		self.btn_apply_overlap.clicked.connect(lambda: self.apply_mitre(True))
		self.btn_apply_trap.clicked.connect(lambda: self.apply_trap())
		self.btn_rebuild.clicked.connect(lambda: self.rebuild())

		# -- Preset Table
		self.tab_presets = TRTableView(None)
		self.preset_reset()			

		# -- Build Layout
		self.lay_head.addWidget(QtGui.QLabel('Value Presets:'), 0,0,1,8)
		self.lay_head.addWidget(self.btn_loadPreset,			1,0,1,4)
		self.lay_head.addWidget(self.btn_savePreset,			1,4,1,4)
		self.lay_head.addWidget(self.btn_addPreset,				2,0,1,2)
		self.lay_head.addWidget(self.btn_delPreset,				2,2,1,2)
		self.lay_head.addWidget(self.btn_resetPreset,			2,4,1,4)
		self.lay_head.addWidget(self.tab_presets,				3,0,5,8)

		self.lay_head.addWidget(QtGui.QLabel('Corner Actions:'),10, 0, 1, 8)
		self.lay_head.addWidget(self.btn_apply_round,			11, 0, 1, 2)
		self.lay_head.addWidget(self.btn_apply_mitre,			11, 2, 1, 2)
		self.lay_head.addWidget(self.btn_apply_overlap,			11, 4, 1, 2)
		self.lay_head.addWidget(self.btn_apply_trap,			11, 6, 1, 2)
		self.lay_head.addWidget(self.btn_rebuild,				12, 0, 1, 8)

		self.lay_head.addWidget(QtGui.QLabel('Smart Corner:'),	13,0,1,8)
		self.lay_head.addWidget(QtGui.QLabel('Builder: '),		14,0,1,1)
		self.lay_head.addWidget(self.edt_glyphName,				14,1,1,3)
		self.lay_head.addWidget(self.btn_getBuilder,			14,4,1,2)
		self.lay_head.addWidget(self.btn_findBuilder,			14,6,1,2)
		self.lay_head.addWidget(self.btn_remove_smartCorner,	15,0,1,4)
		self.lay_head.addWidget(self.btn_remove_presetCorner,	15,4,1,4)
		self.lay_head.addWidget(self.btn_apply_smartCorner,		16,0,1,8)

		self.addLayout(self.lay_head)
Exemple #18
0
	def __init__(self):
		super(typerig_Panel, self).__init__()

		# - Init ----------------------------
		#self.setStyleSheet(ss_Toolbox_none)
		self.layers_selected = []
		
		# - Dialogs -------------------------
		self.layer_dialog = dlg_LayerSelect(self, pMode)

		# - Layers --------------------------
		self.chk_ActiveLayer = QtGui.QCheckBox('Active')
		self.chk_Masters = QtGui.QCheckBox('Masters')
		self.chk_Masks = QtGui.QCheckBox('Masks')
		self.chk_Service = QtGui.QCheckBox('Services')
		self.chk_Selected = QtGui.QCheckBox('Selected')

		self.chk_ActiveLayer.setCheckState(QtCore.Qt.Checked)

		self.chk_ActiveLayer.stateChanged.connect(self.layers_refresh)
		self.chk_Masters.stateChanged.connect(self.layers_refresh)
		self.chk_Masks.stateChanged.connect(self.layers_refresh)
		self.chk_Service.stateChanged.connect(self.layers_refresh)
		self.chk_Selected.stateChanged.connect(self.layers_refresh)

		self.layers_refresh()

		# - Glyphs --------------------------
		self.rad_glyph = QtGui.QRadioButton('Glyph')
		self.rad_window = QtGui.QRadioButton('Window')
		self.rad_selection = QtGui.QRadioButton('Selection')
		self.rad_font = QtGui.QRadioButton('Font')
		
		self.rad_glyph.toggled.connect(self.mode_refresh)
		self.rad_window.toggled.connect(self.mode_refresh)
		self.rad_selection.toggled.connect(self.mode_refresh)
		self.rad_font.toggled.connect(self.mode_refresh)
		
		self.rad_glyph.setChecked(True)

		self.rad_glyph.setEnabled(True)
		self.rad_window.setEnabled(True)
		self.rad_selection.setEnabled(True)
		self.rad_font.setEnabled(False)

		self.rad_glyph.setToolTip('Affect current glyph')
		self.rad_window.setToolTip('Affect glyphs in active window')
		self.rad_selection.setToolTip('Affect selected glyphs')
		self.rad_font.setToolTip('Affect the entire font')

		# - Buttons ------------------------
		self.btn_layersSelect = QtGui.QPushButton('Layers')
		self.btn_fold = QtGui.QPushButton('^')
		self.btn_unfold = QtGui.QPushButton('Restore Panel')
		
		self.btn_fold.setFixedHeight(self.chk_ActiveLayer.sizeHint.height()*2.5)
		self.btn_fold.setFixedWidth(self.chk_ActiveLayer.sizeHint.height())
		self.btn_unfold.setFixedHeight(self.chk_ActiveLayer.sizeHint.height() + 5)

		self.btn_fold.setToolTip('Fold Panel.')
		self.btn_unfold.setToolTip('Unfold Panel.')
		self.btn_layersSelect.setToolTip('Select layers for processing.')

		self.btn_fold.clicked.connect(self.fold)
		self.btn_unfold.clicked.connect(self.fold)
		self.flag_fold = False
				
		# - Tabs --------------------------
		panel_vers = {n:OrderedDict([	('Panel', toolName), ('Version', eval('Panel.%s.app_version' %toolName))])
										for n, toolName in enumerate(Panel.modules)} 

		self.options = TRTableView(panel_vers)
		self.options.verticalHeader().hide()

		# -- Dynamically load all tabs
		self.tabs = TRVTabWidget()

		# --- Load all tabs from this directory as modules. Check __init__.py 
		# --- <dirName>.modules tabs/modules manifest in list format
		for toolName in Panel.modules:
			if ignorePanel not in toolName:
				self.tabs.addTab(eval('Panel.%s.tool_tab()' %toolName), toolName)

		# --- Add options tab
		self.tabs.addTab(self.options, '...')

		# - Layouts -------------------------------
		layoutV = QtGui.QVBoxLayout() 
		layoutV.setContentsMargins(0,0,0,0)
		
		self.lay_controller = QtGui.QGridLayout()
		self.fr_controller = QtGui.QFrame()
		self.lay_controller.setContentsMargins(15,5,5,3)
		self.lay_controller.setSpacing(5)

		# -- Build layouts -------------------------------
		self.lay_controller.addWidget(self.chk_ActiveLayer,	0, 0, 1, 1)
		self.lay_controller.addWidget(self.chk_Masters, 	0, 1, 1, 1)
		self.lay_controller.addWidget(self.chk_Masks, 		0, 2, 1, 1)
		#self.lay_controller.addWidget(self.chk_Service, 	0, 3, 1, 1)
		self.lay_controller.addWidget(self.chk_Selected, 	0, 3, 1, 1)
		self.lay_controller.addWidget(self.btn_fold, 		0, 4, 2, 1)
		self.lay_controller.addWidget(self.rad_glyph, 		1, 0, 1, 1)
		self.lay_controller.addWidget(self.rad_window, 		1, 1, 1, 1)
		self.lay_controller.addWidget(self.rad_selection, 	1, 2, 1, 1)
		self.lay_controller.addWidget(self.rad_font, 		1, 3, 1, 1)
					 
		layoutV.addWidget(self.btn_unfold)
		self.fr_controller.setLayout(self.lay_controller)
		
		layoutV.addWidget(self.fr_controller)
		layoutV.addWidget(self.tabs)

		self.btn_unfold.hide()

		# - Set Widget -------------------------------
		self.setLayout(layoutV)
		self.setWindowTitle('%s %s' %(app_name, app_version))
		self.setGeometry(100, 100, 300, 600)
		self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!!

		# !!! Hotfix FL7 7355 
		self.setMinimumSize(350, self.sizeHint.height())

		self.show()
Exemple #19
0
	def __init__(self, parentWidget):
		super(WKernGroups, self).__init__()

		# - Init
		self.upper_widget = parentWidget
		self.active_font = pFont()
		self.kern_group_data = {} #self.active_font.kerning_groups_to_dict()

		# - Interface
		lbl_name = QtGui.QLabel('Kerning classes')
		lbl_act = QtGui.QLabel('Actions (selected items):')
		lbl_name.setMaximumHeight(20)
		lbl_act.setMaximumHeight(20)

		self.cmb_layer = QtGui.QComboBox()
		self.cmb_layer.addItems(self.active_font.masters())
		self.cmb_layer.currentIndexChanged.connect(lambda: self.update_data(self.kern_group_data))

		self.btn_apply = QtGui.QPushButton('Apply changes')
		self.btn_write = QtGui.QPushButton('Write changes')
		self.btn_reset = QtGui.QPushButton('Clear Font classes')
		
		self.btn_apply.clicked.connect(lambda: self.apply_changes(False))
		self.btn_write.clicked.connect(lambda: self.apply_changes(True))
		self.btn_reset.clicked.connect(lambda: self.reset_classes())

		self.tab_groupKern = GroupTableView()

		# - Menus & Actions
		# -- Main Database actions
		self.menu_data = QtGui.QMenu('Class Data', self)
		act_data_open = QtGui.QAction('Open TypeRig Classes (JSON)', self)
		act_data_save = QtGui.QAction('Save TypeRig Classes (JSON)', self)
		act_data_import = QtGui.QAction('Import FontLab Classes (JSON)', self)
		act_data_export = QtGui.QAction('Export FontLab Classes (JSON)', self)
		act_data_import_font = QtGui.QAction('Import Classes from Font', self)
		act_data_build_composite = QtGui.QAction('Build Classes from References', self)
		act_data_reset = QtGui.QAction('Reset Font Class Data', self)
		act_data_write = QtGui.QAction('Write class data to Font', self)

		self.menu_data.addAction(act_data_open)
		self.menu_data.addAction(act_data_save)
		self.menu_data.addSeparator()
		self.menu_data.addAction(act_data_import)
		self.menu_data.addAction(act_data_export)
		self.menu_data.addSeparator()
		self.menu_data.addAction(act_data_import_font)
		self.menu_data.addAction(act_data_build_composite)
		self.menu_data.addSeparator()
		self.menu_data.addAction(act_data_reset)
		self.menu_data.addAction(act_data_write)

		act_data_open.triggered.connect(lambda: self.file_load_groups(True))
		act_data_save.triggered.connect(lambda: self.file_save_groups(True))
		act_data_import.triggered.connect(lambda: self.file_load_groups(False))
		#act_data_export.triggered.connect()
		act_data_import_font.triggered.connect(lambda: self.from_font())
		act_data_build_composite.triggered.connect(lambda: self.from_composites())
		act_data_reset.triggered.connect(lambda: self.reset_classes())
		act_data_write.triggered.connect(lambda: self.apply_changes(True))

		# -- Main Class actions
		self.menu_class = QtGui.QMenu('Class Management', self)
		act_class_add = QtGui.QAction('Add new class', self)
		act_class_find = QtGui.QAction('Find and replace class names', self)
		act_class_copy = QtGui.QAction('Duplicate classes', self)
		act_class_merge = QtGui.QAction('Merge classes to new', self)
		act_class_mdel = QtGui.QAction('Merge and remove classes', self)
		act_class_del = QtGui.QAction('Remove classes', self)

		self.menu_class.addAction(act_class_add)
		self.menu_class.addAction(act_class_find)
		self.menu_class.addAction(act_class_copy)
		self.menu_class.addAction(act_class_merge)
		self.menu_class.addAction(act_class_mdel)
		self.menu_class.addAction(act_class_del)

		act_class_add.triggered.connect(lambda: self.class_add_new())
		act_class_find.triggered.connect(lambda: self.class_find_replace())
		act_class_copy.triggered.connect(lambda: self.class_copy())
		act_class_merge.triggered.connect(lambda: self.class_merge(False))
		act_class_mdel.triggered.connect(lambda: self.class_merge(True))
		act_class_del.triggered.connect(lambda: self.class_del())
		
		# -- Change class type
		self.menu_type = QtGui.QMenu('Class Type', self)
		act_type_Left = QtGui.QAction('Set KernLeft (1st)', self)
		act_type_Right = QtGui.QAction('Set KernRight (2nd)', self)
		act_type_Both = QtGui.QAction('Set KernBothSide (1st and 2nd)', self)
		act_type_toggle = QtGui.QAction('Toggle class type', self)
		
		act_type_Left.triggered.connect(lambda: self.set_type('KernLeft'))
		act_type_Right.triggered.connect(lambda: self.set_type('KernRight'))
		act_type_Both.triggered.connect(lambda: self.set_type('KernBothSide'))
		act_type_toggle.triggered.connect(lambda: self.toggle_type())

		self.menu_type.addAction(act_type_Left)
		self.menu_type.addAction(act_type_Right)
		self.menu_type.addAction(act_type_Both)
		self.menu_type.addAction(act_type_toggle)

		# -- Modify Members
		self.menu_memb = QtGui.QMenu('Class Members', self)
		act_memb_sel = QtGui.QAction('Select Glyphs', self)
		act_memb_clean = QtGui.QAction('Cleanup', self)
		act_memb_upper = QtGui.QAction('Members to uppercase', self)
		act_memb_lower = QtGui.QAction('Members to lowercase', self)
		act_memb_strip = QtGui.QAction('Strip member suffixes', self)
		act_memb_suff = QtGui.QAction('Add suffix to members', self)
		act_memb_addglyphs = QtGui.QAction('Selected glyphs to members', self)

		act_memb_sel.triggered.connect(lambda: self.memb_select())
		act_memb_clean.triggered.connect(lambda: self.memb_cleanup())
		act_memb_upper.triggered.connect(lambda: self.memb_change_case(True))
		act_memb_lower.triggered.connect(lambda: self.memb_change_case(False))
		act_memb_strip.triggered.connect(lambda: self.memb_stripSuffix())
		act_memb_suff.triggered.connect(lambda: self.memb_addSuffix())
		act_memb_addglyphs.triggered.connect(lambda: self.memb_addGlyphs())

		self.menu_memb.addAction(act_memb_sel)
		self.menu_memb.addAction(act_memb_clean)
		self.menu_memb.addAction(act_memb_upper)
		self.menu_memb.addAction(act_memb_lower)
		self.menu_memb.addAction(act_memb_strip)
		self.menu_memb.addAction(act_memb_suff)		
		self.menu_memb.addAction(act_memb_addglyphs)

		# -- MACOS buttons menu
		self.btn_mac_data_open = QtGui.QPushButton('Open')
		self.btn_mac_data_save = QtGui.QPushButton('Save')
		self.btn_mac_data_import = QtGui.QPushButton('Import')
		self.btn_mac_data_export = QtGui.QPushButton('Export')
		self.btn_mac_data_import_font = QtGui.QPushButton('From Font')
		self.btn_mac_data_build_composite = QtGui.QPushButton('Auto Build Classes')

		self.btn_mac_data_open.clicked.connect(lambda: self.file_load_groups(True))
		self.btn_mac_data_save.clicked.connect(lambda: self.file_save_groups(True))
		self.btn_mac_data_import.clicked.connect(lambda: self.file_load_groups(False))
		#self.btn_mac_data_export.clicked.connect()
		self.btn_mac_data_import_font.clicked.connect(lambda: self.from_font())
		self.btn_mac_data_build_composite.clicked.connect(lambda: self.from_composites())

		# - Table auto preview selection
		self.chk_preview = QtGui.QCheckBox('Auto select/preview class.')
		self.tab_groupKern.selectionModel().selectionChanged.connect(lambda: self.auto_preview())
		
		# - Build 	
		self.lay_grid = QtGui.QGridLayout()
		self.lay_grid.addWidget(lbl_name,		 					0, 0, 1, 42)
		self.lay_grid.addWidget(QtGui.QLabel('Master:'),			0, 40, 1, 2)
		self.lay_grid.addWidget(self.cmb_layer,						0, 42, 1, 6)
		self.lay_grid.addWidget(self.tab_groupKern,					1, 0, 11, 42)
		self.lay_grid.addWidget(self.btn_apply,						1, 42, 1, 6)
		self.lay_grid.addWidget(self.chk_preview,					2, 42, 1, 6)
		
		# -- MAC buttons
		if system() == 'Darwin':
			self.lay_grid.addWidget(self.btn_mac_data_open,				4, 42, 1, 3)	
			self.lay_grid.addWidget(self.btn_mac_data_save,				4, 45, 1, 3)	
			self.lay_grid.addWidget(self.btn_mac_data_import,			5, 42, 1, 3)	
			self.lay_grid.addWidget(self.btn_mac_data_export,			5, 45, 1, 3)	
			self.lay_grid.addWidget(self.btn_mac_data_import_font,		6, 42, 1, 6)
			self.lay_grid.addWidget(self.btn_mac_data_build_composite,	8, 42, 1, 6)			

		self.lay_grid.addWidget(self.btn_reset,						10, 42, 1, 6)
		self.lay_grid.addWidget(self.btn_write,						11, 42, 1, 6)

		self.setLayout(self.lay_grid)