def refresh(self): # - Init self.model.removeRows(0, self.model.rowCount()) self.data_glyphs = getProcessGlyphs(pMode) # - Set Items for glyph in self.data_glyphs: glyph_name = '' # - GlyphName if self.chk_glyphUnicode.isChecked(): try: glyph_name += str(hex(glyph.unicode)).upper() + '\t' except TypeError: glyph_name += ' '*6 + '\t' if self.chk_glyphName.isChecked(): glyph_name += glyph.name item = QtGui.QStandardItem(glyph_name) # - Set Mark if self.chk_glyphMark.isChecked(): new_color = QtGui.QColor(fontMarkColors[glyph.mark]) new_color.setAlpha(30) item.setBackground(QtGui.QBrush(new_color)) # - Set Check item.setCheckable(True) if self.chk_glyphChecked.isChecked(): item.setChecked(True) self.model.appendRow(item) self.lst_glyphNames.setModel(self.model)
def kern_value_changed(self, item): current_row, current_col = item.row(), item.column() current_layer = self.aux.data_fontKerning[0][current_col] current_pair = self.aux.data_fontKerning[2][current_row] #left, right = self.aux.data_fontKerning[2][current_row] #current_pair = (left.encode('ascii','ignore'), right.encode('ascii','ignore')) self.aux.active_font.kerning(current_layer)[current_pair] = int(item.text()) item.setForeground(QtGui.QBrush(self.flag_valueChanged)) if self.aux.btn_fontKerning_autoupdate.isChecked(): self.aux.active_font.update()