def callbackEditUnicodeText(self, sender):
# this is the callback for the unicode textbox.
# if text is edited here, find the glyphs that are used in the text
# and add those to the selection. This way we can quickly add characters
# from cut / paste text to the selection
f = CurrentFont()
text = sender.get()
text = text.replace("\r", " ")
text = text.replace("\n", " ")
self._typing = True
if text:
glyphSelection = findText(self.data, text)
glyphSelection.sort()
items = [g.asDict(self._unicodes, self._names, self.joiningTypes) for g in glyphSelection]
items = sorted(items, key=lambda x: x['uni'], reverse=False)
self.w.selectedNames.set(items)
self.w.selectionUnicodeText.set(text)
self._typing = False
self.checkSampleSize()
评论列表
文章目录