Skip to content

Instantly share code, notes, and snippets.

@line0
Created May 30, 2014 18:13
Show Gist options
  • Save line0/d7008b2f31cef3610ea7 to your computer and use it in GitHub Desktop.
Save line0/d7008b2f31cef3610ea7 to your computer and use it in GitHub Desktop.
Fontlab Macro: paste glyph selection from clipboard
from Tkinter import Tk
tk = Tk()
import json
tk.withdraw()
sel = json.loads(tk.clipboard_get())
tk.destroy()
glyphs = fl.font.glyphs
fl.Unselect()
for glyph in filter(lambda x: x.name in (y["name"] for y in sel) or
(x.unicode is not None and any(uni in x.unicodes for uni in (y["unicode"] for y in sel))),
glyphs):
fl.Select(glyph.index, True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment