Ejemplo n.º 1
0
            for i in self.selectedIndexes() :
                g = i.data()
                res.append(g.GDLName())
            clipboard = QtGui.QApplication.clipboard()
            clipboard.setText("  ".join(res))
        else :
            super(FontView, self).keyPressEvent(event)

    def do_activate(self, index) :
        self.changeGlyph.emit(index.data(), self.model, True)

    def classSelected(self, name) :
        self.model.font.classSelected(name)
        self.viewport().update()

def clicked_glyph(index) :
    print str(index.data())

if __name__ == "__main__" :
    from graide.font import Font
    import sys

    app = QtGui.QApplication(sys.argv)
    font = Font()
    font.loadFont("/usr/share/fonts/opentype/charissil/CharisSIL-R.ttf")
    font.makebitmaps(40)
    table = FontView(font)
    table.activated.connect(clicked_glyph)
    table.show()
    sys.exit(app.exec_())
Ejemplo n.º 2
0
            parentIndex = parentIndex.parent()

        fileLoc = self.model.fileLocAt(treePath)
        if fileLoc : 
            self.app.selectLine(*fileLoc)

    def findMainFileLoc(self) :
        treePath = [0]   # for Glyph tab, assumes glyph number is the first
        fileLoc = self.model.fileLocAt(treePath)
        if fileLoc :
            self.app.selectLine(*fileLoc)
            
# end of class AttribView


if __name__ == '__main__' :

    from graide.font import Font
    import sys, os
 
    app = QtGui.QApplication(sys.argv)
    font = Font()
    tpath = os.path.join(os.path.dirname(sys.argv[0]), '../../tests/fonts/Padauk')
    font.loadFont(os.path.join(tpath, 'Padauk.ttf'), os.path.join(tpath, 'padauk.xml'))
    glyph = font.psnames['u1000']
    model = glyph.attribModel()
    view = AttribView(model)
    view.show()
    sys.exit(app.exec_())

Ejemplo n.º 3
0
                res.append(g.GDLName())
            clipboard = QtGui.QApplication.clipboard()
            clipboard.setText("  ".join(res))
        else:
            super(FontView, self).keyPressEvent(event)

    def do_activate(self, index):
        self.changeGlyph.emit(index.data(), self.model, True)

    def classSelected(self, name):
        self.model.font.classSelected(name)
        self.viewport().update()


def clicked_glyph(index):
    print str(index.data())


if __name__ == "__main__":
    from graide.font import Font
    import sys

    app = QtGui.QApplication(sys.argv)
    font = Font()
    font.loadFont("/usr/share/fonts/opentype/charissil/CharisSIL-R.ttf")
    font.makebitmaps(40)
    table = FontView(font)
    table.activated.connect(clicked_glyph)
    table.show()
    sys.exit(app.exec_())
Ejemplo n.º 4
0
        else:
            fileLoc = self.model.fileLocAt(treePath)
            if fileLoc:
                self.app.selectLine(*fileLoc)

    def findMainFileLoc(self):
        treePath = [0]  # for Glyph tab, assumes glyph number is the first
        fileLoc = self.model.fileLocAt(treePath)
        if fileLoc:
            self.app.selectLine(*fileLoc)


# end of class AttribView

if __name__ == '__main__':

    from graide.font import Font
    import sys, os

    app = QtGui.QApplication(sys.argv)
    font = Font()
    tpath = os.path.join(os.path.dirname(sys.argv[0]),
                         '../../tests/fonts/Padauk')
    font.loadFont(os.path.join(tpath, 'Padauk.ttf'),
                  os.path.join(tpath, 'padauk.xml'))
    glyph = font.psnames['u1000']
    model = glyph.attribModel()
    view = AttribView(model)
    view.show()
    sys.exit(app.exec_())