Example #1
0
    def updateConfig(self, app, config) :
        self.updateChanged(self.general_font, config, 'main', 'font', "ttf", (app.loadFont if app else None))
        self.updateChanged(self.general_gdl, config, 'build', 'gdlfile', "gdl", (app.selectLine if app else None))
        self.updateChanged(self.general_tests, config, 'main', 'testsfile', "xml", (app.loadTests if app else None))

        self.cbChanged(self.general_rtl, config, 'main', 'defaultrtl')
        self.updateChanged(self.build_apxml, config, 'main', 'ap', "xml", (app.loadAP if app else None))
        #if self.build_apxml.text() :
        if self.build_gdlinc.text() :
            config.set('build', 'usemakegdl', "1")
            self.updateChanged(self.build_gdlinc, config, 'build', 'makegdlfile', "gdl")
            config.set('build', 'attpass', str(self.build_att.value()))
            self.cbChanged(self.build_apronly, config, 'build', 'apronly')
            txt = self.build_cmd.text()
            if txt :
                config.set('build', 'makegdlcmd', txt)
            elif config.has_option('build', 'makegdlcmd') :
                config.remove_option('build', 'makegdlcmd')
        else :
            config.set('build', 'usemakegdl', '0')
            if config.has_option('build', 'makegdlfile') :
                config.remove_option('build', 'makegdlfile')
                self.build_gdlinc.setText("")

        self.updateChanged(self.build_tweak, config, 'build', 'tweakxmlfile',
                None) # TODO
        if self.build_tweak.text() :
            self.updateChanged(self.build_twkgdl, config, 'build', 'tweakgdlfile', "gdl")
            self.updateChanged(self.build_twktest, config, 'build', 'tweakconstraint', "")
            config.set('build', 'tweakpass', str(self.build_twkpass.value()))
            txt = self.build_twktest.text()
            if txt :
                config.set('build', 'tweakconstraint', txt)
                
        appInit = app and app.isInitialized()
   
        if self.ui_size.value() != configintval(config, 'ui', 'textsize') :
            config.set('ui', 'textsize', str(self.ui_size.value()))
            if appInit : app.tab_edit.setSize(self.ui_size.value())
        self.updateChanged(self.ui_editorfont, config, 'ui', 'editorfont', "", \
        				(app.tab_edit.updateFont(self.ui_editorfont.text(), self.ui_size.value()) if appInit else None))
        if self.ui_tabstop.value() != configintval(config, 'ui', 'tabstop') :
            config.set('ui', 'tabstop', str(self.ui_tabstop.value()))
            if appInit : app.tab_edit.updateTabstop(self.ui_tabstop.value())
        
        if self.ui_gsize.value() != configintval(config, 'main', 'size') :
            config.set('main', 'size', str(self.ui_gsize.value()))
            if appInit : app.loadFont(configval(config, 'main', 'font'))
        if self.ui_twsize.value() != configintval(config, 'ui', 'tweakglyphsize') :
            config.set('ui', 'tweakglyphsize', str(self.ui_twsize.value()))
            if appInit : app.setTweakGlyphSize(self.ui_twsize.value())
        if self.ui_apsize.value() != configintval(config, 'ui', 'attglyphsize') :
            config.set('ui', 'attglyphsize', str(self.ui_apsize.value()))
            if appInit : app.setAttGlyphSize(self.ui_apsize.value())
        self.updateChanged(self.ui_sizes, config, 'ui', 'waterfall', "")
        self.cbChanged(self.ui_ent, config, 'ui', 'entities')
        self.cbChanged(self.ui_kernedges,  config, 'ui', 'kernedges')
Example #2
0
 def addTestClicked(self, t = None) :
     gIndex = self.liststack.currentIndex()
     if not t : t = Tweak('', self.app.feats[None].fval, rtl = configintval(self.app.config, 'main', 'defaultrtl'))
     self.appendTweak(t)
     res = self.editTweak(len(self.tweakGroups[gIndex]) - 1)
     if not t.name or not res :
         self.tweakGroups[gIndex].pop()
         self.liststack.widget(gIndex).takeItem(len(self.tweakGroups))
Example #3
0
 def addTestClicked(self, t = None) :
     groupIndex = self.liststack.currentIndex()
     if not t : t = Test('', self.app.feats[None].fval, rtl = configintval(self.app.config, 'main', 'defaultrtl'))
     self.appendTest(t)
     res = self.editTest(len(self.testGroups[groupIndex]) - 1)
     if not t.name or not res :
         self.testGroups[groupIndex].pop()
         self.liststack.widget(groupIndex).takeItem(len(self.testGroups))
Example #4
0
    def setRun(self, test):

        self.runRtl.setChecked(True if test.rtl else False)
        if configintval(self.app.config, 'ui', 'entities'):
            t = as_entities(test.text)
        else:
            t = test.text
        self.runEdit.setPlainText(t)
        self.currFeats = dict(test.feats)
        self.currLang = test.lang
        self.currWidth = test.width
        self.runView.clear()
Example #5
0
    def setRun(self, test) :

        self.runRtl.setChecked(True if test.rtl else False)
        if configintval(self.app.config, 'ui', 'entities') :
            t = as_entities(test.text)
        else :
            t = test.text
        self.runEdit.setPlainText(t)
        self.currFeats = dict(test.feats)
        self.currLang = test.lang
        self.currWidth = test.width
        self.runView.clear()
Example #6
0
    def __init__(self, config, app, parent = None) :
        super(FileTabs, self).__init__(parent)
        self.setActions(app)

        self.tabCloseRequested.connect(self.closeRequest)
        self.setContentsMargins(*Layout.buttonMargins)
        self.currentChanged.connect(self.switchFile)
        self.bbox = QtGui.QWidget(self)
        self.setCornerWidget(self.bbox)
        self.hbox = QtGui.QHBoxLayout()
        self.bbox.setLayout(self.hbox)
        self.hbox.setContentsMargins(*Layout.buttonMargins)
        self.hbox.setSpacing(Layout.buttonSpacing)
        self.hbox.insertStretch(0)
        self.bBuild = QtGui.QToolButton(self.bbox)
        self.bBuild.setDefaultAction(self.aBuild)
        self.hbox.addWidget(self.bBuild)
        self.bSave = QtGui.QToolButton(self.bbox)
        self.bSave.setDefaultAction(self.aSave)
        self.hbox.addWidget(self.bSave)
        self.bAdd = QtGui.QToolButton(self.bbox)
        self.bAdd.setDefaultAction(self.aAdd)
        self.hbox.addWidget(self.bAdd)
        self.currselIndex = None
        self.currselline = 0
        self.app = app
        self.currIndex = -1
        self.size = configintval(config, 'ui', 'textsize') or 14
        self.fontspec = configval(config, 'ui', 'editorfont') or 'mono'
        self.tabstop = configintval(config, 'ui', 'tabstop') or 40
        if self.app.config.has_option('window', 'openfiles') :
            openFileString = configval(config, 'window', 'openfiles')
            self.openFiles = openFileString.split(';')
            self.openFiles.remove('')
        else :
            self.openFiles = []
        self.selectedText = ''
        self.findCaseSens = False
Example #7
0
    def __init__(self, config, app, parent=None):
        super(FileTabs, self).__init__(parent)
        self.setActions(app)

        self.tabCloseRequested.connect(self.closeRequest)
        self.setContentsMargins(*Layout.buttonMargins)
        self.currentChanged.connect(self.switchFile)
        self.bbox = QtGui.QWidget(self)
        self.setCornerWidget(self.bbox)
        self.hbox = QtGui.QHBoxLayout()
        self.bbox.setLayout(self.hbox)
        self.hbox.setContentsMargins(*Layout.buttonMargins)
        self.hbox.setSpacing(Layout.buttonSpacing)
        self.hbox.insertStretch(0)
        self.bBuild = QtGui.QToolButton(self.bbox)
        self.bBuild.setDefaultAction(self.aBuild)
        self.hbox.addWidget(self.bBuild)
        self.bSave = QtGui.QToolButton(self.bbox)
        self.bSave.setDefaultAction(self.aSave)
        self.hbox.addWidget(self.bSave)
        self.bAdd = QtGui.QToolButton(self.bbox)
        self.bAdd.setDefaultAction(self.aAdd)
        self.hbox.addWidget(self.bAdd)
        self.currselIndex = None
        self.currselline = 0
        self.app = app
        self.currIndex = -1
        self.size = configintval(config, 'ui', 'textsize') or 14
        self.fontspec = configval(config, 'ui', 'editorfont') or 'mono'
        self.tabstop = configintval(config, 'ui', 'tabstop') or 40
        if self.app.config.has_option('window', 'openfiles'):
            openFileString = configval(config, 'window', 'openfiles')
            self.openFiles = openFileString.split(';')
            self.openFiles.remove('')
        else:
            self.openFiles = []
        self.selectedText = ''
        self.findCaseSens = False
Example #8
0
 def __init__(self, font, app, apgdlfile, parent = None) :
     super(Classes, self).__init__(parent)
     self.app = app
     self.ronly = configintval(app.config, 'build', 'apronly')
     self.apgdlfile = apgdlfile
     self.vb = QtGui.QVBoxLayout(self)
     self.vb.setContentsMargins(*Layout.buttonMargins)
     self.vb.setSpacing(Layout.buttonSpacing)
     self.tab = QtGui.QTableWidget(self)
     self.vb.addWidget(self.tab)
     self.tab.setColumnCount(2)
     self.tab.cellDoubleClicked.connect(self.doubleClicked)
     self.tab.cellClicked.connect(self.clicked)
     self.tab.horizontalHeader().hide()
     self.tab.verticalHeader().hide()
     self.bbox = QtGui.QWidget(self)
     self.hb = QtGui.QHBoxLayout(self.bbox)
     self.hb.setContentsMargins(*Layout.buttonMargins)
     self.hb.setSpacing(Layout.buttonSpacing)
     self.hb.addStretch()
     self.vb.addWidget(self.bbox)
     self.cButton = QtGui.QToolButton()	# clear highlights
     self.cButton.setIcon(QtGui.QIcon.fromTheme('edit-clear', QtGui.QIcon(":/images/edit-clear.png")))
     self.cButton.clicked.connect(self.clearHighlights)
     self.cButton.setToolTip('Clear glyph highlights')
     self.hb.addWidget(self.cButton)
     if not self.ronly :
         self.aButton = QtGui.QToolButton()
         self.aButton.setIcon(QtGui.QIcon.fromTheme('list-add', QtGui.QIcon(":/images/list-add.png")))
         self.aButton.clicked.connect(self.addClass)
         self.aButton.setToolTip('Add new class')
         self.hb.addWidget(self.aButton)
         self.rButton = QtGui.QToolButton()
         self.rButton.setIcon(QtGui.QIcon.fromTheme('list-remove', QtGui.QIcon(":/images/list-remove.png")))
         self.rButton.clicked.connect(self.delCurrent)
         self.rButton.setToolTip('Remove currently selected class')
         self.hb.addWidget(self.rButton)
     self.fButton = QtGui.QToolButton()	# find class
     self.fButton.setIcon(QtGui.QIcon.fromTheme('edit-find', QtGui.QIcon(":/images/find-normal.png")))
     self.fButton.clicked.connect(self.findSelectedClass)
     self.fButton.setToolTip('Find class selected in source code')
     self.hb.addWidget(self.fButton)
     self.classCount = 0
     self.font = font
     if font :
         self.loadFont(font)
         
     self.selClassName = ''
Example #9
0
    def __init__(self, font, app, apgdlfile, parent=None):
        super(Classes, self).__init__(parent)
        self.app = app
        self.ronly = configintval(app.config, "build", "apronly")
        self.apgdlfile = apgdlfile
        self.vb = QtGui.QVBoxLayout(self)
        self.vb.setContentsMargins(*Layout.buttonMargins)
        self.vb.setSpacing(Layout.buttonSpacing)
        self.tab = QtGui.QTableWidget(self)
        self.vb.addWidget(self.tab)
        self.tab.setColumnCount(2)
        self.tab.cellDoubleClicked.connect(self.doubleClicked)
        self.tab.cellClicked.connect(self.clicked)
        self.tab.horizontalHeader().hide()
        self.tab.verticalHeader().hide()
        self.bbox = QtGui.QWidget(self)
        self.hb = QtGui.QHBoxLayout(self.bbox)
        self.hb.setContentsMargins(*Layout.buttonMargins)
        self.hb.setSpacing(Layout.buttonSpacing)
        self.hb.addStretch()
        self.vb.addWidget(self.bbox)
        self.cButton = QtGui.QToolButton()  # clear highlights
        self.cButton.setIcon(QtGui.QIcon.fromTheme("edit-clear", QtGui.QIcon(":/images/edit-clear.png")))
        self.cButton.clicked.connect(self.clearHighlights)
        self.cButton.setToolTip("Clear glyph highlights")
        self.hb.addWidget(self.cButton)
        if not self.ronly:
            self.aButton = QtGui.QToolButton()
            self.aButton.setIcon(QtGui.QIcon.fromTheme("list-add", QtGui.QIcon(":/images/list-add.png")))
            self.aButton.clicked.connect(self.addClass)
            self.aButton.setToolTip("Add new class")
            self.hb.addWidget(self.aButton)
            self.rButton = QtGui.QToolButton()
            self.rButton.setIcon(QtGui.QIcon.fromTheme("list-remove", QtGui.QIcon(":/images/list-remove.png")))
            self.rButton.clicked.connect(self.delCurrent)
            self.rButton.setToolTip("Remove currently selected class")
            self.hb.addWidget(self.rButton)
        self.fButton = QtGui.QToolButton()  # find class
        self.fButton.setIcon(QtGui.QIcon.fromTheme("edit-find", QtGui.QIcon(":/images/find-normal.png")))
        self.fButton.clicked.connect(self.findSelectedClass)
        self.fButton.setToolTip("Find class selected in source code")
        self.hb.addWidget(self.fButton)
        self.classCount = 0
        self.font = font
        if font:
            self.loadFont(font)

        self.selClassName = ""
Example #10
0
def doGenerate(font, outputfont) :
    if 'GDL_generateFlag' not in font.temporary :
        font.temporary['GDL_generateFlag'] = True
        return
    else :
        del font.temporary['GDL_generateFlag']
    cfg = getcfg(font)
    if not cfg : return
    conf = RawConfigParser()
    conf.read(cfg)
    cwd = os.getcwd()
    os.chdir(os.path.dirname(cfg))
    conf.set('main', 'font', outputfont)
    if configintval(conf, 'build', 'usemakegdl') :
        outname = conf.get('main', 'ap')
        if os.path.exists(outname) : readAP(font, outname)
        mergeAPInfo(font)
        myFfFont = FfFont(font)
        buildGraphite(conf, None, myFfFont, outputfont)
    else :
        buildGraphite(conf, None, None, outputfont)
    writecfg(conf, cfg)
    os.chdir(cwd)
Example #11
0
    def loadCollisionsAux(self, font, json, initRun, gdx) :
        
        prevMoves = {}
        for phaseInfo in json :
            if 'num-loops' in phaseInfo.keys() :
                #print 'num-loops', phaseInfo['num-loops']
                pass
            else :
                phase = phaseInfo["phase"]
                if 'loop' in phaseInfo.keys() :
                    loop = phaseInfo['loop']
                else :
                    loop = -1
                for moveInfo in phaseInfo['moves'] :
                    if 'missed' in moveInfo.keys() :
                        # no collision
                        #print "phase",phase,"loop",loop,"missed",moveInfo['missed']
                        pass
                        
                    elif 'slot' in moveInfo.keys() :
                        fixType = moveInfo['target']['fix']
                        pending = moveInfo['result'] # how much moved so far on this pass
                        slotId = moveInfo['slot']
                        stillBad = moveInfo['stillBad']
                        #print "phase",phase,".",loop,fixType,moveInfo['slot'],adjust
                        
                        # Add a run to reflect this move.
                        
                        nextRun = self.runs[-1].copy()
                        nextRun.clearHighlight()
                        i = nextRun.indexOfId(slotId)
                        #####initOffset = initRun[i].getColValues('offset') # from previous pass
                        
                        if fixType == "kern" :
                            newValue = [pending, 0]
                            #newValuePlus = [pending + int(initOffset[0]), 0]
                        else :
                            newValue = pending
                            #newValuePlus = [pending[0] + int(initOffset[0]), pending[1] + int(initOffset[1])]
                        (i, s) = nextRun.modifySlotWithId(slotId, 'colPending', newValue)

                        if 'vectors' in moveInfo :
                            for vec in moveInfo['vectors'] :
                                k = vec['direction'][0]
                                for rem in vec['removals'] :
                                    j = nextRun.indexOfId(rem[0])
                                    if j > -1 :
                                        nextRun[j].addColRemoves(k, rem)
                                s.addResults(k, vec['ranges'], vec['bestVal'], vec['bestCost'])
                        elif 'slices' in moveInfo and configintval(self.app.config, 'ui', 'kernedges') :
                            shift = moveInfo['result']
                            edges = [None] * len(moveInfo['slices'])
                            others = [None] * len(moveInfo['slices'])
                            for sl in moveInfo['slices'] :
                                edges[sl['i']] = sl['targetEdge'] + shift
                                others[sl['i']] = sl['nearEdge']
                            nextRun.addKernEdge(edges, others, moveInfo['miny'], moveInfo['slicewidth'])
                        if slotId in prevMoves.keys() :
                            changed = (newValue[0] != prevMoves[slotId][0] or newValue[1] != prevMoves[slotId][1])
                        else :
                            changed = (newValue[0] != 0 or newValue[1] != 0)
                        prevMoves[slotId] = newValue
                        
                        if stillBad :
                            s.highlight('input')
                        elif changed :
                            s.highlight('output')
                        else :
                            s.highlight('default')
                            
                        if fixType == "kern" :
                            # Adjust following glyphs
                            nextRun.kernAfter(i, newValue[0])
                        #elif fixType == "shift" :
                        #    s.colShiftPending = adjust
                
                        self.runs.append(nextRun)
                        if phase == "1" and loop == -1 :
                            nextRun.label = "Shift loop: 1"
                        elif phase == "3" :
                            nextRun.label = "Kern"
                        elif phase == "2a" :
                            nextRun.label = "Shift loop: %d (rev)" % (loop+2)
                        else :
                            nextRun.label = "Shift loop: %d" % (loop+2)
                        nextRun.passindex = self.passindex
                        nextRun.ruleindex = -1
Example #12
0
    def updateConfig(self, app, config) :
        self.updateChanged(self.general_font, config, 'main', 'font', "ttf", (app.loadFont if app else None))
        self.updateChanged(self.general_gdl, config, 'build', 'gdlfile', "gdl", (app.selectLine if app else None))
        self.updateChanged(self.general_tests, config, 'main', 'testsfile', "xml", (app.loadTests if app else None))

        self.cbChanged(self.general_rtl, config, 'main', 'defaultrtl')
        self.updateChanged(self.build_apxml, config, 'main', 'ap', "xml", (app.loadAP if app else None))
        #if self.build_apxml.text() :
        if self.build_gdlinc.text() :
            config.set('build', 'usemakegdl', "1")
            self.updateChanged(self.build_gdlinc, config, 'build', 'makegdlfile', "gdl")
            config.set('build', 'attpass', str(self.build_att.value()))
            self.cbChanged(self.build_apronly, config, 'build', 'apronly')
            txt = self.build_cmd.text()
            if txt :
                config.set('build', 'makegdlcmd', txt)
            elif config.has_option('build', 'makegdlcmd') :
                config.remove_option('build', 'makegdlcmd')
        else :
            config.set('build', 'usemakegdl', '0')
            if config.has_option('build', 'makegdlfile') :
                config.remove_option('build', 'makegdlfile')
                self.build_gdlinc.setText("")
                
        if self.build_noWarning.text() :
            tempVal = self.build_noWarning.text()
            tempVal = tempVal.replace(' ','')
            config.set('build', 'ignorewarnings', tempVal)
        else :
            if config.has_option('build', 'ignorewarnings') :
                config.remove_option('build', 'ignorewarnings')

        self.updateChanged(self.build_tweak, config, 'build', 'tweakxmlfile',
                None) # TODO
        if self.build_tweak.text() :
            self.updateChanged(self.build_twkgdl, config, 'build', 'tweakgdlfile', "gdl")
            self.updateChanged(self.build_twktest, config, 'build', 'tweakconstraint', "")
            config.set('build', 'tweakpass', str(self.build_twkpass.value()))
            txt = self.build_twktest.text()
            if txt :
                config.set('build', 'tweakconstraint', txt)
                
        appInit = app and app.isInitialized()
   
        if self.ui_size.value() != configintval(config, 'ui', 'textsize') :
            config.set('ui', 'textsize', str(self.ui_size.value()))
            if appInit : app.tab_edit.setSize(self.ui_size.value())
        self.updateChanged(self.ui_editorfont, config, 'ui', 'editorfont', "", \
        				(app.tab_edit.updateFont(self.ui_editorfont.text(), self.ui_size.value()) if appInit else None))
        if self.ui_tabstop.value() != configintval(config, 'ui', 'tabstop') :
            config.set('ui', 'tabstop', str(self.ui_tabstop.value()))
            if appInit : app.tab_edit.updateTabstop(self.ui_tabstop.value())
        
        if self.ui_gsize.value() != configintval(config, 'main', 'size') :
            config.set('main', 'size', str(self.ui_gsize.value()))
            if appInit : app.loadFont(configval(config, 'main', 'font'))
        if self.ui_twsize.value() != configintval(config, 'ui', 'tweakglyphsize') :
            config.set('ui', 'tweakglyphsize', str(self.ui_twsize.value()))
            if appInit : app.setTweakGlyphSize(self.ui_twsize.value())
        if self.ui_apsize.value() != configintval(config, 'ui', 'attglyphsize') :
            config.set('ui', 'attglyphsize', str(self.ui_apsize.value()))
            if appInit : app.setAttGlyphSize(self.ui_apsize.value())
        self.updateChanged(self.ui_sizes, config, 'ui', 'waterfall', "")
        self.cbChanged(self.ui_ent, config, 'ui', 'entities')
        self.cbChanged(self.ui_kernedges,  config, 'ui', 'kernedges')
