Skip to content

Instantly share code, notes, and snippets.

@typemytype
Created January 30, 2020 11:00
Show Gist options
  • Select an option

  • Save typemytype/78a26b77eb1c23367cc68f1792153c2f to your computer and use it in GitHub Desktop.

Select an option

Save typemytype/78a26b77eb1c23367cc68f1792153c2f to your computer and use it in GitHub Desktop.
# runs in drawbot
# shows all names of
import AppKit
names = [n for n in dir(AppKit) if n.startswith("NSImageName")]
for name in names:
im = AppKit.NSImage.imageNamed_(getattr(AppKit, name))
if im is None:
print(name)
continue
border = 10
tw, th = textSize(name)
w, h = im.size()
w = max([w, tw])
newPage(w + border * 2, h + border * 2 + th)
image(im, (border, border + th))
text(name, (border, border))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment