def __init__(self): super(metrics_expr, self).__init__() self.edt_lsb = MLineEdit() self.edt_adv = MLineEdit() self.edt_rsb = MLineEdit() self.edt_lsb.setPlaceholderText('Metric expression') self.edt_adv.setPlaceholderText('Metric expression') self.edt_rsb.setPlaceholderText('Metric expression') self.btn_setMetrics = QtGui.QPushButton('&Set expressions') self.btn_getShapeParent = QtGui.QPushButton('&Get reference') self.btn_delMetrics = QtGui.QPushButton('&Unlink') self.btn_autoBind = QtGui.QPushButton('&Auto bind Metric expressions') self.btn_autoBind.setToolTip( 'Automatically bind metric expressions from available element references.' ) self.btn_setMetrics.clicked.connect( lambda: self.setMetricEquations(False)) self.btn_delMetrics.clicked.connect( lambda: self.setMetricEquations(True)) self.btn_getShapeParent.clicked.connect(self.bindShapeParent) self.btn_autoBind.clicked.connect(self.autoMetricEquations) self.spb_shapeIndex = QtGui.QSpinBox() self.addWidget(QtGui.QLabel('LSB:'), 0, 0, 1, 1) self.addWidget(self.edt_lsb, 0, 1, 1, 5) self.addWidget(QtGui.QLabel('RSB:'), 1, 0, 1, 1) self.addWidget(self.edt_rsb, 1, 1, 1, 5) self.addWidget(QtGui.QLabel('ADV:'), 2, 0, 1, 1) self.addWidget(self.edt_adv, 2, 1, 1, 5) self.addWidget(self.btn_setMetrics, 3, 1, 1, 3) self.addWidget(self.btn_delMetrics, 3, 4, 1, 2) self.addWidget(QtGui.QLabel('E:'), 4, 0, 1, 1) self.addWidget(self.btn_getShapeParent, 4, 1, 1, 3) self.addWidget(self.spb_shapeIndex, 4, 4, 1, 2) self.addWidget(QtGui.QLabel('Composite Glyph: Metric expressions'), 5, 0, 1, 5) self.addWidget(self.btn_autoBind, 6, 0, 1, 6) self.setColumnStretch(0, 0) self.setColumnStretch(1, 5)
def __init__(self): super(metrics_adjust, self).__init__() # - Spin Boxes self.spb_lsb_percent = QtGui.QSpinBox() self.spb_adv_percent = QtGui.QSpinBox() self.spb_rsb_percent = QtGui.QSpinBox() self.spb_lsb_units = QtGui.QSpinBox() self.spb_adv_units = QtGui.QSpinBox() self.spb_rsb_units = QtGui.QSpinBox() self.spb_lsb_percent.setMaximum(200) self.spb_adv_percent.setMaximum(200) self.spb_rsb_percent.setMaximum(200) self.spb_lsb_units.setMaximum(200) self.spb_adv_units.setMaximum(200) self.spb_rsb_units.setMaximum(200) self.spb_lsb_units.setMinimum(-200) self.spb_adv_units.setMinimum(-200) self.spb_rsb_units.setMinimum(-200) self.spb_lsb_percent.setSuffix('%') self.spb_adv_percent.setSuffix('%') self.spb_rsb_percent.setSuffix('%') self.spb_lsb_units.setSuffix(' u') self.spb_adv_units.setSuffix(' u') self.spb_rsb_units.setSuffix(' u') self.resetSpinBox() # - Buttons self.btn_adjMetrics = QtGui.QPushButton('&Adjust Metrics') self.btn_resetSpinBox = QtGui.QPushButton('&Reset') self.btn_adjMetrics.clicked.connect(self.adjMetrics) self.btn_resetSpinBox.clicked.connect(self.resetSpinBox) self.addWidget(QtGui.QLabel('LSB adjust:'), 0, 0, 1, 1) self.addWidget(QtGui.QLabel('RSB adjust:'), 0, 1, 1, 1) self.addWidget(QtGui.QLabel('ADV adjust:'), 0, 2, 1, 1) self.addWidget(self.spb_lsb_percent, 1, 0, 1, 1) self.addWidget(self.spb_rsb_percent, 1, 1, 1, 1) self.addWidget(self.spb_adv_percent, 1, 2, 1, 1) self.addWidget(self.spb_lsb_units, 2, 0, 1, 1) self.addWidget(self.spb_rsb_units, 2, 1, 1, 1) self.addWidget(self.spb_adv_units, 2, 2, 1, 1) self.addWidget(self.btn_resetSpinBox, 3, 0, 1, 1) self.addWidget(self.btn_adjMetrics, 3, 1, 1, 2)
def __init__(self): super(QDropGuide, self).__init__() # -- Editi fileds self.edt_guideName = QtGui.QLineEdit() self.edt_guideName.setPlaceholderText('New Guideline') self.edt_guideTag = GLineEdit() self.edt_guideTag.setPlaceholderText('Tag') # -- Combo box self.cmb_select_V = QtGui.QComboBox() self.cmb_select_H = QtGui.QComboBox() self.cmb_select_color = QtGui.QComboBox() self.cmb_select_V.addItems(['BBox width', 'Adv. width']) self.cmb_select_H.addItems([ 'BBox height', 'X-Height', 'Caps Height', 'Ascender', 'Descender', 'Adv. height' ]) colorNames = QtGui.QColor.colorNames() for i in range(len(colorNames)): self.cmb_select_color.addItem(colorNames[i]) self.cmb_select_color.setItemData(i, QtGui.QColor(colorNames[i]), QtCore.Qt.DecorationRole) self.cmb_select_color.setCurrentIndex(colorNames.index('red')) self.cmb_select_color.setMinimumWidth(40) self.edt_guideName.setMinimumWidth(40) self.edt_guideTag.setMinimumWidth(40) # -- SpinBox self.spb_prc_V = QtGui.QSpinBox() self.spb_prc_V.setMaximum(100) self.spb_prc_V.setSuffix('%') self.spb_prc_V.setMinimumWidth(45) self.spb_prc_H = QtGui.QSpinBox() self.spb_prc_H.setMaximum(100) self.spb_prc_H.setSuffix('%') self.spb_prc_H.setMinimumWidth(45) self.spb_unit_V = QtGui.QSpinBox() self.spb_unit_V.setMaximum(100) self.spb_unit_V.setMinimum(-100) self.spb_unit_V.setSuffix(' U') self.spb_unit_V.setMinimumWidth(45) self.spb_unit_H = QtGui.QSpinBox() self.spb_unit_H.setMaximum(100) self.spb_unit_H.setMinimum(-100) self.spb_unit_H.setSuffix(' U') self.spb_unit_H.setMinimumWidth(45) # -- Button self.btn_dropGuide = QtGui.QPushButton('&Drop') self.btn_dropFlipX = QtGui.QPushButton('Drop: Flip &X') self.btn_dropFlipY = QtGui.QPushButton('Drop: Flip &Y') self.btn_dropLayer_V = QtGui.QPushButton('Vertical') self.btn_dropLayer_H = QtGui.QPushButton('Horizontal') self.btn_dropGuide.setToolTip( 'Drop guideline between any two selected nodes.\nIf single node is selected a vertical guide is\ndropped (using the italic angle if present).' ) self.btn_dropFlipX.setToolTip( 'Drop flipped guideline between any two selected nodes.') self.btn_dropFlipY.setToolTip( 'Drop flipped guideline between any two selected nodes.') self.btn_dropGuide.clicked.connect(lambda: self.drop_guide_nodes( (1, 1))) self.btn_dropFlipX.clicked.connect(lambda: self.drop_guide_nodes( (-1, 1))) self.btn_dropFlipY.clicked.connect(lambda: self.drop_guide_nodes( (1, -1))) self.btn_dropLayer_V.clicked.connect(self.drop_guide_V) self.btn_dropLayer_H.clicked.connect(self.drop_guide_H) # - Build self.addWidget(QtGui.QLabel('Name:'), 1, 0, 1, 4) self.addWidget(QtGui.QLabel('Tag:'), 1, 4, 1, 4) self.addWidget(QtGui.QLabel('Color:'), 1, 8, 1, 4) self.addWidget(self.edt_guideName, 2, 0, 1, 4) self.addWidget(self.cmb_select_color, 2, 8, 1, 4) self.addWidget(self.edt_guideTag, 2, 4, 1, 4) self.addWidget(QtGui.QLabel('Selected Nodes:'), 3, 0, 1, 9) self.addWidget(self.btn_dropGuide, 4, 0, 1, 4) self.addWidget(self.btn_dropFlipX, 4, 4, 1, 4) self.addWidget(self.btn_dropFlipY, 4, 8, 1, 4) self.addWidget(QtGui.QLabel('Glyph Layer:'), 5, 0, 1, 9) self.addWidget(self.cmb_select_V, 6, 0, 1, 4) self.addWidget(self.spb_prc_V, 6, 4, 1, 2) self.addWidget(self.spb_unit_V, 6, 6, 1, 2) self.addWidget(self.btn_dropLayer_V, 6, 8, 1, 4) self.addWidget(self.cmb_select_H, 7, 0, 1, 4) self.addWidget(self.spb_prc_H, 7, 4, 1, 2) self.addWidget(self.spb_unit_H, 7, 6, 1, 2) self.addWidget(self.btn_dropLayer_H, 7, 8, 1, 4)
def __init__(self, aux, upperWidget): super(QTextBlockBasic, 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)
def __init__(self): super(metrics_copy, self).__init__() # - Edit Fields self.edt_lsb = QtGui.QLineEdit() self.edt_adv = QtGui.QLineEdit() self.edt_rsb = QtGui.QLineEdit() self.edt_lsb.setPlaceholderText('Glyph Name') self.edt_adv.setPlaceholderText('Glyph Name') self.edt_rsb.setPlaceholderText('Glyph Name') # - Spin Box self.spb_lsb_percent = QtGui.QSpinBox() self.spb_adv_percent = QtGui.QSpinBox() self.spb_rsb_percent = QtGui.QSpinBox() self.spb_lsb_units = QtGui.QSpinBox() self.spb_adv_units = QtGui.QSpinBox() self.spb_rsb_units = QtGui.QSpinBox() self.spb_lsb_percent.setMaximum(200) self.spb_adv_percent.setMaximum(200) self.spb_rsb_percent.setMaximum(200) self.spb_lsb_units.setMaximum(200) self.spb_adv_units.setMaximum(200) self.spb_rsb_units.setMaximum(200) self.spb_lsb_units.setMinimum(-200) self.spb_adv_units.setMinimum(-200) self.spb_rsb_units.setMinimum(-200) self.spb_lsb_percent.setSuffix('%') self.spb_adv_percent.setSuffix('%') self.spb_rsb_percent.setSuffix('%') self.spb_lsb_units.setSuffix(' u') self.spb_adv_units.setSuffix(' u') self.spb_rsb_units.setSuffix(' u') self.spb_lsb_percent.setMaximumWidth(50) self.spb_adv_percent.setMaximumWidth(50) self.spb_rsb_percent.setMaximumWidth(50) self.spb_lsb_units.setMaximumWidth(50) self.spb_adv_units.setMaximumWidth(50) self.spb_rsb_units.setMaximumWidth(50) self.reset_fileds() # - Buttons self.btn_copyMetrics = QtGui.QPushButton('&Copy Metrics') self.btn_copyMetrics.clicked.connect(self.copyMetrics) # - Build self.addWidget(QtGui.QLabel('LSB:'), 0, 0, 1, 1) self.addWidget(self.edt_lsb, 0, 1, 1, 3) self.addWidget(QtGui.QLabel('@'), 0, 4, 1, 1) self.addWidget(self.spb_lsb_percent, 0, 5, 1, 1) self.addWidget(QtGui.QLabel('+'), 0, 6, 1, 1) self.addWidget(self.spb_lsb_units, 0, 7, 1, 1) self.addWidget(QtGui.QLabel('RSB:'), 1, 0, 1, 1) self.addWidget(self.edt_rsb, 1, 1, 1, 3) self.addWidget(QtGui.QLabel('@'), 1, 4, 1, 1) self.addWidget(self.spb_rsb_percent, 1, 5, 1, 1) self.addWidget(QtGui.QLabel('+'), 1, 6, 1, 1) self.addWidget(self.spb_rsb_units, 1, 7, 1, 1) self.addWidget(QtGui.QLabel('ADV:'), 2, 0, 1, 1) self.addWidget(self.edt_adv, 2, 1, 1, 3) self.addWidget(QtGui.QLabel('@'), 2, 4, 1, 1) self.addWidget(self.spb_adv_percent, 2, 5, 1, 1) self.addWidget(QtGui.QLabel('+'), 2, 6, 1, 1) self.addWidget(self.spb_adv_units, 2, 7, 1, 1) self.addWidget(self.btn_copyMetrics, 3, 1, 1, 8)
def __init__(self): super(alignNodes, self).__init__() # - Init self.copyLine = {} # - Buttons self.btn_left = QtGui.QPushButton('Left') self.btn_right = QtGui.QPushButton('Right') self.btn_top = QtGui.QPushButton('Top') self.btn_bottom = QtGui.QPushButton('Bottom') self.btn_bboxCenterX = QtGui.QPushButton('Outline Center X') self.btn_bboxCenterY = QtGui.QPushButton('Outline Center Y') self.btn_peerCenterX = QtGui.QPushButton('Neighbors Center X') self.btn_peerCenterY = QtGui.QPushButton('Neighbors Center Y') self.btn_toAscender = QtGui.QPushButton('Asc.') self.btn_toCapsHeight = QtGui.QPushButton('Caps') self.btn_toDescender = QtGui.QPushButton('Desc.') self.btn_toXHeight = QtGui.QPushButton('X Hgt.') self.btn_toBaseline = QtGui.QPushButton('Base') self.btn_toYpos = QtGui.QPushButton('Y Pos') self.btn_toMpos = QtGui.QPushButton('Measure') self.btn_solveY = QtGui.QPushButton('Lineup Min/Max Y') self.btn_solveX = QtGui.QPushButton('Lineup Min/Max X') self.btn_copy = QtGui.QPushButton('Copy Slope') self.btn_italic = QtGui.QPushButton('Italic') self.btn_pasteMinY = QtGui.QPushButton('Min Y') self.btn_pasteMaxY = QtGui.QPushButton('Max Y') self.btn_pasteFMinY = QtGui.QPushButton('Flip Min') self.btn_pasteFMaxY = QtGui.QPushButton('Flip Max') self.btn_copy.setCheckable(True) self.btn_copy.setChecked(False) self.btn_italic.setCheckable(True) self.btn_italic.setChecked(False) self.btn_solveY.setToolTip('Channel Process selected nodes according to Y values') self.btn_solveX.setToolTip('Channel Process selected nodes according to X values') self.btn_copy.setToolTip('Copy slope between lowest and highest of selected nodes.') self.btn_italic.setToolTip('Use Italic Angle as slope.') self.btn_pasteMinY.setToolTip('Apply slope to selected nodes.\nReference at MIN Y value.') self.btn_pasteMaxY.setToolTip('Apply slope to selected nodes.\nReference at MAX Y value.') self.btn_pasteFMinY.setToolTip('Apply X flipped slope to selected nodes.\nReference at MIN Y value.') self.btn_pasteFMaxY.setToolTip('Apply X flipped slope to selected nodes.\nReference at MAX Y value.') self.btn_toAscender.setToolTip('Send selected nodes to Ascender height.') self.btn_toCapsHeight.setToolTip('Send selected nodes to Caps Height.') self.btn_toDescender.setToolTip('Send selected nodes to Descender height.') self.btn_toXHeight.setToolTip('Send selected nodes to X Height.') self.btn_toBaseline.setToolTip('Send selected nodes to Baseline.') self.btn_toYpos.setToolTip('Send selected nodes to Y coordinate.') self.btn_toMpos.setToolTip('Send selected nodes to Measurment Line.\nSHIFT + Click switch intercept.') self.btn_alignLayer_V = QtGui.QPushButton('Vertical') self.btn_alignLayer_H = QtGui.QPushButton('Horizontal') # - Combo boxes self.cmb_select_V = QtGui.QComboBox() self.cmb_select_H = QtGui.QComboBox() self.cmb_select_V.addItems(['BBox width', 'Adv. width']) self.cmb_select_H.addItems(['BBox height', 'X-Height', 'Caps Height', 'Ascender', 'Descender', 'Adv. height']) # - Spin Boxes self.edt_toYpos = QtGui.QSpinBox() self.edt_toYpos.setToolTip('Destination Y Coordinate') self.edt_toYpos.setMaximum(1500) self.edt_toYpos.setMinimum(-1500) self.spb_prc_V = QtGui.QSpinBox() self.spb_prc_V.setMaximum(100) self.spb_prc_V.setSuffix('%') self.spb_prc_V.setMinimumWidth(40) self.spb_prc_H = QtGui.QSpinBox() self.spb_prc_H.setMaximum(100) self.spb_prc_H.setSuffix('%') self.spb_prc_H.setMinimumWidth(40) self.spb_unit_V = QtGui.QSpinBox() self.spb_unit_V.setMaximum(100) self.spb_unit_V.setMinimum(-100) self.spb_unit_V.setSuffix(' U') self.spb_unit_V.setMinimumWidth(40) self.spb_unit_H = QtGui.QSpinBox() self.spb_unit_H.setMaximum(100) self.spb_unit_H.setMinimum(-100) self.spb_unit_H.setSuffix(' U') self.spb_unit_H.setMinimumWidth(40) # - Properties self.btn_left.setMinimumWidth(40) self.btn_right.setMinimumWidth(40) self.btn_top.setMinimumWidth(40) self.btn_bottom.setMinimumWidth(40) self.btn_pasteFMinY.setMinimumWidth(40) self.btn_pasteFMaxY.setMinimumWidth(40) self.btn_pasteMinY.setMinimumWidth(40) self.btn_pasteMaxY.setMinimumWidth(40) self.btn_toAscender.setMinimumWidth(40) self.btn_toCapsHeight.setMinimumWidth(40) self.btn_toDescender.setMinimumWidth(40) self.btn_toXHeight.setMinimumWidth(40) self.btn_toYpos.setMinimumWidth(40) self.edt_toYpos.setMinimumWidth(20) self.btn_copy.clicked.connect(self.copySlope) self.btn_left.clicked.connect(lambda: self.alignNodes('L')) self.btn_right.clicked.connect(lambda: self.alignNodes('R')) self.btn_top.clicked.connect(lambda: self.alignNodes('T')) self.btn_bottom.clicked.connect(lambda: self.alignNodes('B')) self.btn_solveY.clicked.connect(lambda: self.alignNodes('Y')) self.btn_solveX.clicked.connect(lambda: self.alignNodes('X')) self.btn_pasteMinY.clicked.connect(lambda: self.pasteSlope('MinY')) self.btn_pasteMaxY.clicked.connect(lambda: self.pasteSlope('MaxY')) self.btn_pasteFMinY.clicked.connect(lambda: self.pasteSlope('FLMinY')) self.btn_pasteFMaxY.clicked.connect(lambda: self.pasteSlope('FLMaxY')) self.btn_bboxCenterX.clicked.connect(lambda: self.alignNodes('BBoxCenterX')) self.btn_bboxCenterY.clicked.connect(lambda: self.alignNodes('BBoxCenterY')) self.btn_peerCenterX.clicked.connect(lambda: self.alignNodes('peerCenterX')) self.btn_peerCenterY.clicked.connect(lambda: self.alignNodes('peerCenterY')) self.btn_toAscender.clicked.connect(lambda: self.alignNodes('FontMetrics_0')) self.btn_toCapsHeight.clicked.connect(lambda: self.alignNodes('FontMetrics_1')) self.btn_toDescender.clicked.connect(lambda: self.alignNodes('FontMetrics_2')) self.btn_toXHeight.clicked.connect(lambda: self.alignNodes('FontMetrics_3')) self.btn_toBaseline.clicked.connect(lambda: self.alignNodes('FontMetrics_4')) self.btn_toYpos.clicked.connect(lambda: self.alignNodes('FontMetrics_5')) self.btn_toMpos.clicked.connect(lambda: self.alignNodes('FontMetrics_6')) self.btn_alignLayer_V.clicked.connect(lambda: self.alignNodes('Layer_V')) self.btn_alignLayer_H.clicked.connect(lambda: self.alignNodes('Layer_H')) # - Check box self.chk_slope = QtGui.QPushButton('Intercept') self.chk_slope.setCheckable(True) self.chk_slope.setToolTip('Find intersections of selected font metric\nwith slopes on which selected nodes resign.') # - Build Layout self.addWidget(self.btn_left, 0,0) self.addWidget(self.btn_right, 0,1) self.addWidget(self.btn_top, 0,2) self.addWidget(self.btn_bottom, 0,3) self.addWidget(self.btn_bboxCenterX, 1,0,1,2) self.addWidget(self.btn_bboxCenterY, 1,2,1,2) self.addWidget(self.btn_peerCenterX, 2,0,1,2) self.addWidget(self.btn_peerCenterY, 2,2,1,2) self.addWidget(QtGui.QLabel('Align to Font & Glyph metrics'), 3,0,1,2) self.addWidget(self.btn_toAscender, 4,0,1,1) self.addWidget(self.btn_toCapsHeight, 4,1,1,1) self.addWidget(self.btn_toDescender, 4,2,1,1) self.addWidget(self.btn_toXHeight, 4,3,1,1) self.addWidget(self.btn_toBaseline, 5,0,1,1) self.addWidget(self.edt_toYpos, 5,1,1,1) self.addWidget(self.btn_toYpos, 5,2,1,1) self.addWidget(self.btn_toMpos, 5,3,1,1) self.addWidget(self.chk_slope, 6,0,1,4) #self.addWidget(QtGui.QLabel('Align to Glyph Layer'), 6, 0, 1, 4) self.addWidget(self.cmb_select_V, 7, 0) self.addWidget(self.spb_prc_V, 7, 1) self.addWidget(self.spb_unit_V, 7, 2) self.addWidget(self.btn_alignLayer_V, 7, 3) self.addWidget(self.cmb_select_H, 8, 0) self.addWidget(self.spb_prc_H, 8, 1) self.addWidget(self.spb_unit_H, 8, 2) self.addWidget(self.btn_alignLayer_H, 8, 3) self.addWidget(QtGui.QLabel('Channel processing and slopes'), 9,0,1,4) self.addWidget(self.btn_solveY, 10,0,1,2) self.addWidget(self.btn_solveX, 10,2,1,2) self.addWidget(self.btn_copy, 11,0,1,3) self.addWidget(self.btn_italic, 11,3,1,1) self.addWidget(self.btn_pasteMinY, 12,0,1,1) self.addWidget(self.btn_pasteMaxY, 12,1,1,1) self.addWidget(self.btn_pasteFMinY, 12,2,1,1) self.addWidget(self.btn_pasteFMaxY, 12,3,1,1)