Example #13
0
    def editDialog(self, parent, isTweak=False):
        self.parent = parent
        self.featDialog = None

        dlg = QtGui.QDialog()
        topWidget = QtGui.QWidget(dlg)
        hboxLayout = QtGui.QHBoxLayout()
        topWidget.setLayout(hboxLayout)
        gridLayout = QtGui.QGridLayout()
        gridLayout.addWidget(topWidget, 4, 1)
        dlg.setLayout(gridLayout)

        gridLayout.addWidget(QtGui.QLabel('Name:', dlg), 0, 0)
        editName = QtGui.QLineEdit(self.name, dlg)
        gridLayout.addWidget(editName, 0, 1)
        gridLayout.addWidget(QtGui.QLabel('Text:', dlg), 1, 0)
        if configintval(parent.config, 'ui', 'entities'):
            t = as_entities(self.text)
        else:
            t = self.text
        editText = QtGui.QPlainTextEdit(t, dlg)
        editText.setMaximumHeight(Layout.runEditHeight)
        gridLayout.addWidget(editText, 1, 1)
        gridLayout.addWidget(QtGui.QLabel('Comment:', dlg), 2, 0)
        editComment = QtGui.QPlainTextEdit()
        editComment.setPlainText(self.comment)
        editComment.setMaximumHeight(Layout.runEditHeight)
        gridLayout.addWidget(editComment, 2, 1)
        cbRTL = QtGui.QCheckBox('RTL', dlg)
        cbRTL.setChecked(self.rtl)
        gridLayout.addWidget(cbRTL, 3, 1)

        colourButton = QtGui.QToolButton(topWidget)
        colourButton.setIcon(
            QtGui.QIcon.fromTheme(
                'background', QtGui.QIcon(":/images/format-fill-color.png")))
        colourButton.setToolTip('Set background colour')
        colourButton.clicked.connect(self.doColour)
        hboxLayout.addWidget(colourButton)

        featButton = QtGui.QPushButton('Features', topWidget)
        hboxLayout.addWidget(featButton)

        hboxWidget = QtGui.QWidget(
            dlg)  # generic widget containing the OK/Cancel buttons
        hboxButtonLo = QtGui.QHBoxLayout()
        hboxWidget.setLayout(hboxButtonLo)
        gridLayout.addWidget(hboxWidget, 5, 1)

        buttonOk = QtGui.QPushButton('OK', hboxWidget)
        hboxButtonLo.addWidget(buttonOk)
        buttonCancel = QtGui.QPushButton('Cancel', hboxWidget)
        hboxButtonLo.addWidget(buttonCancel)

        if (self.name == ""):
            dlg.setWindowTitle("Add new tweak" if isTweak else "Add new test")
        else:
            dlg.setWindowTitle("Edit tweak" if isTweak else "Edit test")

        featButton.clicked.connect(self.featClicked)
        buttonOk.clicked.connect(dlg.accept)
        buttonCancel.clicked.connect(dlg.reject)

        res = dlg.exec_()
        if res:
            self.name = editName.text()
            self.text = editText.toPlainText()
            self.rtl = cbRTL.isChecked()
            self.comment = editComment.toPlainText()
            if self.featDialog:
                self.lang = self.featDialog.get_lang()
                if self.lang not in self.parent.feats:  # default feats for language are owned by the MainWindow
                    self.lang = None
                self.feats = self.featDialog.get_feats(
                    self.parent.feats[self.lang])
                self.width = self.featDialog.get_width()
        del self.featDialog
        del self.parent
        return res
Example #14
0
    def editDialog(self, parent, isTweak = False) :
        self.parent = parent
        self.featDialog = None
        
        dlg = QtGui.QDialog()
        topWidget = QtGui.QWidget(dlg)
        hboxLayout = QtGui.QHBoxLayout()
        topWidget.setLayout(hboxLayout)
        gridLayout = QtGui.QGridLayout()
        gridLayout.addWidget(topWidget, 4, 1)
        dlg.setLayout(gridLayout)
        
        gridLayout.addWidget(QtGui.QLabel('Name:', dlg), 0, 0)
        editName = QtGui.QLineEdit(self.name, dlg)
        gridLayout.addWidget(editName, 0, 1)
        gridLayout.addWidget(QtGui.QLabel('Text:', dlg), 1, 0)
        if configintval(parent.config, 'ui', 'entities') :
            t = as_entities(self.text)
        else :
            t = self.text
        editText = QtGui.QPlainTextEdit(t, dlg)
        editText.setMaximumHeight(Layout.runEditHeight)
        gridLayout.addWidget(editText, 1, 1)
        gridLayout.addWidget(QtGui.QLabel('Comment:', dlg), 2, 0)
        editComment = QtGui.QPlainTextEdit()
        editComment.setPlainText(self.comment)
        editComment.setMaximumHeight(Layout.runEditHeight)
        gridLayout.addWidget(editComment, 2, 1)
        cbRTL = QtGui.QCheckBox('RTL', dlg)
        cbRTL.setChecked(self.rtl)
        gridLayout.addWidget(cbRTL, 3, 1)

        colourButton = QtGui.QToolButton(topWidget)
        colourButton.setIcon(QtGui.QIcon.fromTheme('background', QtGui.QIcon(":/images/format-fill-color.png")))
        colourButton.setToolTip('Set background colour')
        colourButton.clicked.connect(self.doColour)
        hboxLayout.addWidget(colourButton)
        
        featButton = QtGui.QPushButton('Features', topWidget)
        hboxLayout.addWidget(featButton)
        
        hboxWidget = QtGui.QWidget(dlg)  # generic widget containing the OK/Cancel buttons
        hboxButtonLo = QtGui.QHBoxLayout()
        hboxWidget.setLayout(hboxButtonLo)
        gridLayout.addWidget(hboxWidget, 5, 1)
        
        buttonOk = QtGui.QPushButton('OK', hboxWidget)
        hboxButtonLo.addWidget(buttonOk)
        buttonCancel = QtGui.QPushButton('Cancel', hboxWidget)
        hboxButtonLo.addWidget(buttonCancel)
        
        if (self.name == "") :
            dlg.setWindowTitle("Add new tweak" if isTweak else "Add new test")
        else :
            dlg.setWindowTitle("Edit tweak" if isTweak else "Edit test")
            
        featButton.clicked.connect(self.featClicked)
        buttonOk.clicked.connect(dlg.accept)
        buttonCancel.clicked.connect(dlg.reject)
        
        res = dlg.exec_()
        if res :
            self.name = editName.text()
            self.text = editText.toPlainText()
            self.rtl = cbRTL.isChecked()
            self.comment = editComment.toPlainText()
            if self.featDialog :
                self.lang = self.featDialog.get_lang()
                if self.lang not in self.parent.feats : # default feats for language are owned by the MainWindow
                    self.lang = None
                self.feats = self.featDialog.get_feats(self.parent.feats[self.lang])
                self.width = self.featDialog.get_width()
        del self.featDialog
        del self.parent
        return res
Example #15
0
    def initializeLayout(self, xmlFile):
        vsplitter = QtGui.QSplitter()  # allows sizing of results view
        vsplitter.setOrientation(QtCore.Qt.Vertical)
        vsplitter.setContentsMargins(0, 0, 0, 0)
        vsplitter.setHandleWidth(4)
        self.layout.addWidget(vsplitter)

        self.widget = QtGui.QWidget(vsplitter)
        vbox = QtGui.QVBoxLayout(self.widget)  # MatchList + input control
        vbox.setContentsMargins(*Layout.buttonMargins)
        vbox.setSpacing(Layout.buttonSpacing)

        hbox = QtGui.QHBoxLayout(
        )  # just in case we want to add more buttons here
        vbox.addLayout(hbox)
        plabel = QtGui.QLabel("Search pattern:")
        hbox.addWidget(plabel)
        hbox.addStretch()
        hbox.setContentsMargins(*Layout.buttonMargins)
        hbox.setSpacing(Layout.buttonSpacing)
        searchGo = QtGui.QToolButton(self.widget)
        searchGo.setDefaultAction(self.aSearchGo)
        hbox.addWidget(searchGo)

        self.patternEdit = TextEditReturn(self.widget, self)
        self.patternEdit.setMaximumHeight(Layout.runEditHeight)
        vbox.addWidget(self.patternEdit)
        vbox.addSpacing(5)

        self.matchList = MatchList(self.app, self.font, xmlFile, self)
        #self.matchList.itemClicked.connect(self.itemClicked)
        vbox.addWidget(self.matchList)

        # line below MatchList
        line = QtGui.QFrame(self.widget)
        line.setFrameStyle(QtGui.QFrame.HLine | QtGui.QFrame.Raised)
        line.setLineWidth(2)
        vbox.addWidget(line)
        vbox.addSpacing(2)

        # input control
        self.runEdit = QtGui.QPlainTextEdit(self.widget)
        self.runEdit.setMaximumHeight(Layout.runEditHeight)
        vbox.addWidget(self.runEdit)

        # control buttons
        hbox = QtGui.QHBoxLayout()
        vbox.addLayout(hbox)
        hbox.setContentsMargins(*Layout.buttonMargins)
        hbox.setSpacing(Layout.buttonSpacing)
        runGo = QtGui.QToolButton(self.widget)
        runGo.setDefaultAction(self.aRunGo)
        hbox.addWidget(runGo)
        hbox.addStretch()
        self.runRtl = QtGui.QCheckBox("RTL", self.widget)
        self.runRtl.setChecked(True if configintval(self.app.config, 'main',
                                                    'defaultrtl') else False)
        self.runRtl.setToolTip("Process text right to left")
        hbox.addWidget(self.runRtl)
        self.runFeats = QtGui.QToolButton(self.widget)
        #self.runFeats.setDefaultAction(self.aRunFeats)
        hbox.addWidget(self.runFeats)
        #runAdd = QtGui.QToolButton(self.widget)
        #runAdd.setDefaultAction(self.aRunAdd)
        #hbox.addWidget(runAdd)

        # test output
        self.run = Run(self.font, self.runRtl.isChecked())
        self.runView = RunView(self.font)
        self.runView.gview.resize(self.runView.gview.width(),
                                  self.font.pixrect.height() + 5)
        vsplitter.addWidget(self.runView.gview)
Example #16
0
    def initializeLayout(self, xmlFile) :
        vsplitter = QtGui.QSplitter()  # allows sizing of results view
        vsplitter.setOrientation(QtCore.Qt.Vertical)
        vsplitter.setContentsMargins(0, 0, 0, 0)
        vsplitter.setHandleWidth(4)
        self.layout.addWidget(vsplitter)
        
        self.widget = QtGui.QWidget(vsplitter)
        vbox = QtGui.QVBoxLayout(self.widget) # MatchList + input control
        vbox.setContentsMargins(*Layout.buttonMargins)
        vbox.setSpacing(Layout.buttonSpacing)
        
        hbox = QtGui.QHBoxLayout()  # just in case we want to add more buttons here
        vbox.addLayout(hbox)
        plabel = QtGui.QLabel("Search pattern:")
        hbox.addWidget(plabel)        
        hbox.addStretch()
        hbox.setContentsMargins(*Layout.buttonMargins)
        hbox.setSpacing(Layout.buttonSpacing)
        searchGo = QtGui.QToolButton(self.widget)
        searchGo.setDefaultAction(self.aSearchGo)
        hbox.addWidget(searchGo)
    
        self.patternEdit = TextEditReturn(self.widget, self)
        self.patternEdit.setMaximumHeight(Layout.runEditHeight)
        vbox.addWidget(self.patternEdit)
        vbox.addSpacing(5)
        
        self.matchList = MatchList(self.app, self.font, xmlFile, self)
        #self.matchList.itemClicked.connect(self.itemClicked)
        vbox.addWidget(self.matchList)

        # line below MatchList
        line = QtGui.QFrame(self.widget)
        line.setFrameStyle(QtGui.QFrame.HLine | QtGui.QFrame.Raised)
        line.setLineWidth(2)
        vbox.addWidget(line)
        vbox.addSpacing(2)
        
        # input control
        self.runEdit = QtGui.QPlainTextEdit(self.widget)
        self.runEdit.setMaximumHeight(Layout.runEditHeight)
        vbox.addWidget(self.runEdit)
        
        # control buttons
        hbox = QtGui.QHBoxLayout()
        vbox.addLayout(hbox)
        hbox.setContentsMargins(*Layout.buttonMargins)
        hbox.setSpacing(Layout.buttonSpacing)
        runGo = QtGui.QToolButton(self.widget)
        runGo.setDefaultAction(self.aRunGo)
        hbox.addWidget(runGo)
        hbox.addStretch()
        self.runRtl = QtGui.QCheckBox("RTL", self.widget)
        self.runRtl.setChecked(True if configintval(self.app.config, 'main', 'defaultrtl') else False)
        self.runRtl.setToolTip("Process text right to left")
        hbox.addWidget(self.runRtl)
        self.runFeats = QtGui.QToolButton(self.widget)
        #self.runFeats.setDefaultAction(self.aRunFeats)
        hbox.addWidget(self.runFeats)
        #runAdd = QtGui.QToolButton(self.widget)
        #runAdd.setDefaultAction(self.aRunAdd)
        #hbox.addWidget(runAdd)
    
        # test output
        self.run = Run(self.font, self.runRtl.isChecked())
        self.runView = RunView(self.font)
        self.runView.gview.resize(self.runView.gview.width(), self.font.pixrect.height() + 5)
        vsplitter.addWidget(self.runView.gview)
Example #17
0
 def updateFromConfigSettings(self, fontname, config) :
     self.fontname = fontname
     self.setFont(configintval(config, 'ui', 'tweakglyphsize'))
     self._createRunView()
Example #18
0
    def __init__(self, config, currTab, parent = None) :
        super(ConfigDialog, self).__init__(parent)
        self.config = config
        
        self.setWindowTitle("Configure project")

        vboxLayout = QtGui.QVBoxLayout(self)
        self.tb = QtGui.QToolBox(self)
        vboxLayout.addWidget(self.tb)
        self.ok = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
        self.ok.accepted.connect(self.accept)
        self.ok.rejected.connect(self.reject)
        vboxLayout.addWidget(self.ok)

        # General section
        self.general = QtGui.QWidget(self.tb)
        genGridLay = QtGui.QGridLayout(self.general)
