Skip to content

Instantly share code, notes, and snippets.

@line0
Last active August 29, 2015 14:02
Show Gist options
  • Save line0/e9eb1424c4366fb52632 to your computer and use it in GitHub Desktop.
Save line0/e9eb1424c4366fb52632 to your computer and use it in GitHub Desktop.
Fontlab Macro: copy glyph selection into clipboard
from Tkinter import Tk
tk = Tk()
import json
glyphs = fl.font.glyphs
sel = []
for i in range(len(glyphs)):
if fl.Selected(i):
sel.append({'name':glyphs[i].name, 'unicode':glyphs[i].unicode})
tk.withdraw()
tk.clipboard_clear()
tk.clipboard_append(json.dumps(sel))
tk.destroy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment