Skip to content

Commit

Permalink
add support for /? and /!
Browse files Browse the repository at this point in the history
  • Loading branch information
typemytype committed Dec 15, 2023
1 parent 7a59dc2 commit 5b98dcb
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,19 @@ def updatePreview(self):
def inputCallback(self, sender):
previewString = sender.get()
self.operator.lib[previewTextLibKey] = previewString
glyphNames = splitText(previewString, self.operator.getCharacterMapping())
glyphNames = []
for glyphName in splitText(previewString, self.operator.getCharacterMapping()):
if glyphName == "/?":
currentGlyph = CurrentGlyph()
if currentGlyph is not None:
glyphNames.append(currentGlyph.name)
elif glyphName == "/!":
currentFont = CurrentFont()
if currentFont is not None:
glyphNames.extend(currentFont.selectedGlyphNames)
else:
glyphNames.append(glyphName)

possibleKerningPairs = ((side1, side2) for side1, side2 in zip(glyphNames[:-1], glyphNames[1:]))
possibleKerningPairs = list(possibleKerningPairs)

Expand Down Expand Up @@ -448,6 +460,9 @@ def designspaceEditorSourcesDidChangeSelection(self, notification):
self.selectedSources = notification["selectedItems"]
self.updatePreview()

def roboFontDidSwitchCurrentGlyph(self, notification):
self.updatePreview()


if __name__ == '__main__':
designspace = CurrentDesignspace()
Expand Down

0 comments on commit 5b98dcb

Please sign in to comment.