#        self.general_vb.setVerticalSpacing(0)
        self.general_font = FileEntry(self.general, configval(config, 'main', 'font'), 'Font Files (*.ttf)')
        genGridLay.addWidget(QtGui.QLabel('Font File:'), 0, 0)
        genGridLay.addWidget(self.general_font, 0, 1, 1, 2)
        self.general_gdl = FileEntry(self.general, configval(config, 'build', 'gdlfile'), 'GDL Files (*.gdl)')
        genGridLay.addWidget(QtGui.QLabel('GDL File:'), 1, 0)
        genGridLay.addWidget(self.general_gdl, 1, 1, 1, 2)
        self.general_tests = FileEntry(self.general, configval(config, 'main', 'testsfile'), 'Tests Lists (*.xml)')
        genGridLay.addWidget(QtGui.QLabel('Tests File:'), 2, 0)
        genGridLay.addWidget(self.general_tests, 2, 1, 1, 2)
        self.general_rtl = QtGui.QCheckBox()
        self.general_rtl.setChecked(configintval(config, 'main', 'defaultrtl'))
        genGridLay.addWidget(QtGui.QLabel('Default RTL'), 3, 0)
        genGridLay.addWidget(self.general_rtl, 3, 1)
        genGridLay.setRowStretch(4, 1)
        self.tb.addItem(self.general, "General")

        # Build section
        # column 0 = main sub-section labels, column 1 - indented labels, column 2 = control for main sub-section,
        # column 3 = controls for indented stuff
        self.build = QtGui.QWidget(self.tb)
        buildGridLo = QtGui.QGridLayout(self.build)
        
        # makegdl / attachment point generation
        #self.build_apxml = FileEntry(self.general, configval(config, 'main', 'ap'), 'AP Files (*.xml)')
        #self.build_apxml.textChanged.connect(self.apChanged)
        #buildGridLo.addWidget(QtGui.QLabel('Attachment point database:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        #buildGridLo.addWidget(self.build_apxml, 0, 2)

        self.build_gdlinc = FileEntry(self.general, configval(config, 'build', 'makegdlfile'), 'GDL Files (*.gdl *.gdh)')
        self.build_gdlinc.textChanged.connect(self.apChanged)
        buildGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        buildGridLo.addWidget(self.build_gdlinc, 0, 2)
        
        # sub-controls for AP generation, enabled or disabled as a unit
        self.build_apctrls = QtGui.QWidget(self.build) 
        buildGridLo.addWidget(self.build_apctrls, 1, 0, 1, 3)
        apGridLo = QtGui.QGridLayout(self.build_apctrls)
        apGridLo.setColumnMinimumWidth(0, 125) # !!! Make the columns in this control match build_twkgrid !!!
        apGridLo.setColumnMinimumWidth(1, 20)
        
        self.build_cmd = QtGui.QLineEdit(self.build_apctrls)
        self.build_cmd.setMinimumWidth(250)
        self.build_cmd.setText(configval(config, 'build', 'makegdlcmd'))
        self.build_cmd.setToolTip('External make gdl command: %a=AP Database, %f=Font File, %g=Generated GDL File,\n    %i=included GDL file %p=positioning pass number')
        apGridLo.addWidget(QtGui.QLabel('Make GDL Command:'), 0, 0)
        apGridLo.addWidget(self.build_cmd, 0, 2, 1, columnSpan = 3) # cols 1-3
        
        #self.build_gdlinc = FileEntry(self.build_apctrls, configval(config, 'build', 'makegdlfile'), 'GDL Files (*.gdl *.gdh)')
        #self.build_gdlinc.setMinimumWidth(250)
        #apGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 2, 0, 1, columnSpan = 2) # cols 0-1
        #apGridLo.addWidget(self.build_gdlinc, 2, 2, 1, columnSpan = 2) # cols 2-3
        
        self.build_apxml = FileEntry(self.build_apctrls, configval(config, 'main', 'ap'), 'AP Files (*.xml)')
        self.build_apxml.setMinimumWidth(250)
        apGridLo.addWidget(QtGui.QLabel('Attachment point database:'), 1, 0, 1, columnSpan = 2) # cols 0-1
        apGridLo.addWidget(self.build_apxml, 1, 2, 1, columnSpan = 2) # cols 2-3
        
        self.build_apronly = QtGui.QCheckBox()
        self.build_apronly.setChecked(configintval(config, 'build', 'apronly'))
        self.build_apronly.setDisabled(True)  # mechanism to update AP file from Graide is not reliable
        apGridLo.addWidget(QtGui.QLabel('AP Database is read-only:'), 2, 0, 1, columnSpan = 2) # cols 0-1
        apGridLo.addWidget(self.build_apronly, 2, 2)
        
        self.build_att = PassSpin(self.build_apctrls)
        attpass = configval(config, 'build', 'attpass')
        if attpass :
            self.build_att.setValue(int(attpass))
        apGridLo.addWidget(QtGui.QLabel('Attachment positioning pass:'******'build', 'tweakxmlfile'), 'Tweak Files (*.xml)')
        self.build_tweak.textChanged.connect(self.tweakFileChanged)
        buildGridLo.addWidget(QtGui.QLabel('Position tweaker file'), 4, 0, 1, columnSpan = 2) # cols 0-1
        buildGridLo.addWidget(self.build_tweak, 4, 2)
        # sub-controls for AP generation, enabled or disabled as a unit
        self.build_twkctrls = QtGui.QWidget(self.build) 
        buildGridLo.addWidget(self.build_twkctrls, 5, 0, 1, 4)
        tweakGridLo = QtGui.QGridLayout(self.build_twkctrls)
        tweakGridLo.setColumnMinimumWidth(0, 125) # make this columns in this control match build_apgrid
        tweakGridLo.setColumnMinimumWidth(1, 20)
        self.build_twkgdl = FileEntry(self.build_apctrls, configval(config, 'build', 'tweakgdlfile'), 'GDL Files (*.gdl *.gdh)')
        self.build_twkgdl.setMinimumWidth(250)
        tweakGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        tweakGridLo.addWidget(self.build_twkgdl, 0, 2, 1, columnSpan = 2) # cols 2-3
        self.build_twkpass = PassSpin(self.build_twkctrls)
        tweakpass = configval(config, 'build', 'tweakpass')
        if tweakpass : self.build_twkpass.setValue(int(tweakpass))
        tweakGridLo.addWidget(QtGui.QLabel('Tweaking positioning pass:          '******'build', 'tweakconstraint'))
        self.build_twktest.setMinimumWidth(250)
        self.build_twktest.setToolTip('GDL constraint code for tweak pass')
        tweakGridLo.addWidget(QtGui.QLabel('Tweak pass constraint:'), 2, 0, 1, columnSpan = 2)
        tweakGridLo.addWidget(self.build_twktest, 2, 2)
        if not self.build_tweak.text() :
            self.build_twkctrls.setEnabled(False)
       
        buildGridLo.setRowStretch(8, 1)
        self.tb.addItem(self.build, 'Build')

        # UI section
        self.ui = QtGui.QWidget(self.tb)
        uiGridLo = QtGui.QGridLayout(self.ui)

        self.ui_editorfont = QtGui.QLineEdit(self.ui)
        self.ui_editorfont.setText(configval(config, 'ui', 'editorfont'))
        self.ui_editorfont.setToolTip('Font to use for editor pane, or specification such as "monospace"')
        uiGridLo.addWidget(QtGui.QLabel('Editor font spec'), 0, 0)
        uiGridLo.addWidget(self.ui_editorfont, 0, 1)
        
        self.ui_size = QtGui.QSpinBox(self.ui)
        self.ui_size.setMaximumWidth(60)
        self.ui_size.setRange(1, 36)
        if config.has_option('ui', 'textsize') :
            self.ui_size.setValue(configintval(config, 'ui', 'textsize'))
        else :
            self.ui_size.setValue(10)
        self.ui_size.setToolTip('Text size in editing windows')
        uiGridLo.addWidget(QtGui.QLabel('Editor text point size'), 1, 0)
        uiGridLo.addWidget(self.ui_size, 1, 1)
        
        self.ui_tabstop = QtGui.QSpinBox(self.ui)
        self.ui_tabstop.setMaximumWidth(60)
        self.ui_tabstop.setRange(1, 100)
        if config.has_option('ui', 'tabstop') :
            self.ui_tabstop.setValue(configintval(config, 'ui', 'tabstop'))
        else :
            self.ui_tabstop.setValue(40)
        self.ui_tabstop.setToolTip('Tab stop in pixels')
        uiGridLo.addWidget(QtGui.QLabel('Tab stop width'), 2, 0)
        uiGridLo.addWidget(self.ui_tabstop, 2, 1)
        
        self.ui_gsize = QtGui.QSpinBox(self.ui)
        self.ui_gsize.setMaximumWidth(60)
        self.ui_gsize.setRange(1, 288)
        if config.has_option('main', 'size') :
            self.ui_gsize.setValue(configintval(config, 'main', 'size'))
        else :
            self.ui_gsize.setValue(40)
        self.ui_gsize.setToolTip('Pixel size of glyphs in the font window and results, passes, and rules panes')
        uiGridLo.addWidget(QtGui.QLabel('Font glyph pixel size'), 3, 0)
        uiGridLo.addWidget(self.ui_gsize, 3, 1)
        
        self.ui_twsize = QtGui.QSpinBox(self.ui)
        self.ui_twsize.setMaximumWidth(60)
        self.ui_twsize.setRange(1, 1088)
        if config.has_option('ui', 'tweakglyphsize') :
            self.ui_twsize.setValue(configintval(config, 'ui', 'tweakglyphsize'))
        else :
            self.ui_twsize.setValue(80)
        self.ui_twsize.setToolTip('Pixel size of glyphs in the Tweak editing window')
        uiGridLo.addWidget(QtGui.QLabel('Tweak glyph pixel size'), 4, 0)
        uiGridLo.addWidget(self.ui_twsize, 4, 1)
        
        self.ui_apsize = QtGui.QSpinBox(self.ui)
        self.ui_apsize.setMaximumWidth(60)
        self.ui_apsize.setRange(1, 1088)
        if config.has_option('ui', 'attglyphsize') :
            self.ui_apsize.setValue(configintval(config, 'ui', 'attglyphsize'))
        else :
            self.ui_apsize.setValue(200)
        self.ui_apsize.setToolTip('Pixel size of glyphs in the Attach editing window')
        uiGridLo.addWidget(QtGui.QLabel('Attachment glyph pixel size'), 5, 0)
        uiGridLo.addWidget(self.ui_apsize, 5, 1)
        
        self.ui_sizes = QtGui.QLineEdit(self.ui)
        self.ui_sizes.setText(configval(config, 'ui', 'waterfall'))
        self.ui_sizes.setToolTip('Point sizes for waterfall display, comma-separated; eg: 10, 12, 16, 20, 48')
        uiGridLo.addWidget(QtGui.QLabel('Waterfall sizes'), 6, 0)
        uiGridLo.addWidget(self.ui_sizes, 6, 1)
        
        self.ui_ent = QtGui.QCheckBox()
        self.ui_ent.setChecked(configintval(config, 'ui', 'entities'))
        self.ui_ent.setToolTip('Display entry strings using \\u type entities for non-ASCII chars')
        uiGridLo.addWidget(QtGui.QLabel('Display character entities'), 7, 0)
        uiGridLo.addWidget(self.ui_ent, 7, 1)
        
        self.ui_kernedges = QtGui.QCheckBox()
        self.ui_kernedges.setChecked(configintval(config, 'ui', 'kernedges'))
        self.ui_kernedges.setToolTip('Display the edges of glyphs that affect kerning in the Collisions tab')
        uiGridLo.addWidget(QtGui.QLabel('Display kerning edges'), 8, 0)
        uiGridLo.addWidget(self.ui_kernedges, 8, 1)
        
        uiGridLo.setRowStretch(9, 1)
        self.tb.addItem(self.ui, 'User Interface')
        
        self.resize(500, 500)
        self.tb.setCurrentIndex(currTab)
Example #19
0
    def __init__(self, config, currTab, parent = None) :
        super(ConfigDialog, self).__init__(parent)
        self.config = config
        
        self.setWindowTitle("Configure project")

        vboxLayout = QtGui.QVBoxLayout(self)
        self.tb = QtGui.QToolBox(self)
        vboxLayout.addWidget(self.tb)
        self.ok = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
        self.ok.accepted.connect(self.accept)
        self.ok.rejected.connect(self.reject)
        vboxLayout.addWidget(self.ok)

        # General section
        self.general = QtGui.QWidget(self.tb)
        genGridLay = QtGui.QGridLayout(self.general)
#        self.general_vb.setVerticalSpacing(0)
        self.general_font = FileEntry(self.general, configval(config, 'main', 'font'), 'Font Files (*.ttf)')
        genGridLay.addWidget(QtGui.QLabel('Font File:'), 0, 0)
        genGridLay.addWidget(self.general_font, 0, 1, 1, 2)
        self.general_gdl = FileEntry(self.general, configval(config, 'build', 'gdlfile'), 'GDL Files (*.gdl)')
        genGridLay.addWidget(QtGui.QLabel('GDL File:'), 1, 0)
        genGridLay.addWidget(self.general_gdl, 1, 1, 1, 2)
        self.general_tests = FileEntry(self.general, configval(config, 'main', 'testsfile'), 'Tests Lists (*.xml)')
        genGridLay.addWidget(QtGui.QLabel('Tests File:'), 2, 0)
        genGridLay.addWidget(self.general_tests, 2, 1, 1, 2)
        self.general_rtl = QtGui.QCheckBox()
        self.general_rtl.setChecked(configintval(config, 'main', 'defaultrtl'))
        genGridLay.addWidget(QtGui.QLabel('Default RTL'), 3, 0)
        genGridLay.addWidget(self.general_rtl, 3, 1)
        genGridLay.setRowStretch(4, 1)
        self.tb.addItem(self.general, "General")

        # Build section
        # column 0 = main sub-section labels, column 1 - indented labels, column 2 = control for main sub-section,
        # column 3 = controls for indented stuff
        self.build = QtGui.QWidget(self.tb)
        buildGridLo = QtGui.QGridLayout(self.build)
        
        # makegdl / attachment point generation
        #self.build_apxml = FileEntry(self.general, configval(config, 'main', 'ap'), 'AP Files (*.xml)')
        #self.build_apxml.textChanged.connect(self.apChanged)
        #buildGridLo.addWidget(QtGui.QLabel('Attachment point database:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        #buildGridLo.addWidget(self.build_apxml, 0, 2)

        self.build_gdlinc = FileEntry(self.general, configval(config, 'build', 'makegdlfile'), 'GDL Files (*.gdl *.gdh)')
        self.build_gdlinc.textChanged.connect(self.apChanged)
        buildGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        buildGridLo.addWidget(self.build_gdlinc, 0, 2)
        
        # sub-controls for AP generation, enabled or disabled as a unit
        self.build_apctrls = QtGui.QWidget(self.build) 
        buildGridLo.addWidget(self.build_apctrls, 1, 0, 1, 3)
        apGridLo = QtGui.QGridLayout(self.build_apctrls)
        apGridLo.setColumnMinimumWidth(0, 125) # !!! Make the columns in this control match build_twkgrid !!!
        apGridLo.setColumnMinimumWidth(1, 20)
        
        self.build_cmd = QtGui.QLineEdit(self.build_apctrls)
        self.build_cmd.setMinimumWidth(250)
        self.build_cmd.setText(configval(config, 'build', 'makegdlcmd'))
        self.build_cmd.setToolTip('External make gdl command: %a=AP Database, %f=Font File, %g=Generated GDL File,\n    %i=included GDL file %p=positioning pass number')
        apGridLo.addWidget(QtGui.QLabel('Make GDL Command:'), 0, 0)
        apGridLo.addWidget(self.build_cmd, 0, 2, 1, columnSpan = 3) # cols 1-3
        
        #self.build_gdlinc = FileEntry(self.build_apctrls, configval(config, 'build', 'makegdlfile'), 'GDL Files (*.gdl *.gdh)')
        #self.build_gdlinc.setMinimumWidth(250)
        #apGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 2, 0, 1, columnSpan = 2) # cols 0-1
        #apGridLo.addWidget(self.build_gdlinc, 2, 2, 1, columnSpan = 2) # cols 2-3
        
        self.build_apxml = FileEntry(self.build_apctrls, configval(config, 'main', 'ap'), 'AP Files (*.xml)')
        self.build_apxml.setMinimumWidth(250)
        apGridLo.addWidget(QtGui.QLabel('Attachment point database:'), 1, 0, 1, columnSpan = 2) # cols 0-1
        apGridLo.addWidget(self.build_apxml, 1, 2, 1, columnSpan = 2) # cols 2-3
        
        self.build_apronly = QtGui.QCheckBox()
        self.build_apronly.setChecked(configintval(config, 'build', 'apronly'))
        self.build_apronly.setDisabled(True)  # mechanism to update AP file from Graide is not reliable
        apGridLo.addWidget(QtGui.QLabel('AP Database is read-only:'), 2, 0, 1, columnSpan = 2) # cols 0-1
        apGridLo.addWidget(self.build_apronly, 2, 2)
        
        self.build_att = PassSpin(self.build_apctrls)
        attpass = configval(config, 'build', 'attpass')
        if attpass :
            self.build_att.setValue(int(attpass))
        apGridLo.addWidget(QtGui.QLabel('Attachment positioning pass:'******'build', 'ignorewarnings') :
            self.build_noWarning.setText(configval(config, 'build', 'ignorewarnings'))
        else :
            self.build_noWarning.setText("510,3521")  # warnings to ignore by default
        self.build_noWarning.setToolTip('List warning numbers to be ignored, or \'none\'')
        buildGridLo.addWidget(QtGui.QLabel('Ignore warnings:'), 4, 0, 1)
        buildGridLo.addWidget(self.build_noWarning, 4, 2, 1, columnSpan = 3) # cols 1-3
             
        # Tweaking controls
        self.build_tweak = FileEntry(self.general, configval(config, 'build', 'tweakxmlfile'), 'Tweak Files (*.xml)')
        self.build_tweak.textChanged.connect(self.tweakFileChanged)
        buildGridLo.addWidget(QtGui.QLabel('Position tweaker file'), 5, 0, 1, columnSpan = 2) # cols 0-1
        buildGridLo.addWidget(self.build_tweak, 5, 2)
        # sub-controls for AP generation, enabled or disabled as a unit
        self.build_twkctrls = QtGui.QWidget(self.build) 
        buildGridLo.addWidget(self.build_twkctrls, 6, 0, 1, 4)
        tweakGridLo = QtGui.QGridLayout(self.build_twkctrls)
        tweakGridLo.setColumnMinimumWidth(0, 125) # make this columns in this control match build_apgrid
        tweakGridLo.setColumnMinimumWidth(1, 20)
        self.build_twkgdl = FileEntry(self.build_apctrls, configval(config, 'build', 'tweakgdlfile'), 'GDL Files (*.gdl *.gdh)')
        self.build_twkgdl.setMinimumWidth(250)
        tweakGridLo.addWidget(QtGui.QLabel('Autogenerated GDL file:'), 0, 0, 1, columnSpan = 2) # cols 0-1
        tweakGridLo.addWidget(self.build_twkgdl, 0, 2, 1, columnSpan = 2) # cols 2-3
        self.build_twkpass = PassSpin(self.build_twkctrls)
        tweakpass = configval(config, 'build', 'tweakpass')
        if tweakpass : self.build_twkpass.setValue(int(tweakpass))
        tweakGridLo.addWidget(QtGui.QLabel('Tweaking positioning pass:          '******'build', 'tweakconstraint'))
        self.build_twktest.setMinimumWidth(250)
        self.build_twktest.setToolTip('GDL constraint code for tweak pass')
        tweakGridLo.addWidget(QtGui.QLabel('Tweak pass constraint:'), 2, 0, 1, columnSpan = 2)
        tweakGridLo.addWidget(self.build_twktest, 2, 2)
        if not self.build_tweak.text() :
            self.build_twkctrls.setEnabled(False)
       
        buildGridLo.setRowStretch(8, 1)
        self.tb.addItem(self.build, 'Build')

        # UI section
        self.ui = QtGui.QWidget(self.tb)
        uiGridLo = QtGui.QGridLayout(self.ui)

        self.ui_editorfont = QtGui.QLineEdit(self.ui)
        self.ui_editorfont.setText(configval(config, 'ui', 'editorfont'))
        self.ui_editorfont.setToolTip('Font to use for editor pane, or specification such as "monospace"')
        uiGridLo.addWidget(QtGui.QLabel('Editor font spec'), 0, 0)
        uiGridLo.addWidget(self.ui_editorfont, 0, 1)
        
        self.ui_size = QtGui.QSpinBox(self.ui)
        self.ui_size.setMaximumWidth(60)
        self.ui_size.setRange(1, 36)
        if config.has_option('ui', 'textsize') :
            self.ui_size.setValue(configintval(config, 'ui', 'textsize'))
        else :
            self.ui_size.setValue(10)
        self.ui_size.setToolTip('Text size in editing windows')
        uiGridLo.addWidget(QtGui.QLabel('Editor text point size'), 1, 0)
        uiGridLo.addWidget(self.ui_size, 1, 1)
        
        self.ui_tabstop = QtGui.QSpinBox(self.ui)
        self.ui_tabstop.setMaximumWidth(60)
        self.ui_tabstop.setRange(1, 100)
        if config.has_option('ui', 'tabstop') :
            self.ui_tabstop.setValue(configintval(config, 'ui', 'tabstop'))
        else :
            self.ui_tabstop.setValue(40)
        self.ui_tabstop.setToolTip('Tab stop in pixels')
        uiGridLo.addWidget(QtGui.QLabel('Tab stop width'), 2, 0)
        uiGridLo.addWidget(self.ui_tabstop, 2, 1)
        
        self.ui_gsize = QtGui.QSpinBox(self.ui)
        self.ui_gsize.setMaximumWidth(60)
        self.ui_gsize.setRange(1, 288)
        if config.has_option('main', 'size') :
            self.ui_gsize.setValue(configintval(config, 'main', 'size'))
        else :
            self.ui_gsize.setValue(40)
        self.ui_gsize.setToolTip('Pixel size of glyphs in the font window and results, passes, and rules panes')
        uiGridLo.addWidget(QtGui.QLabel('Font glyph pixel size'), 3, 0)
        uiGridLo.addWidget(self.ui_gsize, 3, 1)
        
        self.ui_twsize = QtGui.QSpinBox(self.ui)
        self.ui_twsize.setMaximumWidth(60)
        self.ui_twsize.setRange(1, 1088)
        if config.has_option('ui', 'tweakglyphsize') :
            self.ui_twsize.setValue(configintval(config, 'ui', 'tweakglyphsize'))
        else :
            self.ui_twsize.setValue(80)
        self.ui_twsize.setToolTip('Pixel size of glyphs in the Tweak editing window')
        uiGridLo.addWidget(QtGui.QLabel('Tweak glyph pixel size'), 4, 0)
        uiGridLo.addWidget(self.ui_twsize, 4, 1)
        
        self.ui_apsize = QtGui.QSpinBox(self.ui)
        self.ui_apsize.setMaximumWidth(60)
        self.ui_apsize.setRange(1, 1088)
        if config.has_option('ui', 'attglyphsize') :
            self.ui_apsize.setValue(configintval(config, 'ui', 'attglyphsize'))
        else :
            self.ui_apsize.setValue(200)
        self.ui_apsize.setToolTip('Pixel size of glyphs in the Attach editing window')
        uiGridLo.addWidget(QtGui.QLabel('Attachment glyph pixel size'), 5, 0)
        uiGridLo.addWidget(self.ui_apsize, 5, 1)
        
        self.ui_sizes = QtGui.QLineEdit(self.ui)
        self.ui_sizes.setText(configval(config, 'ui', 'waterfall'))
        self.ui_sizes.setToolTip('Point sizes for waterfall display, comma-separated; eg: 10, 12, 16, 20, 48')
        uiGridLo.addWidget(QtGui.QLabel('Waterfall sizes'), 6, 0)
        uiGridLo.addWidget(self.ui_sizes, 6, 1)
        
        self.ui_ent = QtGui.QCheckBox()
        self.ui_ent.setChecked(configintval(config, 'ui', 'entities'))
        self.ui_ent.setToolTip('Display entry strings using \\u type entities for non-ASCII chars')
        uiGridLo.addWidget(QtGui.QLabel('Display character entities'), 7, 0)
        uiGridLo.addWidget(self.ui_ent, 7, 1)
        
        self.ui_kernedges = QtGui.QCheckBox()
        self.ui_kernedges.setChecked(configintval(config, 'ui', 'kernedges'))
        self.ui_kernedges.setToolTip('Display the edges of glyphs that affect kerning in the Collisions tab')
        uiGridLo.addWidget(QtGui.QLabel('Display kerning edges'), 8, 0)
        uiGridLo.addWidget(self.ui_kernedges, 8, 1)
        
        uiGridLo.setRowStretch(9, 1)
        self.tb.addItem(self.ui, 'User Interface')
        
        self.resize(500, 500)
        self.tb.setCurrentIndex(currTab)